Skip to content

Commit

Permalink
feat: added helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-jaeger committed Jul 15, 2024
1 parent a3f0fd3 commit 09fbb97
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 1 deletion.
23 changes: 23 additions & 0 deletions chart/config-server-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions chart/config-server-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: config-server-operator
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
21 changes: 21 additions & 0 deletions chart/config-server-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: config-server-operator
namespace: {{ .Values.namespace }}
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
application: config-server-operator
template:
metadata:
labels:
application: config-server-operator
spec:
serviceAccountName: config-server-service-account
containers:
- name: config-server-operator
image: ghcr.io/tu-wien-datalab/config-server-operator:main
4 changes: 4 additions & 0 deletions chart/config-server-operator/templates/ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: config-server-operator
44 changes: 44 additions & 0 deletions chart/config-server-operator/templates/service-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: "{{ .Values.namespace }}"
name: kopfexample-account
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kopfexample-role-cluster
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]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kopfexample-rolebinding-cluster
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kopfexample-role-cluster
subjects:
- kind: ServiceAccount
name: kopfexample-account
namespace: "{{ .Values.namespace }}"
1 change: 1 addition & 0 deletions chart/config-server-operator/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
namespace: config-server-operator
2 changes: 1 addition & 1 deletion examples/0_minimal/config_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: datalab.tuwien.ac.at/v1
kind: ConfigServer
metadata:
name: minimal-config
namespace: config-server
namespace: config-server-operator
spec:
image: ghcr.io/tu-wien-datalab/config-server:main
imagePullPolicy: IfNotPresent
Expand Down

0 comments on commit 09fbb97

Please sign in to comment.