From 6a010b14a76099cbc7994371827c482612f3e185 Mon Sep 17 00:00:00 2001 From: Josef Taha Date: Mon, 15 Jul 2024 21:12:05 +0200 Subject: [PATCH] chore: config-server operator helm chart --- .../config-server-operator/templates/crd.yaml | 66 +++++++++++++++++++ .../templates/deployment.yaml | 4 +- .../config-server-operator/templates/ns.yaml | 2 +- .../templates/service-account.yaml | 15 ++--- examples/0_minimal/key_value_pair.yaml | 2 +- 5 files changed, 76 insertions(+), 13 deletions(-) create mode 100644 chart/config-server-operator/templates/crd.yaml diff --git a/chart/config-server-operator/templates/crd.yaml b/chart/config-server-operator/templates/crd.yaml new file mode 100644 index 0000000..0ce7b73 --- /dev/null +++ b/chart/config-server-operator/templates/crd.yaml @@ -0,0 +1,66 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: configservers.datalab.tuwien.ac.at +spec: + scope: Namespaced + group: datalab.tuwien.ac.at + names: + kind: ConfigServer + plural: configservers + singular: configserver + shortNames: + - cfg-server + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: + type: object + properties: + spec: + type: object + properties: + image: + type: string + imagePullPolicy: + type: string + containerPort: + type: integer + configMountPath: + type: string + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: keyvaluepairs.datalab.tuwien.ac.at +spec: + scope: Namespaced + group: datalab.tuwien.ac.at + names: + kind: KeyValuePair + plural: keyvaluepairs + singular: keyvaluepair + shortNames: + - kvpair + - kvp + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: + type: object + properties: + spec: + type: object + properties: + config: + type: string + key: + type: string + value: + x-kubernetes-preserve-unknown-fields: true + type: object diff --git a/chart/config-server-operator/templates/deployment.yaml b/chart/config-server-operator/templates/deployment.yaml index b7d1d2e..bfebddd 100644 --- a/chart/config-server-operator/templates/deployment.yaml +++ b/chart/config-server-operator/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: config-server-operator - namespace: {{ .Values.namespace }} + namespace: "{{ .Values.namespace }}" spec: replicas: 1 strategy: @@ -18,4 +18,4 @@ spec: serviceAccountName: config-server-service-account containers: - name: config-server-operator - image: ghcr.io/tu-wien-datalab/config-server-operator:main + image: registry.datalab.tuwien.ac.at/config_server/operator:latest \ No newline at end of file diff --git a/chart/config-server-operator/templates/ns.yaml b/chart/config-server-operator/templates/ns.yaml index 594b03e..9e9bd86 100644 --- a/chart/config-server-operator/templates/ns.yaml +++ b/chart/config-server-operator/templates/ns.yaml @@ -1,4 +1,4 @@ apiVersion: v1 kind: Namespace metadata: - name: config-server-operator \ No newline at end of file + name: "{{ .Values.namespace }}" \ No newline at end of file diff --git a/chart/config-server-operator/templates/service-account.yaml b/chart/config-server-operator/templates/service-account.yaml index 03e1d99..c1ed539 100644 --- a/chart/config-server-operator/templates/service-account.yaml +++ b/chart/config-server-operator/templates/service-account.yaml @@ -3,28 +3,25 @@ apiVersion: v1 kind: ServiceAccount metadata: namespace: "{{ .Values.namespace }}" - name: kopfexample-account + name: config-server-service-account --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: kopfexample-role-cluster + name: config-server-cluster-role rules: - - # Framework: runtime observation of namespaces & CRDs (addition/deletion). - apiGroups: [apiextensions.k8s.io] resources: [customresourcedefinitions] verbs: [list, watch] + - apiGroups: [""] resources: [namespaces] verbs: [list, watch] - # Framework: admission webhook configuration management. - apiGroups: [admissionregistration.k8s.io/v1, admissionregistration.k8s.io/v1beta1] resources: [validatingwebhookconfigurations, mutatingwebhookconfigurations] verbs: [create, patch] - # Application: read-only access for watching cluster-wide. - apiGroups: [datalab.tuwien.ac.at] resources: [configservers, keyvaluepairs] verbs: [list, watch, create, patch, delete] @@ -33,12 +30,12 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: kopfexample-rolebinding-cluster + name: config-server-rolebinding-cluster roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: kopfexample-role-cluster + name: config-server-cluster-role subjects: - kind: ServiceAccount - name: kopfexample-account + name: config-server-service-account namespace: "{{ .Values.namespace }}" diff --git a/examples/0_minimal/key_value_pair.yaml b/examples/0_minimal/key_value_pair.yaml index 6a96b47..af423bf 100644 --- a/examples/0_minimal/key_value_pair.yaml +++ b/examples/0_minimal/key_value_pair.yaml @@ -2,7 +2,7 @@ apiVersion: datalab.tuwien.ac.at/v1 kind: KeyValuePair metadata: name: minimal-config-value-1 - namespace: config-server + namespace: config-server-operator spec: config: minimal-config key: test