# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "airfare.fullname" . }}-airfare
  labels:
  {{- include "airfare.labels" . | nindent 4 }}
data:
  ABLAZE: {{ .Values.airfare.ablaze | quote }}
  ARBITRATE_PATROLLING: {{ .Values.airfare.arbitratePatrolling | quote }}
  GLEE: {{ .Values.airfare.glee | quote }}
  PROPOSITION_TELL: {{ .Values.airfare.propositionTell | quote }}
  SECURITY_WIDTH: {{ .Values.airfare.securityWidth | quote }}
  SLIDER_ABUSE_ANCHOVY: {{ .Values.airfare.sliderAbuseAnchovy | quote }}
  SURPRISE_PENINSULA: {{ .Values.airfare.surprisePeninsula | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "airfare.fullname" . }}-airfare
  labels:
  {{- include "airfare.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: airfare
spec:
  replicas: {{ .Values.airfare.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: airfare
      app.kubernetes.io/name: shore
    {{- include "airfare.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: airfare
        app.kubernetes.io/name: shore
      {{- include "airfare.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: b70700f0dfb6472a4e5eb47df7356d277b25b418adfbc715427e8a7cbbbd9015
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "airfare.fullname" . }}-airfare
        image: {{ .Values.airfare.airfare.image.repository }}:{{ .Values.airfare.airfare.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.airfare.airfare.imagePullPolicy }}
        name: airfare
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.airfare.airfare.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.airfare.airfare.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "airfare.fullname" . }}-airfare
  labels:
  {{- include "airfare.labels" . | nindent 4 }}
spec:
  type: {{ .Values.airfare.type }}
  selector:
    app.kubernetes.io/instance: airfare
    app.kubernetes.io/name: shore
  {{- include "airfare.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.airfare.ports | toYaml | nindent 2 -}}
airfare:
  ablaze: census
  airfare:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  arbitratePatrolling: sentencing
  glee: erect
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  propositionTell: greenhouse
  replicas: 1
  securityWidth: campanile
  sliderAbuseAnchovy: larder
  surprisePeninsula: advise
  type: ClusterIP
kubernetesClusterDomain: cluster.local
