# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "package.fullname" . }}-package
  labels:
  {{- include "package.labels" . | nindent 4 }}
data:
  ADVOCACY: {{ .Values.package.advocacy | quote }}
  BERET_HURRY_OPTIMIZATION: {{ .Values.package.beretHurryOptimization | quote }}
  DIARIST_INFARCTION: {{ .Values.package.diaristInfarction | quote }}
  GIDDY: {{ .Values.package.giddy | quote }}
  LUNGE: {{ .Values.package.lunge | quote }}
  MEMORIZE_DEEP_SHOP: {{ .Values.package.memorizeDeepShop | quote }}
  MORBIDITY_RASPY_RHUBARB: {{ .Values.package.morbidityRaspyRhubarb | quote }}
  WEAKNESS: {{ .Values.package.weakness | quote }}
  ZEALOUS: {{ .Values.package.zealous | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "package.fullname" . }}-package
  labels:
  {{- include "package.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: package
spec:
  replicas: {{ .Values.package.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: package
      app.kubernetes.io/name: late
    {{- include "package.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: package
        app.kubernetes.io/name: late
      {{- include "package.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2b14e447e307eaddf004cb128282e6fa8190e71c2f3361058958847b5528aa79
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "package.fullname" . }}-package
        image: {{ .Values.package.package.image.repository }}:{{ .Values.package.package.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.package.package.imagePullPolicy }}
        name: package
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.package.package.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.package.package.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "package.fullname" . }}-package
  labels:
  {{- include "package.labels" . | nindent 4 }}
spec:
  type: {{ .Values.package.type }}
  selector:
    app.kubernetes.io/instance: package
    app.kubernetes.io/name: late
  {{- include "package.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.package.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
package:
  advocacy: modeling
  beretHurryOptimization: spend
  diaristInfarction: cloudy
  giddy: bloody
  lunge: oak
  memorizeDeepShop: accelerant
  morbidityRaspyRhubarb: scorpion
  package:
    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
  type: ClusterIP
  weakness: infant
  zealous: auction
