# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "pheasant.fullname" . }}-pheasant
  labels:
  {{- include "pheasant.labels" . | nindent 4 }}
data:
  AUTHOR: {{ .Values.pheasant.author | quote }}
  ECHIDNA_SUICIDE: {{ .Values.pheasant.echidnaSuicide | quote }}
  ENDURE_DIRNDL: {{ .Values.pheasant.endureDirndl | quote }}
  PURPLE_EDITION: {{ .Values.pheasant.purpleEdition | quote }}
  RIDDLE: {{ .Values.pheasant.riddle | quote }}
  TRANSLATE_TENOR: {{ .Values.pheasant.translateTenor | quote }}
  TRIM: {{ .Values.pheasant.trim | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "pheasant.fullname" . }}-pheasant
  labels:
  {{- include "pheasant.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: pheasant
spec:
  replicas: {{ .Values.pheasant.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: pheasant
      app.kubernetes.io/name: chem
    {{- include "pheasant.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: pheasant
        app.kubernetes.io/name: chem
      {{- include "pheasant.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: f3c2fcfb3dfdb5c2e96a9b38d0e2424139b729f249942dbf9089333325ce485c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "pheasant.fullname" . }}-pheasant
        image: {{ .Values.pheasant.pheasant.image.repository }}:{{ .Values.pheasant.pheasant.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.pheasant.pheasant.imagePullPolicy }}
        name: pheasant
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.pheasant.pheasant.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.pheasant.pheasant.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "pheasant.fullname" . }}-pheasant
  labels:
  {{- include "pheasant.labels" . | nindent 4 }}
spec:
  type: {{ .Values.pheasant.type }}
  selector:
    app.kubernetes.io/instance: pheasant
    app.kubernetes.io/name: chem
  {{- include "pheasant.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.pheasant.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
pheasant:
  author: upgrade
  echidnaSuicide: injunction
  endureDirndl: profile
  pheasant:
    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
  purpleEdition: whelp
  replicas: 1
  riddle: council
  translateTenor: prick
  trim: smooth
  type: ClusterIP
