# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "pasture.fullname" . }}-pasture
  labels:
  {{- include "pasture.labels" . | nindent 4 }}
data:
  EMPLOYER_DETAINMENT: {{ .Values.pasture.employerDetainment | quote }}
  HAIRCUT: {{ .Values.pasture.haircut | quote }}
  INSULATION: {{ .Values.pasture.insulation | quote }}
  KNOW-HOW: {{ .Values.pasture.knowHow | quote }}
  LIMIT: {{ .Values.pasture.limit | quote }}
  OPENING_UNIVERSE_PHYSICAL: {{ .Values.pasture.openingUniversePhysical | quote }}
  OVERLOAD_CHARMING: {{ .Values.pasture.overloadCharming | quote }}
  PARTNERSHIP_EASE_CHILI: {{ .Values.pasture.partnershipEaseChili | quote }}
  PHOSPHATE_GOAL_OCTET: {{ .Values.pasture.phosphateGoalOctet | quote }}
  SNOW_SCATTERED: {{ .Values.pasture.snowScattered | quote }}
  THANKFUL: {{ .Values.pasture.thankful | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "pasture.fullname" . }}-pasture
  labels:
  {{- include "pasture.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: pasture
spec:
  replicas: {{ .Values.pasture.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: pasture
      app.kubernetes.io/name: periodic
    {{- include "pasture.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: pasture
        app.kubernetes.io/name: periodic
      {{- include "pasture.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 74488b799885133e1d20b548168cce5ffb658114cc99a72aa68812409c5c5081
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "pasture.fullname" . }}-pasture
        image: {{ .Values.pasture.pasture.image.repository }}:{{ .Values.pasture.pasture.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.pasture.pasture.imagePullPolicy }}
        name: pasture
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.pasture.pasture.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.pasture.pasture.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "pasture.fullname" . }}-pasture
  labels:
  {{- include "pasture.labels" . | nindent 4 }}
spec:
  type: {{ .Values.pasture.type }}
  selector:
    app.kubernetes.io/instance: pasture
    app.kubernetes.io/name: periodic
  {{- include "pasture.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.pasture.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
pasture:
  employerDetainment: shade
  haircut: grandchild
  insulation: generate
  knowHow: verdict
  limit: auditorium
  openingUniversePhysical: marked
  overloadCharming: pacemaker
  partnershipEaseChili: accessory
  pasture:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  phosphateGoalOctet: negotiation
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  snowScattered: locust
  thankful: trigonometry
  type: ClusterIP
