# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "lottery.fullname" . }}-lottery
  labels:
  {{- include "lottery.labels" . | nindent 4 }}
data:
  ANARCHIST_NOUGAT: {{ .Values.lottery.anarchistNougat | quote }}
  CAVE_ECUMENIST_BREAK: {{ .Values.lottery.caveEcumenistBreak | quote }}
  GRAVITY_E-BOOK: {{ .Values.lottery.gravityEBook | quote }}
  HABITAT_ASK_WITHDRAW: {{ .Values.lottery.habitatAskWithdraw | quote }}
  JERK: {{ .Values.lottery.jerk | quote }}
  NASTY_BARREL_OVERT: {{ .Values.lottery.nastyBarrelOvert | quote }}
  PROTOCOL_DECORATION_SUBCONSCIOUS: {{ .Values.lottery.protocolDecorationSubconscious
    | quote }}
  PSEUDOCODE_ASSESSMENT: {{ .Values.lottery.pseudocodeAssessment | quote }}
  RESERVATION: {{ .Values.lottery.reservation | quote }}
  SPAWN: {{ .Values.lottery.spawn | quote }}
  TOURNAMENT: {{ .Values.lottery.tournament | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "lottery.fullname" . }}-lottery
  labels:
  {{- include "lottery.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: lottery
spec:
  replicas: {{ .Values.lottery.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: lottery
      app.kubernetes.io/name: argument
    {{- include "lottery.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: lottery
        app.kubernetes.io/name: argument
      {{- include "lottery.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0fd0bbbac8339485572406e45cafb17f863c31b1cbf802a93bc7d6dbb4210568
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "lottery.fullname" . }}-lottery
        image: {{ .Values.lottery.lottery.image.repository }}:{{ .Values.lottery.lottery.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.lottery.lottery.imagePullPolicy }}
        name: lottery
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.lottery.lottery.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.lottery.lottery.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "lottery.fullname" . }}-lottery
  labels:
  {{- include "lottery.labels" . | nindent 4 }}
spec:
  type: {{ .Values.lottery.type }}
  selector:
    app.kubernetes.io/instance: lottery
    app.kubernetes.io/name: argument
  {{- include "lottery.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.lottery.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
lottery:
  anarchistNougat: crucifixion
  caveEcumenistBreak: eyelash
  gravityEBook: sock
  habitatAskWithdraw: holiday
  jerk: big
  lottery:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  nastyBarrelOvert: tour
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  protocolDecorationSubconscious: cartridge
  pseudocodeAssessment: trashy
  replicas: 1
  reservation: flee
  spawn: counterterrorism
  tournament: quiet
  type: ClusterIP
