From 318fafa45e3211f5fda642af7f470d433c20243b Mon Sep 17 00:00:00 2001 From: Michael Kelly Date: Wed, 30 Nov 2022 20:51:47 -0800 Subject: [PATCH] k8s: Added deploy cluster admin template This combines the rbac-admin.yaml with operator.yaml into a single deployment template which will match what we generate from the helm chart. Change-Id: I90842afb38405cdec8b8c9e1d093f2c62e22be2f --- deploy/operator-cluster-admin.yaml | 41 ++++++++++++++++++++++++++++++ deploy/rbac-admin.yaml | 18 ------------- doc/source/index.rst | 3 +-- 3 files changed, 42 insertions(+), 20 deletions(-) create mode 100644 deploy/operator-cluster-admin.yaml delete mode 100644 deploy/rbac-admin.yaml diff --git a/deploy/operator-cluster-admin.yaml b/deploy/operator-cluster-admin.yaml new file mode 100644 index 0000000..43eea75 --- /dev/null +++ b/deploy/operator-cluster-admin.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: zuul-operator +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: zuul-operator +subjects: +- kind: ServiceAccount + name: zuul-operator + namespace: default +roleRef: + kind: ClusterRole + name: cluster-admin + apiGroup: rbac.authorization.k8s.io +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: zuul-operator +spec: + replicas: 1 + selector: + matchLabels: + name: zuul-operator + template: + metadata: + labels: + name: zuul-operator + spec: + serviceAccountName: zuul-operator + containers: + - name: operator + image: "docker.io/zuul/zuul-operator" + imagePullPolicy: "IfNotPresent" + env: + - name: ZUUL_IMAGE_VERSION + value: latest diff --git a/deploy/rbac-admin.yaml b/deploy/rbac-admin.yaml deleted file mode 100644 index c5abf5c..0000000 --- a/deploy/rbac-admin.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: zuul-operator ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: zuul-operator -subjects: -- kind: ServiceAccount - name: zuul-operator - namespace: default -roleRef: - kind: ClusterRole - name: cluster-admin - apiGroup: rbac.authorization.k8s.io diff --git a/doc/source/index.rst b/doc/source/index.rst index b77d887..e985758 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -38,8 +38,7 @@ From the root of the zuul-operator repo, run: .. code-block:: bash kubectl apply -f deploy/crds/zuul-ci_v1alpha1_zuul_crd.yaml - kubectl apply -f deploy/rbac-admin.yaml - kubectl apply -f deploy/operator.yaml + kubectl apply -f deploy/operator-cluster-admin.yaml You probably want a namespace, so go ahead and create one with: