From 0adf65209f8273c4d2818b2937511817b6a840a7 Mon Sep 17 00:00:00 2001 From: Andrej Petras Date: Thu, 30 Nov 2023 16:07:24 +0100 Subject: [PATCH] feat: helm resource --- src/main/helm/Chart.yaml | 2 +- .../helm/templates/cluster-role-binding.yaml | 11 +++++++++++ src/main/helm/templates/cluster-role.yaml | 19 +++++++++++++++++++ src/main/helm/templates/service-account.yaml | 4 ++++ src/main/helm/values.yaml | 8 ++++++++ 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/main/helm/templates/cluster-role-binding.yaml create mode 100644 src/main/helm/templates/cluster-role.yaml create mode 100644 src/main/helm/templates/service-account.yaml diff --git a/src/main/helm/Chart.yaml b/src/main/helm/Chart.yaml index 84e3467..5ba14e0 100644 --- a/src/main/helm/Chart.yaml +++ b/src/main/helm/Chart.yaml @@ -15,4 +15,4 @@ dependencies: - name: helm-quarkus-app alias: app version: ^0 - repository: oci://ghcr.io/onecx/charts \ No newline at end of file + repository: oci://ghcr.io/onecx/charts diff --git a/src/main/helm/templates/cluster-role-binding.yaml b/src/main/helm/templates/cluster-role-binding.yaml new file mode 100644 index 0000000..48588e3 --- /dev/null +++ b/src/main/helm/templates/cluster-role-binding.yaml @@ -0,0 +1,11 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ .Release.Name }}-{{ .Values.app.name }}-role-binding +roleRef: + kind: ClusterRole + apiGroup: rbac.authorization.k8s.io + name: {{ .Release.Name }}-{{ .Values.app.name }}-cluster-role +subjects: + - kind: ServiceAccount + name: {{ .Release.Name }}-{{ .Values.app.name }} \ No newline at end of file diff --git a/src/main/helm/templates/cluster-role.yaml b/src/main/helm/templates/cluster-role.yaml new file mode 100644 index 0000000..f7576f2 --- /dev/null +++ b/src/main/helm/templates/cluster-role.yaml @@ -0,0 +1,19 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ .Release.Name }}-{{ .Values.app.name }}-cluster-role +rules: + - apiGroups: + - io.github.onecx.product.store + resources: + - products + - products/status + - products/finalizers + verbs: + - get + - list + - watch + - patch + - update + - create + - delete \ No newline at end of file diff --git a/src/main/helm/templates/service-account.yaml b/src/main/helm/templates/service-account.yaml new file mode 100644 index 0000000..56ccce8 --- /dev/null +++ b/src/main/helm/templates/service-account.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Release.Name }}-{{ .Values.app.name }} \ No newline at end of file diff --git a/src/main/helm/values.yaml b/src/main/helm/values.yaml index ef9453f..61b6cef 100644 --- a/src/main/helm/values.yaml +++ b/src/main/helm/values.yaml @@ -1,4 +1,12 @@ app: + name: product-operator image: repository: "onecx/onecx-product-store-operator" tag: 999-SNAPSHOT + envCustom: + - name: KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + serviceAccount: + enabled: true