Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Openshift compatibility #431

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0835ecd
added service account to daemonset and bumped operator-rs to 0.39.0
adwk67 Apr 4, 2023
feee679
updated changelog
adwk67 Apr 4, 2023
daa9d17
adapted security context
adwk67 Apr 4, 2023
0b7d760
added scc
adwk67 Apr 4, 2023
a157d2b
extended role for opa builder
adwk67 Apr 4, 2023
0c4271e
temp deactivation of preflight check
adwk67 Apr 4, 2023
d19b3cd
reactivate preflight check
adwk67 Apr 4, 2023
243f4ab
WIP temp change pull policy
adwk67 Apr 4, 2023
940249c
WIP
adwk67 Apr 4, 2023
df28c38
bring rbac implementation in line with other operators
adwk67 Apr 5, 2023
e7d1e69
fixed imports
adwk67 Apr 5, 2023
adf1370
added missing list permission needed on openshift
adwk67 Apr 5, 2023
c57a047
reverted pull policy
adwk67 Apr 5, 2023
cd557cc
added missing watch permission to clusterrole
adwk67 Apr 6, 2023
92674a3
merged main
maltesander Apr 6, 2023
471f649
fixed errors
maltesander Apr 6, 2023
f764e63
fixed patches
maltesander Apr 6, 2023
4883519
Merge remote-tracking branch 'origin/main' into openshift-compatibility
maltesander Apr 6, 2023
85582b6
reordering client calls
maltesander Apr 6, 2023
7b6eeaf
reverted patch reference, WIP to allow image pull
adwk67 Apr 6, 2023
2bf63b0
extend status permissions
adwk67 Apr 6, 2023
eae1f5f
extended role permissions
adwk67 Apr 6, 2023
5b44f32
cleaned up role/pull changes
adwk67 Apr 11, 2023
596bbc7
add service account and rolebinding to cluster resources
adwk67 Apr 11, 2023
37e1b78
bump operator-rs to 0.40.0
adwk67 Apr 11, 2023
a45e381
removed duplicate patch operation
adwk67 Apr 11, 2023
58f217d
remove clones
maltesander Apr 11, 2023
36bb58c
Merge remote-tracking branch 'origin/openshift-compatibility' into op…
maltesander Apr 11, 2023
485d9d9
remove hardcoded sa and bindign names from errors
maltesander Apr 11, 2023
4d348da
bumped operator-rs to 0.40.1
adwk67 Apr 12, 2023
a363792
Merge branch 'openshift-compatibility' of github.com:stackabletech/op…
adwk67 Apr 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file.

### Added

- Cluster status conditions ([#428])
- Cluster status conditions ([#428]).
- Extend cluster resources for status and cluster operation (paused, stopped) ([430]).

### Changed
Expand All @@ -16,15 +16,18 @@ All notable changes to this project will be documented in this file.
This change is breaking, because - for security reasons - we default to the `cluster-internal` `ListenerClass`.
If you need your cluster to be accessible from outside of Kubernetes you need to set `clusterConfig.listenerClass`
to `external-unstable` or `external-stable` ([#432]).
- `operator-rs` `0.27.1` -> `0.39.0` ([#411], [#420], [#430]).
- `operator-rs` `0.27.1` -> `0.40.0` ([#411], [#420], [#430], [#431]).
- Fragmented `OpaConfig` ([#411]).
- Bumped stackable image versions to `23.4.0-rc2` ([#420]).
- Enabled logging ([#420]).
- Openshift compatibility: extended roles ([#431]).
- Use operator-rs `build_rbac_resources` method ([#431]).

[#411]: https://github.com/stackabletech/opa-operator/pull/411
[#420]: https://github.com/stackabletech/opa-operator/pull/420
[#428]: https://github.com/stackabletech/opa-operator/pull/428
[#430]: https://github.com/stackabletech/opa-operator/pull/430
[#431]: https://github.com/stackabletech/opa-operator/pull/431
[#432]: https://github.com/stackabletech/opa-operator/pull/432

## [23.1.0] - 2023-01-23
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions deploy/helm/opa-operator/templates/roles-opa-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ rules:
- get
- watch
- list
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
- apiGroups:
- security.openshift.io
resources:
- securitycontextconstraints
resourceNames:
- opa-scc
verbs:
- use
{{ end }}
85 changes: 85 additions & 0 deletions deploy/helm/opa-operator/templates/roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,88 @@ rules:
- {{ include "operator.name" . }}clusters/status
verbs:
- patch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterroles
verbs:
- bind
resourceNames:
- {{ include "operator.name" . }}-clusterrole

{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
---
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: opa-scc
annotations:
kubernetes.io/description: |-
This resource is derived from hostmount-anyuid. It provides all the features of the
restricted SCC but allows host mounts and any UID by a pod. This is primarily
used by the persistent volume recycler. WARNING: this SCC allows host file
system access as any UID, including UID 0. Grant with caution.
release.openshift.io/create-only: "true"
allowHostDirVolumePlugin: true
allowHostIPC: false
allowHostNetwork: false
allowHostPID: false
allowHostPorts: false
allowPrivilegeEscalation: true
allowPrivilegedContainer: false
allowedCapabilities: null
defaultAddCapabilities: null
fsGroup:
type: RunAsAny
groups: []
priority: null
readOnlyRootFilesystem: false
runAsUser:
type: RunAsAny
seLinuxContext:
type: MustRunAs
supplementalGroups:
type: RunAsAny
volumes:
- configMap
- downwardAPI
- emptyDir
- hostPath
- nfs
- persistentVolumeClaim
- projected
- secret
- ephemeral
{{ end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "operator.name" . }}-clusterrole
rules:
- apiGroups:
- ""
resources:
- configmaps
- secrets
- serviceaccounts
verbs:
- get
- list
- watch
- apiGroups:
- events.k8s.io
resources:
- events
verbs:
- create
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
- apiGroups:
- security.openshift.io
resources:
- securitycontextconstraints
resourceNames:
- opa-scc
verbs:
- use
{{ end }}
2 changes: 1 addition & 1 deletion rust/crd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version = "0.0.0-dev"
publish = false

[dependencies]
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.39.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.40.0" }

semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions rust/operator-binary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version = "0.0.0-dev"
publish = false

[dependencies]
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.39.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.40.0" }
stackable-opa-crd = { path = "../crd" }

clap = "4.1"
Expand All @@ -27,5 +27,5 @@ pin-project = "1.0"

[build-dependencies]
built = { version = "0.5", features = ["chrono", "git2"] }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.39.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.40.0" }
stackable-opa-crd = { path = "../crd" }
Loading