Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
pielas committed Jun 24, 2024
1 parent 1bdf44d commit fc12954
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and (hasKey .Values "flinkK8sOperator") .Values.flinkK8sOperator.enabled }}
{{- if and (hasKey .Values "flinkK8sOperatorDeploymentManager") .Values.flinkK8sOperatorDeploymentManager.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -15,7 +15,7 @@ spec:
labels:
{{ include "nussknacker.labels" . | nindent 8 }}
spec:
serviceAccountName: nussknacker
serviceAccountName: {{ include "nussknacker.serviceAccountName" . }}
containers:
- name: delete-flinkdeployments
image: bitnami/kubectl:latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- if and (hasKey .Values "flinkK8sOperator") .Values.flinkK8sOperator.enabled }}
{{- if and (hasKey .Values "flinkK8sOperatorDeploymentManager") .Values.flinkK8sOperatorDeploymentManager.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: flink-deployment-creator
name: {{ default "flink-deployment-creator" .Values.flinkK8sOperatorDeploymentManager.flinkDeploymentCreatorRole }}
rules:
- apiGroups: ["flink.apache.org"]
resources: ["flinkdeployments"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{- if and (hasKey .Values "flinkK8sOperator") .Values.flinkK8sOperator.enabled }}
{{- if and (hasKey .Values "flinkK8sOperatorDeploymentManager") .Values.flinkK8sOperatorDeploymentManager.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: flink-deployment-creator-binding
name: {{ default "flink-deployment-creator" .Values.flinkK8sOperatorDeploymentManager.flinkDeploymentCreatorRole }}-rolebinding
subjects:
- kind: ServiceAccount
name: {{ include "nussknacker.serviceAccountName" . }}
roleRef:
kind: Role
name: flink-deployment-creator
name: {{ default "flink-deployment-creator" .Values.flinkK8sOperatorDeploymentManager.flinkDeploymentCreatorRole }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
4 changes: 2 additions & 2 deletions src/templates/flink-k8s-operator/flink-operator-role.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- if and (hasKey .Values "flinkK8sOperator") .Values.flinkK8sOperator.enabled }}
{{- if and (hasKey .Values "flinkK8sOperatorDeploymentManager") .Values.flinkK8sOperatorDeploymentManager.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: flink-operator-role
name: {{ default "flink-operator" .Values.flinkK8sOperatorDeploymentManager.flinkOperatorRole }}
rules:
- apiGroups: [""]
resources: ["pods"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{- if and (hasKey .Values "flinkK8sOperator") .Values.flinkK8sOperator.enabled }}
{{- if and (hasKey .Values "flinkK8sOperatorDeploymentManager") .Values.flinkK8sOperatorDeploymentManager.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: flink-operator-rolebinding
name: {{ default "flink-operator" .Values.flinkK8sOperatorDeploymentManager.flinkOperatorRole }}-rolebinding
subjects:
- kind: ServiceAccount
name: flink-service-account
name: {{ default "flink-service-account" .Values.flinkK8sOperatorDeploymentManager.flinkServiceAccount }}
roleRef:
kind: Role
name: flink-operator-role
name: {{ default "flink-operator" .Values.flinkK8sOperatorDeploymentManager.flinkOperatorRole }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
4 changes: 2 additions & 2 deletions src/templates/flink-k8s-operator/flink-service-account.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if and (hasKey .Values "flinkK8sOperator") .Values.flinkK8sOperator.enabled }}
{{- if and (hasKey .Values "flinkK8sOperatorDeploymentManager") .Values.flinkK8sOperatorDeploymentManager.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: flink-service-account
name: {{ default "flink-service-account" .Values.flinkK8sOperatorDeploymentManager.flinkServiceAccount }}
{{- end -}}
8 changes: 5 additions & 3 deletions src/templates/flink-k8s-operator/shared-volume-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{{- if and (hasKey .Values "flinkK8sOperator") .Values.flinkK8sOperator.enabled }}
{{- if and (hasKey .Values "flinkK8sOperatorDeploymentManager") .Values.flinkK8sOperatorDeploymentManager.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: payload-pvc-nfs
name: {{ .Values.flinkK8sOperatorDeploymentManager.sharedPVC.name }}
{{- if and (hasKey .Values.flinkK8sOperatorDeploymentManager.sharedPVC "keepAfterUninstall") .Values.flinkK8sOperatorDeploymentManager.sharedPVC.keepAfterUninstall }}
annotations:
"helm.sh/resource-policy": keep
{{- end }}
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storage: {{ default "1Gi" .Values.flinkK8sOperatorDeploymentManager.sharedPVC.storageSize }}
storageClassName: nfs
{{- end }}
4 changes: 3 additions & 1 deletion src/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ flink:
jobmanager:
statefulset: true

flinkK8sOperator:
flinkK8sOperatorDeploymentManager:
enabled: false
sharedPVC:
name: payload-pvc-nfs

grafana:
enabled: true
Expand Down

0 comments on commit fc12954

Please sign in to comment.