Skip to content

Commit 9d5689f

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 28c848b + 58c31e0 commit 9d5689f

File tree

14 files changed

+231
-7
lines changed

14 files changed

+231
-7
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
branches: '*'
1212

1313
jobs:
14+
1415
changed-dirs:
1516
runs-on: ubuntu-latest
1617
outputs:
@@ -123,4 +124,22 @@ jobs:
123124
platforms: linux/amd64,linux/arm64
124125
push: ${{ github.event_name != 'pull_request' }}
125126
tags: ${{ steps.meta.outputs.tags }}
126-
labels: ${{ steps.meta.outputs.labels }}
127+
labels: ${{ steps.meta.outputs.labels }}
128+
129+
helm:
130+
runs-on: ubuntu-latest
131+
steps:
132+
- name: Checkout repository
133+
uses: actions/checkout@v4
134+
135+
- name: Setup Helm
136+
uses: azure/setup-helm@v3
137+
138+
- name: Login to GitHub Container Registry
139+
run: helm registry login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
140+
141+
- name: Package Helm chart
142+
run: helm package chart/config-server-operator --destination ./chart
143+
144+
- name: Push Helm chart to OCI registry
145+
run: helm push ./chart/config-server-operator-*.tgz oci://ghcr.io/tu-wien-datalab
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: config-server-operator
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "1.16.0"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: configservers.datalab.tuwien.ac.at
5+
spec:
6+
scope: Namespaced
7+
group: datalab.tuwien.ac.at
8+
names:
9+
kind: ConfigServer
10+
plural: configservers
11+
singular: configserver
12+
shortNames:
13+
- cfg-server
14+
versions:
15+
- name: v1
16+
served: true
17+
storage: true
18+
schema:
19+
openAPIV3Schema:
20+
type: object
21+
properties:
22+
spec:
23+
type: object
24+
properties:
25+
image:
26+
type: string
27+
imagePullPolicy:
28+
type: string
29+
containerPort:
30+
type: integer
31+
configMountPath:
32+
type: string
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: keyvaluepairs.datalab.tuwien.ac.at
5+
spec:
6+
scope: Namespaced
7+
group: datalab.tuwien.ac.at
8+
names:
9+
kind: KeyValuePair
10+
plural: keyvaluepairs
11+
singular: keyvaluepair
12+
shortNames:
13+
- kvpair
14+
- kvp
15+
versions:
16+
- name: v1
17+
served: true
18+
storage: true
19+
schema:
20+
openAPIV3Schema:
21+
type: object
22+
properties:
23+
spec:
24+
type: object
25+
properties:
26+
config:
27+
type: string
28+
key:
29+
type: string
30+
value:
31+
x-kubernetes-preserve-unknown-fields: true
32+
type: object
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: config-server-operator
5+
namespace: "{{ .Values.namespace }}"
6+
spec:
7+
replicas: 1
8+
strategy:
9+
type: Recreate
10+
selector:
11+
matchLabels:
12+
application: config-server-operator
13+
template:
14+
metadata:
15+
labels:
16+
application: config-server-operator
17+
spec:
18+
serviceAccountName: config-server-service-account
19+
containers:
20+
- name: config-server-operator
21+
image: ghcr.io/tu-wien-datalab/config-server-operator:sha-ad9a4e7
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: "{{ .Values.namespace }}"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# deletes crd ressoruces applied in the operators namespace
2+
# otherwise the deletion of the chart and namespace may stuck
3+
apiVersion: batch/v1
4+
kind: Job
5+
metadata:
6+
name: delete-custom-resources
7+
namespace: "{{ .Values.namespace }}"
8+
annotations:
9+
"helm.sh/hook": pre-delete
10+
spec:
11+
template:
12+
spec:
13+
serviceAccountName: config-server-service-account
14+
containers:
15+
- name: delete-custom-resources
16+
image: bitnami/kubectl:latest
17+
command:
18+
- /bin/sh
19+
- -c
20+
- |
21+
kubectl delete cfg-server --all -n {{ .Values.namespace }}
22+
kubectl delete kvp --all -n {{ .Values.namespace }}
23+
24+
restartPolicy: OnFailure
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
namespace: "{{ .Values.namespace }}"
5+
name: config-server-service-account
6+
---
7+
apiVersion: rbac.authorization.k8s.io/v1
8+
kind: ClusterRole
9+
metadata:
10+
name: config-server-cluster-role
11+
rules:
12+
- apiGroups: [apiextensions.k8s.io]
13+
resources: [customresourcedefinitions]
14+
verbs: [list, watch]
15+
16+
- apiGroups: [""]
17+
resources: [configmaps, services, namespaces, events]
18+
verbs: [list, watch, create, patch, delete, get]
19+
20+
- apiGroups: [admissionregistration.k8s.io/v1, admissionregistration.k8s.io/v1beta1]
21+
resources: [validatingwebhookconfigurations, mutatingwebhookconfigurations]
22+
verbs: [create, patch]
23+
24+
- apiGroups: [datalab.tuwien.ac.at]
25+
resources: [configservers, keyvaluepairs]
26+
verbs: [list, watch, create, patch, delete, get]
27+
28+
- apiGroups: ["apps"]
29+
resources: [deployments]
30+
verbs: [list, watch, create, patch, delete]
31+
32+
---
33+
apiVersion: rbac.authorization.k8s.io/v1
34+
kind: ClusterRoleBinding
35+
metadata:
36+
name: config-server-rolebinding-cluster
37+
roleRef:
38+
apiGroup: rbac.authorization.k8s.io
39+
kind: ClusterRole
40+
name: config-server-cluster-role
41+
subjects:
42+
- kind: ServiceAccount
43+
name: config-server-service-account
44+
namespace: "{{ .Values.namespace }}"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
namespace: config-server-operator

0 commit comments

Comments
 (0)