-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flink k8s operator improvements (#162)
* test * test * removed unnecessaryn file * bumped download-artifacts * fix * test * test * fix * potential fix * test * fixes * fix * test
- Loading branch information
Showing
9 changed files
with
88 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
src/templates/flink-k8s-operator/flink-deployment-creator-role.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
{{- if and (hasKey .Values "enterprise.flinkK8sOperatorDeploymentManager") .Values.enterprise.flinkK8sOperatorDeploymentManager.enabled }} | ||
{{- $originalContext := . -}} | ||
{{- with .Values.enterprise -}} | ||
{{- with .flinkK8sOperatorDeploymentManager -}} | ||
{{- if .enabled }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: {{ default "flink-deployment-creator" .Values.enterprise.flinkK8sOperatorDeploymentManager.flinkDeploymentCreatorRole }} | ||
name: {{ default "flink-deployment-creator" .flinkDeploymentCreatorRole }} | ||
labels: | ||
{{ include "nussknacker.labels" . | nindent 4 }} | ||
{{ include "nussknacker.labels" $originalContext | nindent 4 }} | ||
rules: | ||
- apiGroups: ["flink.apache.org"] | ||
resources: ["flinkdeployments"] | ||
verbs: ["create", "delete", "list", "update", "get"] | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
15 changes: 10 additions & 5 deletions
15
src/templates/flink-k8s-operator/flink-deployment-creator-rolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
{{- if and (hasKey .Values "enterprise.flinkK8sOperatorDeploymentManager") .Values.enterprise.flinkK8sOperatorDeploymentManager.enabled }} | ||
{{- $originalContext := . -}} | ||
{{- with .Values.enterprise -}} | ||
{{- with .flinkK8sOperatorDeploymentManager -}} | ||
{{- if .enabled }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ default "flink-deployment-creator" .Values.enterprise.flinkK8sOperatorDeploymentManager.flinkDeploymentCreatorRole }}-rolebinding | ||
name: {{ default "flink-deployment-creator" .flinkDeploymentCreatorRole }}-rolebinding | ||
labels: | ||
{{ include "nussknacker.labels" . | nindent 4 }} | ||
{{- include "nussknacker.labels" $originalContext | nindent 4 }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "nussknacker.serviceAccountName" . }} | ||
name: {{ include "nussknacker.serviceAccountName" $originalContext }} | ||
roleRef: | ||
kind: Role | ||
name: {{ default "flink-deployment-creator" .Values.enterprise.flinkK8sOperatorDeploymentManager.flinkDeploymentCreatorRole }} | ||
name: {{ default "flink-deployment-creator" .flinkDeploymentCreatorRole }} | ||
apiGroup: rbac.authorization.k8s.io | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 10 additions & 5 deletions
15
src/templates/flink-k8s-operator/flink-operator-rolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
{{- if and (hasKey .Values "enterprise.flinkK8sOperatorDeploymentManager") .Values.enterprise.flinkK8sOperatorDeploymentManager.enabled }} | ||
{{- $originalContext := . -}} | ||
{{- with .Values.enterprise -}} | ||
{{- with .flinkK8sOperatorDeploymentManager -}} | ||
{{- if .enabled }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ default "flink-operator" .Values.enterprise.flinkK8sOperatorDeploymentManager.flinkOperatorRole }}-rolebinding | ||
name: {{ default "flink-operator" .flinkOperatorRole }}-rolebinding | ||
labels: | ||
{{ include "nussknacker.labels" . | nindent 4 }} | ||
{{- include "nussknacker.labels" $originalContext | nindent 4 }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ default "flink-service-account" .Values.enterprise.flinkK8sOperatorDeploymentManager.flinkServiceAccount }} | ||
name: {{ default "flink-service-account" .flinkServiceAccount }} | ||
roleRef: | ||
kind: Role | ||
name: {{ default "flink-operator" .Values.enterprise.flinkK8sOperatorDeploymentManager.flinkOperatorRole }} | ||
name: {{ default "flink-operator" .flinkOperatorRole }} | ||
apiGroup: rbac.authorization.k8s.io | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
11 changes: 8 additions & 3 deletions
11
src/templates/flink-k8s-operator/flink-service-account.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
{{- if and (hasKey .Values "enterprise.flinkK8sOperatorDeploymentManager") .Values.enterprise.flinkK8sOperatorDeploymentManager.enabled }} | ||
{{- $originalContext := . -}} | ||
{{- with .Values.enterprise -}} | ||
{{- with .flinkK8sOperatorDeploymentManager -}} | ||
{{- if .enabled }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ default "flink-service-account" .Values.enterprise.flinkK8sOperatorDeploymentManager.flinkServiceAccount }} | ||
name: {{ default "flink-service-account" .flinkServiceAccount }} | ||
labels: | ||
{{ include "nussknacker.labels" . | nindent 4 }} | ||
{{ include "nussknacker.labels" $originalContext | nindent 4 }} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} |
19 changes: 13 additions & 6 deletions
19
src/templates/flink-k8s-operator/jar-shared-volume-pvc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
{{- if and (hasKey .Values "enterprise.flinkK8sOperatorDeploymentManager") .Values.enterprise.flinkK8sOperatorDeploymentManager.enabled }} | ||
{{- $originalContext := . -}} | ||
{{- with .Values.enterprise -}} | ||
{{- with .flinkK8sOperatorDeploymentManager -}} | ||
{{- if .enabled }} | ||
{{- with .jobJarStorage -}} | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ .Values.enterprise.flinkK8sOperatorDeploymentManager.jobJarStorage.pvcName }} | ||
{{- if and (hasKey .Values.enterprise.flinkK8sOperatorDeploymentManager.jobJarStorage "keepAfterUninstall") .Values.enterprise.flinkK8sOperatorDeploymentManager.jobJarStorage.keepAfterUninstall }} | ||
name: {{ .pvcName }} | ||
{{- if and (hasKey . "keepAfterUninstall") .keepAfterUninstall }} | ||
annotations: | ||
"helm.sh/resource-policy": keep | ||
{{- end }} | ||
labels: | ||
{{ include "nussknacker.labels" . | nindent 4 }} | ||
{{ include "nussknacker.labels" $originalContext | nindent 4 }} | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
resources: | ||
requests: | ||
storage: {{ default "1Gi" .Values.enterprise.flinkK8sOperatorDeploymentManager.jobJarStorage.pvcSize }} | ||
{{- with .Values.enterprise.flinkK8sOperatorDeploymentManager.jobJarStorage.pvcStorageClassName }} | ||
storage: {{ default "1Gi" .pvcSize }} | ||
{{- with .pvcStorageClassName }} | ||
storageClassName: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
19 changes: 13 additions & 6 deletions
19
src/templates/flink-k8s-operator/job-state-shared-volume-pvc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
{{- if and (hasKey .Values "enterprise.flinkK8sOperatorDeploymentManager") .Values.enterprise.flinkK8sOperatorDeploymentManager.enabled }} | ||
{{- $originalContext := . -}} | ||
{{- with .Values.enterprise -}} | ||
{{- with .flinkK8sOperatorDeploymentManager -}} | ||
{{- if .enabled }} | ||
{{- with .jobStateStorage -}} | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ .Values.enterprise.flinkK8sOperatorDeploymentManager.jobStateStorage.pvcName }} | ||
{{- if and (hasKey .Values.enterprise.flinkK8sOperatorDeploymentManager.jobStateStorage "keepAfterUninstall") .Values.enterprise.flinkK8sOperatorDeploymentManager.jobStateStorage.keepAfterUninstall }} | ||
name: {{ .pvcName }} | ||
{{- if and (hasKey . "keepAfterUninstall") .keepAfterUninstall }} | ||
annotations: | ||
"helm.sh/resource-policy": keep | ||
{{- end }} | ||
labels: | ||
{{ include "nussknacker.labels" . | nindent 4 }} | ||
{{ include "nussknacker.labels" $originalContext | nindent 4 }} | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
resources: | ||
requests: | ||
storage: {{ default "1Gi" .Values.enterprise.flinkK8sOperatorDeploymentManager.jobStateStorage.pvcSize }} | ||
{{- with .Values.enterprise.flinkK8sOperatorDeploymentManager.jobStateStorage.pvcStorageClassName }} | ||
storage: {{ default "1Gi" .pvcSize }} | ||
{{- with .pvcStorageClassName }} | ||
storageClassName: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |