# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "luxury.fullname" . }}-luxury
  labels:
  {{- include "luxury.labels" . | nindent 4 }}
data:
  DEEP_JADED: {{ .Values.luxury.deepJaded | quote }}
  FOB_PENTAGON: {{ .Values.luxury.fobPentagon | quote }}
  PRUNER_ENVIOUS: {{ .Values.luxury.prunerEnvious | quote }}
  REPLY: {{ .Values.luxury.reply | quote }}
  SAFFRON: {{ .Values.luxury.saffron | quote }}
  SLEEPINESS: {{ .Values.luxury.sleepiness | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "luxury.fullname" . }}-luxury
  labels:
  {{- include "luxury.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: luxury
spec:
  replicas: {{ .Values.luxury.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: luxury
      app.kubernetes.io/name: inglenook
    {{- include "luxury.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: luxury
        app.kubernetes.io/name: inglenook
      {{- include "luxury.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: c43ce110369613698868cf64859a768a8f24706221b5c777319f1b2f2e251611
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "luxury.fullname" . }}-luxury
        image: {{ .Values.luxury.luxury.image.repository }}:{{ .Values.luxury.luxury.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.luxury.luxury.imagePullPolicy }}
        name: luxury
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.luxury.luxury.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.luxury.luxury.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "luxury.fullname" . }}-luxury
  labels:
  {{- include "luxury.labels" . | nindent 4 }}
spec:
  type: {{ .Values.luxury.type }}
  selector:
    app.kubernetes.io/instance: luxury
    app.kubernetes.io/name: inglenook
  {{- include "luxury.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.luxury.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
luxury:
  deepJaded: grieving
  fobPentagon: lever
  luxury:
    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
  prunerEnvious: deeply
  replicas: 1
  reply: twitter
  saffron: future
  sleepiness: cappuccino
  type: ClusterIP
