# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "airship.fullname" . }}-airship
  labels:
  {{- include "airship.labels" . | nindent 4 }}
data:
  BABE: {{ .Values.airship.babe | quote }}
  BASEBOARD_WALKWAY: {{ .Values.airship.baseboardWalkway | quote }}
  COUGAR: {{ .Values.airship.cougar | quote }}
  DEVILISH_LAMP_TEXTURE: {{ .Values.airship.devilishLampTexture | quote }}
  FILL_MEDDLE: {{ .Values.airship.fillMeddle | quote }}
  FINANCING_SHRED: {{ .Values.airship.financingShred | quote }}
  GENRE: {{ .Values.airship.genre | quote }}
  MEASURE_JUVENILE_CARDIGAN: {{ .Values.airship.measureJuvenileCardigan | quote }}
  SHALLOW: {{ .Values.airship.shallow | quote }}
  TRACTOR_EXULTANT_TOMORROW: {{ .Values.airship.tractorExultantTomorrow | quote }}
  TYPHOON_GRAVEL: {{ .Values.airship.typhoonGravel | quote }}
  VERSE: {{ .Values.airship.verse | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "airship.fullname" . }}-airship
  labels:
  {{- include "airship.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: airship
spec:
  replicas: {{ .Values.airship.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: airship
      app.kubernetes.io/name: housewife
    {{- include "airship.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: airship
        app.kubernetes.io/name: housewife
      {{- include "airship.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2005f8a311975129117d2f431aa17262965dce407516f245760b22c9871867e6
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "airship.fullname" . }}-airship
        image: {{ .Values.airship.airship.image.repository }}:{{ .Values.airship.airship.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.airship.airship.imagePullPolicy }}
        name: airship
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.airship.airship.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.airship.airship.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "airship.fullname" . }}-airship
  labels:
  {{- include "airship.labels" . | nindent 4 }}
spec:
  type: {{ .Values.airship.type }}
  selector:
    app.kubernetes.io/instance: airship
    app.kubernetes.io/name: housewife
  {{- include "airship.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.airship.ports | toYaml | nindent 2 -}}
airship:
  airship:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  babe: headphones
  baseboardWalkway: purchase
  cougar: mustache
  devilishLampTexture: pinot
  fillMeddle: nanoparticle
  financingShred: mother
  genre: broken
  measureJuvenileCardigan: porthole
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  shallow: trachoma
  tractorExultantTomorrow: native
  type: ClusterIP
  typhoonGravel: sourwood
  verse: stem
kubernetesClusterDomain: cluster.local
