# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "whirlwind.fullname" . }}-whirlwind
  labels:
  {{- include "whirlwind.labels" . | nindent 4 }}
data:
  FOREVER: {{ .Values.whirlwind.forever | quote }}
  INITIATE: {{ .Values.whirlwind.initiate | quote }}
  NEGLIGEE_BEGIN: {{ .Values.whirlwind.negligeeBegin | quote }}
  THERAPY: {{ .Values.whirlwind.therapy | quote }}
  WARN: {{ .Values.whirlwind.warn | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "whirlwind.fullname" . }}-whirlwind
  labels:
  {{- include "whirlwind.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: whirlwind
spec:
  replicas: {{ .Values.whirlwind.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: whirlwind
      app.kubernetes.io/name: retouching
    {{- include "whirlwind.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: whirlwind
        app.kubernetes.io/name: retouching
      {{- include "whirlwind.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 578ed824ab4d42891bb039326955db8d5c9cafd28aa872146369ea45fbd440d3
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "whirlwind.fullname" . }}-whirlwind
        image: {{ .Values.whirlwind.whirlwind.image.repository }}:{{ .Values.whirlwind.whirlwind.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.whirlwind.whirlwind.imagePullPolicy }}
        name: whirlwind
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.whirlwind.whirlwind.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.whirlwind.whirlwind.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "whirlwind.fullname" . }}-whirlwind
  labels:
  {{- include "whirlwind.labels" . | nindent 4 }}
spec:
  type: {{ .Values.whirlwind.type }}
  selector:
    app.kubernetes.io/instance: whirlwind
    app.kubernetes.io/name: retouching
  {{- include "whirlwind.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.whirlwind.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
whirlwind:
  forever: ethyl
  initiate: deceive
  negligeeBegin: bidet
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  therapy: yesterday
  type: ClusterIP
  warn: tiresome
  whirlwind:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
