# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "pigsty.fullname" . }}-pigsty
  labels:
  {{- include "pigsty.labels" . | nindent 4 }}
data:
  ANALYSIS_JELLYFISH: {{ .Values.pigsty.analysisJellyfish | quote }}
  ANNOUNCEMENT_COURTHOUSE: {{ .Values.pigsty.announcementCourthouse | quote }}
  ANYBODY: {{ .Values.pigsty.anybody | quote }}
  BOOTY_TALKING: {{ .Values.pigsty.bootyTalking | quote }}
  DENTIST_GOSSIP: {{ .Values.pigsty.dentistGossip | quote }}
  EQUIVALENT_CYCLONE: {{ .Values.pigsty.equivalentCyclone | quote }}
  FILL: {{ .Values.pigsty.fill | quote }}
  KETTLEDRUM_TRELLIS_POSTBOX: {{ .Values.pigsty.kettledrumTrellisPostbox | quote
    }}
  MATERIALISTIC_ARENA: {{ .Values.pigsty.materialisticArena | quote }}
  MOBSTER_EARDRUM_JEEP: {{ .Values.pigsty.mobsterEardrumJeep | quote }}
  OMISSION: {{ .Values.pigsty.omission | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "pigsty.fullname" . }}-pigsty
  labels:
  {{- include "pigsty.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: pigsty
spec:
  replicas: {{ .Values.pigsty.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: pigsty
      app.kubernetes.io/name: baggy
    {{- include "pigsty.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: pigsty
        app.kubernetes.io/name: baggy
      {{- include "pigsty.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 390236c291ca17b3e7aec873112cc54e34d7cee91efd445c8a598e9bef1ff162
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "pigsty.fullname" . }}-pigsty
        image: {{ .Values.pigsty.pigsty.image.repository }}:{{ .Values.pigsty.pigsty.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.pigsty.pigsty.imagePullPolicy }}
        name: pigsty
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.pigsty.pigsty.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.pigsty.pigsty.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "pigsty.fullname" . }}-pigsty
  labels:
  {{- include "pigsty.labels" . | nindent 4 }}
spec:
  type: {{ .Values.pigsty.type }}
  selector:
    app.kubernetes.io/instance: pigsty
    app.kubernetes.io/name: baggy
  {{- include "pigsty.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.pigsty.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
pigsty:
  analysisJellyfish: administration
  announcementCourthouse: redhead
  anybody: webpage
  bootyTalking: business
  dentistGossip: farmer
  equivalentCyclone: validity
  fill: cloakroom
  kettledrumTrellisPostbox: rehospitalisation
  materialisticArena: warden
  mobsterEardrumJeep: toothpaste
  omission: aggression
  pigsty:
    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
