# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "gosling.fullname" . }}-gosling
  labels:
  {{- include "gosling.labels" . | nindent 4 }}
data:
  COFFIN_GLANCE: {{ .Values.gosling.coffinGlance | quote }}
  DAMP: {{ .Values.gosling.damp | quote }}
  EROSION: {{ .Values.gosling.erosion | quote }}
  INSTITUTION_QUALITY: {{ .Values.gosling.institutionQuality | quote }}
  MAPLE_TERRORIST: {{ .Values.gosling.mapleTerrorist | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "gosling.fullname" . }}-gosling
  labels:
  {{- include "gosling.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: gosling
spec:
  replicas: {{ .Values.gosling.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: gosling
      app.kubernetes.io/name: chard
    {{- include "gosling.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: gosling
        app.kubernetes.io/name: chard
      {{- include "gosling.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a14b2b04686e0a1b2c6e97241ec0a304ba762f2a653a154f6ceebddec9872811
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "gosling.fullname" . }}-gosling
        image: {{ .Values.gosling.gosling.image.repository }}:{{ .Values.gosling.gosling.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.gosling.gosling.imagePullPolicy }}
        name: gosling
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.gosling.gosling.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.gosling.gosling.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "gosling.fullname" . }}-gosling
  labels:
  {{- include "gosling.labels" . | nindent 4 }}
spec:
  type: {{ .Values.gosling.type }}
  selector:
    app.kubernetes.io/instance: gosling
    app.kubernetes.io/name: chard
  {{- include "gosling.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.gosling.ports | toYaml | nindent 2 -}}
gosling:
  coffinGlance: impossible
  damp: latter
  erosion: broadcast
  gosling:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  institutionQuality: interloper
  mapleTerrorist: warm
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
