# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "stance.fullname" . }}-stance
  labels:
  {{- include "stance.labels" . | nindent 4 }}
data:
  ERECT_OVERHEARD_LONGING: {{ .Values.stance.erectOverheardLonging | quote }}
  SLEET_INVADER_AFTERMATH: {{ .Values.stance.sleetInvaderAftermath | quote }}
  WING_RELATE: {{ .Values.stance.wingRelate | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "stance.fullname" . }}-stance
  labels:
  {{- include "stance.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: stance
spec:
  replicas: {{ .Values.stance.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: stance
      app.kubernetes.io/name: replace
    {{- include "stance.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: stance
        app.kubernetes.io/name: replace
      {{- include "stance.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 762b4f0683ebe598cca084956e9cf5d1fc9e75fccdd37970134913e126fcff6c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "stance.fullname" . }}-stance
        image: {{ .Values.stance.stance.image.repository }}:{{ .Values.stance.stance.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.stance.stance.imagePullPolicy }}
        name: stance
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.stance.stance.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.stance.stance.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "stance.fullname" . }}-stance
  labels:
  {{- include "stance.labels" . | nindent 4 }}
spec:
  type: {{ .Values.stance.type }}
  selector:
    app.kubernetes.io/instance: stance
    app.kubernetes.io/name: replace
  {{- include "stance.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.stance.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
stance:
  erectOverheardLonging: bewildered
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  sleetInvaderAftermath: sleep
  stance:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  wingRelate: value
