# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "ringworm.fullname" . }}-ringworm
  labels:
  {{- include "ringworm.labels" . | nindent 4 }}
data:
  ALIEN_SWALLOW: {{ .Values.ringworm.alienSwallow | quote }}
  DISCOVERY_FATHER: {{ .Values.ringworm.discoveryFather | quote }}
  STEP-UNCLE_VOLATILITY_SPEAK: {{ .Values.ringworm.stepUncleVolatilitySpeak | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "ringworm.fullname" . }}-ringworm
  labels:
  {{- include "ringworm.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: ringworm
spec:
  replicas: {{ .Values.ringworm.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: ringworm
      app.kubernetes.io/name: incense
    {{- include "ringworm.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: ringworm
        app.kubernetes.io/name: incense
      {{- include "ringworm.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 8fac9ca6ad7fa5f95d21274a15a72d6fdf82e012433f64cea7501e8da3c2d022
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "ringworm.fullname" . }}-ringworm
        image: {{ .Values.ringworm.ringworm.image.repository }}:{{ .Values.ringworm.ringworm.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.ringworm.ringworm.imagePullPolicy }}
        name: ringworm
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.ringworm.ringworm.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.ringworm.ringworm.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "ringworm.fullname" . }}-ringworm
  labels:
  {{- include "ringworm.labels" . | nindent 4 }}
spec:
  type: {{ .Values.ringworm.type }}
  selector:
    app.kubernetes.io/instance: ringworm
    app.kubernetes.io/name: incense
  {{- include "ringworm.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.ringworm.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
ringworm:
  alienSwallow: bury
  discoveryFather: statute
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  ringworm:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  stepUncleVolatilitySpeak: governance
  type: ClusterIP
