# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "oak.fullname" . }}-oak
  labels:
  {{- include "oak.labels" . | nindent 4 }}
data:
  ACCURACY_NICETY_MUSICIAN: {{ .Values.oak.accuracyNicetyMusician | quote }}
  BANG_VIVO: {{ .Values.oak.bangVivo | quote }}
  CACTUS_THUNDERBOLT_KAPUT: {{ .Values.oak.cactusThunderboltKaput | quote }}
  CODON: {{ .Values.oak.codon | quote }}
  FAINT: {{ .Values.oak.faint | quote }}
  RADIO_SOMERSAULT_PULSE: {{ .Values.oak.radioSomersaultPulse | quote }}
  RECALL: {{ .Values.oak.recall | quote }}
  SYNDICATE_STALLION_DONOR: {{ .Values.oak.syndicateStallionDonor | quote }}
  TROT: {{ .Values.oak.trot | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "oak.fullname" . }}-oak
  labels:
  {{- include "oak.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: oak
spec:
  replicas: {{ .Values.oak.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: oak
      app.kubernetes.io/name: girdle
    {{- include "oak.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: oak
        app.kubernetes.io/name: girdle
      {{- include "oak.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 8a343781c46aa2f96df5325a8accbd4ad74ec2b68e444e7087496779125714e9
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "oak.fullname" . }}-oak
        image: {{ .Values.oak.oak.image.repository }}:{{ .Values.oak.oak.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.oak.oak.imagePullPolicy }}
        name: oak
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.oak.oak.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.oak.oak.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "oak.fullname" . }}-oak
  labels:
  {{- include "oak.labels" . | nindent 4 }}
spec:
  type: {{ .Values.oak.type }}
  selector:
    app.kubernetes.io/instance: oak
    app.kubernetes.io/name: girdle
  {{- include "oak.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.oak.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
oak:
  accuracyNicetyMusician: antigen
  bangVivo: haircut
  cactusThunderboltKaput: shark
  codon: causeway
  faint: watch
  oak:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  radioSomersaultPulse: trip
  recall: disagreement
  replicas: 1
  syndicateStallionDonor: serial
  trot: porcupine
  type: ClusterIP
