# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "green.fullname" . }}-green
  labels:
  {{- include "green.labels" . | nindent 4 }}
data:
  FLECK_TRIAL_DREAMER: {{ .Values.green.fleckTrialDreamer | quote }}
  LACE: {{ .Values.green.lace | quote }}
  PATTYPAN_BOATYARD_SIGNIFICANCE: {{ .Values.green.pattypanBoatyardSignificance |
    quote }}
  SKINNY_AWARD_MUSCLE: {{ .Values.green.skinnyAwardMuscle | quote }}
  SWEETS: {{ .Values.green.sweets | quote }}
  WALKING_SHIELD_UGLY: {{ .Values.green.walkingShieldUgly | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "green.fullname" . }}-green
  labels:
  {{- include "green.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: green
spec:
  replicas: {{ .Values.green.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: green
      app.kubernetes.io/name: downgrade
    {{- include "green.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: green
        app.kubernetes.io/name: downgrade
      {{- include "green.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 384c15996061869b2bdeafad7f70007941a1d5425ce0e4eb9ff89efcc6f5a16d
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "green.fullname" . }}-green
        image: {{ .Values.green.green.image.repository }}:{{ .Values.green.green.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.green.green.imagePullPolicy }}
        name: green
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.green.green.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.green.green.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "green.fullname" . }}-green
  labels:
  {{- include "green.labels" . | nindent 4 }}
spec:
  type: {{ .Values.green.type }}
  selector:
    app.kubernetes.io/instance: green
    app.kubernetes.io/name: downgrade
  {{- include "green.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.green.ports | toYaml | nindent 2 -}}
green:
  fleckTrialDreamer: limestone
  green:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  lace: baggy
  pattypanBoatyardSignificance: alpaca
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  skinnyAwardMuscle: publisher
  sweets: custard
  type: ClusterIP
  walkingShieldUgly: beginning
kubernetesClusterDomain: cluster.local
