# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "typhoon.fullname" . }}-typhoon
  labels:
  {{- include "typhoon.labels" . | nindent 4 }}
data:
  EMPHASIS: {{ .Values.typhoon.emphasis | quote }}
  PERIODIC_HIRE_MINISTER: {{ .Values.typhoon.periodicHireMinister | quote }}
  STOCKINGS_SHAKE_BUTANE: {{ .Values.typhoon.stockingsShakeButane | quote }}
  TORTE_LANDSCAPE: {{ .Values.typhoon.torteLandscape | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "typhoon.fullname" . }}-typhoon
  labels:
  {{- include "typhoon.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: typhoon
spec:
  replicas: {{ .Values.typhoon.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: typhoon
      app.kubernetes.io/name: opponent
    {{- include "typhoon.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: typhoon
        app.kubernetes.io/name: opponent
      {{- include "typhoon.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 73225f1b9daf0806924af716a222d7b8bc973d46e04065d265c605dc2bc78d99
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "typhoon.fullname" . }}-typhoon
        image: {{ .Values.typhoon.typhoon.image.repository }}:{{ .Values.typhoon.typhoon.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.typhoon.typhoon.imagePullPolicy }}
        name: typhoon
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.typhoon.typhoon.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.typhoon.typhoon.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "typhoon.fullname" . }}-typhoon
  labels:
  {{- include "typhoon.labels" . | nindent 4 }}
spec:
  type: {{ .Values.typhoon.type }}
  selector:
    app.kubernetes.io/instance: typhoon
    app.kubernetes.io/name: opponent
  {{- include "typhoon.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.typhoon.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
typhoon:
  emphasis: visual
  periodicHireMinister: drill
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  stockingsShakeButane: robot
  torteLandscape: burst
  type: ClusterIP
  typhoon:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
