# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "covariate.fullname" . }}-covariate
  labels:
  {{- include "covariate.labels" . | nindent 4 }}
data:
  ANORAK_SQUEALING: {{ .Values.covariate.anorakSquealing | quote }}
  ARCHITECT: {{ .Values.covariate.architect | quote }}
  DIAM: {{ .Values.covariate.diam | quote }}
  INSPIRATION_PUFFIN: {{ .Values.covariate.inspirationPuffin | quote }}
  SURFACE: {{ .Values.covariate.surface | quote }}
  TORNADO_BLOG: {{ .Values.covariate.tornadoBlog | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "covariate.fullname" . }}-covariate
  labels:
  {{- include "covariate.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: covariate
spec:
  replicas: {{ .Values.covariate.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: covariate
      app.kubernetes.io/name: stab
    {{- include "covariate.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: covariate
        app.kubernetes.io/name: stab
      {{- include "covariate.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: dc155dda6abdc2cbbac2354470f8b156d51ce21cb5f3eab65ff8e4b200ea3100
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "covariate.fullname" . }}-covariate
        image: {{ .Values.covariate.covariate.image.repository }}:{{ .Values.covariate.covariate.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.covariate.covariate.imagePullPolicy }}
        name: covariate
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.covariate.covariate.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.covariate.covariate.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "covariate.fullname" . }}-covariate
  labels:
  {{- include "covariate.labels" . | nindent 4 }}
spec:
  type: {{ .Values.covariate.type }}
  selector:
    app.kubernetes.io/instance: covariate
    app.kubernetes.io/name: stab
  {{- include "covariate.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.covariate.ports | toYaml | nindent 2 -}}
covariate:
  anorakSquealing: collection
  architect: govern
  covariate:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  diam: arrest
  inspirationPuffin: gondola
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  surface: bucket
  tornadoBlog: draconian
  type: ClusterIP
kubernetesClusterDomain: cluster.local
