-
Notifications
You must be signed in to change notification settings - Fork 66
✨ (hack) Make service-account optional #1956
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# kustomization file for secure OLMv1 | ||
# DO NOT ADD A NAMESPACE HERE | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../../../base/operator-controller | ||
- ../../../base/common | ||
components: | ||
- ../../../components/tls/operator-controller | ||
|
||
patches: | ||
- target: | ||
kind: Deployment | ||
name: operator-controller-controller-manager | ||
path: patches/enable-featuregate.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# enable synthetic-user feature gate | ||
- op: add | ||
path: /spec/template/spec/containers/0/args/- | ||
value: "--feature-gates=WebhookSupport=true" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# Welcome to the OwnNamespace install mode demo | ||
# | ||
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT | ||
|
||
# list namespaces | ||
kubectl get ns | ||
|
||
# show cluster extension definition | ||
bat --style=plain hack/demo/resources/optional-sa/cluster-extension.yaml | ||
|
||
# apply cluster extension | ||
kubectl apply -f ${DEMO_RESOURCE_DIR}/optional-sa/cluster-extension.yaml | ||
|
||
# wait for install to complete | ||
kubectl wait clusterextension zookeeper-operator --for=condition=Installed=true | ||
|
||
# see full cluster extension | ||
kubectl get clusterextension zookeeper-operator -o yaml | ||
|
||
# show deployment | ||
kubectl get deployments -n zookeeper-operator |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
apiVersion: olm.operatorframework.io/v1 | ||
kind: ClusterExtension | ||
metadata: | ||
name: zookeeper-operator | ||
spec: | ||
namespace: zookeeper-operator | ||
source: | ||
sourceType: Catalog | ||
catalog: | ||
packageName: zookeeper-operator | ||
version: 0.17.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,7 @@ type InstalledBundleGetter interface { | |
//+kubebuilder:rbac:groups=core,resources=serviceaccounts/token,verbs=create | ||
//+kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get | ||
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles;clusterrolebindings;roles;rolebindings,verbs=list;watch | ||
//+kubebuilder:rbac:groups=*,resources=*,verbs=* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would not it result in OLM have all possible permissions, do we want that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's an open question at the moment. But given that we can create tokens for any service account, that's essentially what we have already XDD |
||
|
||
//+kubebuilder:rbac:groups=olm.operatorframework.io,resources=clustercatalogs,verbs=list;watch | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, can we create one to bind if the user does not provide an SA?
Is that?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the point of this PR was just to demo the kind of UX I'm after. It just made it so that you could stamp out a ClusterExtension and everything would "just work". I didn't really think about all the odds and ends. I think the idea here was: if user doesn't specify an sa, just use olm's.