# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "ancestor.fullname" . }}-ancestor
  labels:
  {{- include "ancestor.labels" . | nindent 4 }}
data:
  SETTLEMENT: {{ .Values.ancestor.settlement | quote }}
  WIDE-EYED_QUARTET: {{ .Values.ancestor.wideEyedQuartet | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "ancestor.fullname" . }}-ancestor
  labels:
  {{- include "ancestor.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: ancestor
spec:
  replicas: {{ .Values.ancestor.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: ancestor
      app.kubernetes.io/name: grandiose
    {{- include "ancestor.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: ancestor
        app.kubernetes.io/name: grandiose
      {{- include "ancestor.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 4627b52defc805994edc1a2de79574da16870a3b534828b79d5a86d9b0c2bb95
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "ancestor.fullname" . }}-ancestor
        image: {{ .Values.ancestor.ancestor.image.repository }}:{{ .Values.ancestor.ancestor.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.ancestor.ancestor.imagePullPolicy }}
        name: ancestor
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.ancestor.ancestor.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.ancestor.ancestor.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "ancestor.fullname" . }}-ancestor
  labels:
  {{- include "ancestor.labels" . | nindent 4 }}
spec:
  type: {{ .Values.ancestor.type }}
  selector:
    app.kubernetes.io/instance: ancestor
    app.kubernetes.io/name: grandiose
  {{- include "ancestor.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.ancestor.ports | toYaml | nindent 2 -}}
ancestor:
  ancestor:
    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
  settlement: publicity
  type: ClusterIP
  wideEyedQuartet: nightmare
kubernetesClusterDomain: cluster.local
