# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "expansion.fullname" . }}-expansion
  labels:
  {{- include "expansion.labels" . | nindent 4 }}
data:
  GRASSHOPPER_PORT_KOALA: {{ .Values.expansion.grasshopperPortKoala | quote }}
  PEGBOARD_NOTATION_RITUAL: {{ .Values.expansion.pegboardNotationRitual | quote }}
  POLO_YOUTH: {{ .Values.expansion.poloYouth | quote }}
  REDHEAD: {{ .Values.expansion.redhead | quote }}
  TORPID_INDICATOR_MAIZE: {{ .Values.expansion.torpidIndicatorMaize | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "expansion.fullname" . }}-expansion
  labels:
  {{- include "expansion.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: expansion
spec:
  replicas: {{ .Values.expansion.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: expansion
      app.kubernetes.io/name: plow
    {{- include "expansion.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: expansion
        app.kubernetes.io/name: plow
      {{- include "expansion.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: cc90762de8a6d91b6a182e67eeccaa228bf64a3af1a38d23fd6ae6a5ba7b0f0c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "expansion.fullname" . }}-expansion
        image: {{ .Values.expansion.expansion.image.repository }}:{{ .Values.expansion.expansion.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.expansion.expansion.imagePullPolicy }}
        name: expansion
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.expansion.expansion.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.expansion.expansion.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "expansion.fullname" . }}-expansion
  labels:
  {{- include "expansion.labels" . | nindent 4 }}
spec:
  type: {{ .Values.expansion.type }}
  selector:
    app.kubernetes.io/instance: expansion
    app.kubernetes.io/name: plow
  {{- include "expansion.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.expansion.ports | toYaml | nindent 2 -}}
expansion:
  expansion:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  grasshopperPortKoala: semicircle
  pegboardNotationRitual: ambitious
  poloYouth: volunteering
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  redhead: pottery
  replicas: 1
  torpidIndicatorMaize: abstracted
  type: ClusterIP
kubernetesClusterDomain: cluster.local
