# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "geography.fullname" . }}-geography
  labels:
  {{- include "geography.labels" . | nindent 4 }}
data:
  AHEAD: {{ .Values.geography.ahead | quote }}
  CANVAS: {{ .Values.geography.canvas | quote }}
  CREW: {{ .Values.geography.crew | quote }}
  LAST: {{ .Values.geography.last | quote }}
  MAILBOX_SUBSEQUENT: {{ .Values.geography.mailboxSubsequent | quote }}
  PHILOSOPHER_BRAKE_FORCE: {{ .Values.geography.philosopherBrakeForce | quote }}
  SCANNER: {{ .Values.geography.scanner | quote }}
  SPIDERLING_SELLER_STRONG: {{ .Values.geography.spiderlingSellerStrong | quote }}
  SURROUNDS: {{ .Values.geography.surrounds | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "geography.fullname" . }}-geography
  labels:
  {{- include "geography.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: geography
spec:
  replicas: {{ .Values.geography.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: geography
      app.kubernetes.io/name: convert
    {{- include "geography.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: geography
        app.kubernetes.io/name: convert
      {{- include "geography.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 713037ce269e72bf53e4d1a838ec847736c2a9a6d0c3deafcddfc657601fbd06
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "geography.fullname" . }}-geography
        image: {{ .Values.geography.geography.image.repository }}:{{ .Values.geography.geography.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.geography.geography.imagePullPolicy }}
        name: geography
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.geography.geography.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.geography.geography.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "geography.fullname" . }}-geography
  labels:
  {{- include "geography.labels" . | nindent 4 }}
spec:
  type: {{ .Values.geography.type }}
  selector:
    app.kubernetes.io/instance: geography
    app.kubernetes.io/name: convert
  {{- include "geography.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.geography.ports | toYaml | nindent 2 -}}
geography:
  ahead: family
  canvas: agonizing
  crew: disarm
  geography:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  last: granny
  mailboxSubsequent: cicada
  philosopherBrakeForce: principal
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  scanner: pocketbook
  spiderlingSellerStrong: attack
  surrounds: tutu
  type: ClusterIP
kubernetesClusterDomain: cluster.local
