Browse Source

Merge "Use apps/v1 k8s controllers and add labels"

changes/16/688516/1
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
0cbb5cf9b7
  1. 8
      charts/shipyard/templates/deployment-airflow-scheduler.yaml
  2. 8
      charts/shipyard/templates/deployment-shipyard.yaml
  3. 12
      charts/shipyard/templates/statefulset-airflow-worker.yaml

8
charts/shipyard/templates/deployment-airflow-scheduler.yaml

@ -24,12 +24,13 @@
{{- if .Values.manifests.deployment_airflow_scheduler }}
{{- $envAll := . }}
{{- $labels := tuple $envAll "airflow" "scheduler" | include "helm-toolkit.snippets.kubernetes_metadata_labels" -}}
{{- $serviceAccountName := "airflow-scheduler" }}
{{ tuple $envAll "airflow_server" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
{{- $mounts_airflow_scheduler := .Values.pod.mounts.airflow_scheduler.airflow_scheduler }}
{{- $mounts_airflow_scheduler_init := .Values.pod.mounts.airflow_scheduler.init_container }}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: airflow-scheduler
@ -37,11 +38,14 @@ metadata:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
spec:
replicas: {{ .Values.pod.replicas.airflow.scheduler }}
selector:
matchLabels:
{{ $labels | indent 6 }}
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
template:
metadata:
labels:
{{ tuple $envAll "airflow" "scheduler" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
{{ $labels | indent 8 }}
annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
configmap-bin-hash: {{ tuple "configmap-airflow-bin.yaml" . | include "helm-toolkit.utils.hash" }}

8
charts/shipyard/templates/deployment-shipyard.yaml

@ -15,13 +15,14 @@
{{- if .Values.manifests.deployment_shipyard }}
{{- $envAll := . }}
{{- $labels := tuple $envAll "shipyard" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" -}}
{{- $serviceAccountName := "shipyard" }}
{{- $mounts_shipyard := .Values.pod.mounts.shipyard.shipyard }}
{{- $mounts_shipyard_init := .Values.pod.mounts.shipyard.init_container }}
{{ tuple $envAll "shipyard" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: shipyard-api
@ -29,11 +30,14 @@ metadata:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
spec:
replicas: {{ .Values.pod.replicas.shipyard.api }}
selector:
matchLabels:
{{ $labels | indent 6 }}
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
template:
metadata:
labels:
{{ tuple $envAll "shipyard" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
{{ $labels | indent 8 }}
annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
shipyard-configmap-bin-hash: {{ tuple "configmap-shipyard-bin.yaml" . | include "helm-toolkit.utils.hash" }}

12
charts/shipyard/templates/statefulset-airflow-worker.yaml

@ -15,10 +15,11 @@
{{- if .Values.manifests.statefulset_airflow_worker }}
{{- $envAll := . }}
{{- $labels := tuple $envAll "airflow" "worker" | include "helm-toolkit.snippets.kubernetes_metadata_labels" -}}
{{- $serviceAccountName := "airflow-worker" }}
{{ tuple $envAll "airflow_server" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: airflow-worker-runner
@ -45,7 +46,7 @@ rules:
- create
- patch
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: run-airflow-worker
@ -58,7 +59,7 @@ roleRef:
name: airflow-worker-runner
apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: airflow-worker
@ -76,10 +77,13 @@ spec:
updateStrategy:
type: OnDelete
replicas: {{ .Values.pod.replicas.airflow.worker }}
selector:
matchLabels:
{{ $labels | indent 6 }}
template:
metadata:
labels:
{{ tuple $envAll "airflow" "worker" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
{{ $labels | indent 8 }}
annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
spec:

Loading…
Cancel
Save