# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "capitulation.fullname" . }}-capitulation
  labels:
  {{- include "capitulation.labels" . | nindent 4 }}
data:
  HEALTH_TRAFFIC_PRECEDENCE: {{ .Values.capitulation.healthTrafficPrecedence | quote
    }}
  LIMO_BEANSTALK: {{ .Values.capitulation.limoBeanstalk | quote }}
  PARSLEY_AMBIENCE: {{ .Values.capitulation.parsleyAmbience | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "capitulation.fullname" . }}-capitulation
  labels:
  {{- include "capitulation.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: capitulation
spec:
  replicas: {{ .Values.capitulation.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: capitulation
      app.kubernetes.io/name: linguist
    {{- include "capitulation.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: capitulation
        app.kubernetes.io/name: linguist
      {{- include "capitulation.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: eda2979c1f08a66634017931e09ba35233b862d63f768ca59210590e000111f0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "capitulation.fullname" . }}-capitulation
        image: {{ .Values.capitulation.capitulation.image.repository }}:{{ .Values.capitulation.capitulation.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.capitulation.capitulation.imagePullPolicy }}
        name: capitulation
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.capitulation.capitulation.resources | nindent 10
          }}
        securityContext: {{- toYaml .Values.capitulation.capitulation.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "capitulation.fullname" . }}-capitulation
  labels:
  {{- include "capitulation.labels" . | nindent 4 }}
spec:
  type: {{ .Values.capitulation.type }}
  selector:
    app.kubernetes.io/instance: capitulation
    app.kubernetes.io/name: linguist
  {{- include "capitulation.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.capitulation.ports | toYaml | nindent 2 -}}
capitulation:
  capitulation:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  healthTrafficPrecedence: delight
  limoBeanstalk: emanate
  parsleyAmbience: whirl
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
