# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "swanky.fullname" . }}-swanky
  labels:
  {{- include "swanky.labels" . | nindent 4 }}
data:
  BRUISE_SPECIALTY: {{ .Values.swanky.bruiseSpecialty | quote }}
  DEPRESSIVE: {{ .Values.swanky.depressive | quote }}
  HAZELNUT_NUMERIC_SHOOTDOWN: {{ .Values.swanky.hazelnutNumericShootdown | quote
    }}
  INCUBATION: {{ .Values.swanky.incubation | quote }}
  OLIVE_OFFICER: {{ .Values.swanky.oliveOfficer | quote }}
  SHOOTDOWN: {{ .Values.swanky.shootdown | quote }}
  WESTERN: {{ .Values.swanky.western | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "swanky.fullname" . }}-swanky
  labels:
  {{- include "swanky.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: swanky
spec:
  replicas: {{ .Values.swanky.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: swanky
      app.kubernetes.io/name: attain
    {{- include "swanky.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: swanky
        app.kubernetes.io/name: attain
      {{- include "swanky.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 207cd25cc422cb55793342530896e77b71bbca6dd02ea9f280ef7fbb132c3aab
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "swanky.fullname" . }}-swanky
        image: {{ .Values.swanky.swanky.image.repository }}:{{ .Values.swanky.swanky.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.swanky.swanky.imagePullPolicy }}
        name: swanky
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.swanky.swanky.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.swanky.swanky.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "swanky.fullname" . }}-swanky
  labels:
  {{- include "swanky.labels" . | nindent 4 }}
spec:
  type: {{ .Values.swanky.type }}
  selector:
    app.kubernetes.io/instance: swanky
    app.kubernetes.io/name: attain
  {{- include "swanky.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.swanky.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
swanky:
  bruiseSpecialty: pianist
  depressive: withstand
  hazelnutNumericShootdown: shoestring
  incubation: eleventh
  oliveOfficer: sorrow
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  shootdown: battleship
  swanky:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  western: forelimb
