Skip to content

Commit

Permalink
chore: config-server operator helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
joseftaha committed Jul 15, 2024
1 parent 1f81883 commit 6a010b1
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 13 deletions.
66 changes: 66 additions & 0 deletions chart/config-server-operator/templates/crd.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions chart/config-server-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: config-server-operator
namespace: {{ .Values.namespace }}
namespace: "{{ .Values.namespace }}"
spec:
replicas: 1
strategy:
Expand All @@ -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
2 changes: 1 addition & 1 deletion chart/config-server-operator/templates/ns.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: config-server-operator
name: "{{ .Values.namespace }}"
15 changes: 6 additions & 9 deletions chart/config-server-operator/templates/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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 }}"
2 changes: 1 addition & 1 deletion examples/0_minimal/key_value_pair.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6a010b1

Please sign in to comment.