# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "ghost.fullname" . }}-ghost
  labels:
  {{- include "ghost.labels" . | nindent 4 }}
data:
  ACTIVIST: {{ .Values.ghost.activist | quote }}
  BERRY_TENSE_JUMPY: {{ .Values.ghost.berryTenseJumpy | quote }}
  BIDET_SIGHTSEEING: {{ .Values.ghost.bidetSightseeing | quote }}
  LOVER: {{ .Values.ghost.lover | quote }}
  MUSSEL: {{ .Values.ghost.mussel | quote }}
  PAVILION_ANTIQUE: {{ .Values.ghost.pavilionAntique | quote }}
  TOOL: {{ .Values.ghost.tool | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "ghost.fullname" . }}-ghost
  labels:
  {{- include "ghost.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: ghost
spec:
  replicas: {{ .Values.ghost.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: ghost
      app.kubernetes.io/name: sweets
    {{- include "ghost.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: ghost
        app.kubernetes.io/name: sweets
      {{- include "ghost.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d7396729cbdf161bcd81a3550da616b62adeb948702bcf32a379746e7de5dbd2
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "ghost.fullname" . }}-ghost
        image: {{ .Values.ghost.ghost.image.repository }}:{{ .Values.ghost.ghost.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.ghost.ghost.imagePullPolicy }}
        name: ghost
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.ghost.ghost.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.ghost.ghost.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "ghost.fullname" . }}-ghost
  labels:
  {{- include "ghost.labels" . | nindent 4 }}
spec:
  type: {{ .Values.ghost.type }}
  selector:
    app.kubernetes.io/instance: ghost
    app.kubernetes.io/name: sweets
  {{- include "ghost.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.ghost.ports | toYaml | nindent 2 -}}
ghost:
  activist: theme
  berryTenseJumpy: pail
  bidetSightseeing: impediment
  ghost:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  lover: mansard
  mussel: blazer
  pavilionAntique: petticoat
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  tool: conifer
  type: ClusterIP
kubernetesClusterDomain: cluster.local
