# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "kilometer.fullname" . }}-kilometer
  labels:
  {{- include "kilometer.labels" . | nindent 4 }}
data:
  DIPLOMA: {{ .Values.kilometer.diploma | quote }}
  EXPORT_INDUSTRIALISATION: {{ .Values.kilometer.exportIndustrialisation | quote
    }}
  HANDFUL_FOLK_RELUCTANCE: {{ .Values.kilometer.handfulFolkReluctance | quote }}
  THING_ENZYME: {{ .Values.kilometer.thingEnzyme | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "kilometer.fullname" . }}-kilometer
  labels:
  {{- include "kilometer.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: kilometer
spec:
  replicas: {{ .Values.kilometer.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: kilometer
      app.kubernetes.io/name: probability
    {{- include "kilometer.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: kilometer
        app.kubernetes.io/name: probability
      {{- include "kilometer.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 6cc6d012ae9b901626edb093cb11a33a80a17b4aa3eaaeb16977ec7d5242ba7a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "kilometer.fullname" . }}-kilometer
        image: {{ .Values.kilometer.kilometer.image.repository }}:{{ .Values.kilometer.kilometer.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.kilometer.kilometer.imagePullPolicy }}
        name: kilometer
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.kilometer.kilometer.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.kilometer.kilometer.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "kilometer.fullname" . }}-kilometer
  labels:
  {{- include "kilometer.labels" . | nindent 4 }}
spec:
  type: {{ .Values.kilometer.type }}
  selector:
    app.kubernetes.io/instance: kilometer
    app.kubernetes.io/name: probability
  {{- include "kilometer.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.kilometer.ports | toYaml | nindent 2 -}}
kilometer:
  diploma: scatter
  exportIndustrialisation: puggle
  handfulFolkReluctance: pressroom
  kilometer:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  thingEnzyme: industry
  type: ClusterIP
kubernetesClusterDomain: cluster.local
