# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "ratty.fullname" . }}-ratty
  labels:
  {{- include "ratty.labels" . | nindent 4 }}
data:
  COMBINE: {{ .Values.ratty.combine | quote }}
  CONCEPTION: {{ .Values.ratty.conception | quote }}
  DEVELOPER_AUTUMN: {{ .Values.ratty.developerAutumn | quote }}
  EVAPORATION_COMPLICITY: {{ .Values.ratty.evaporationComplicity | quote }}
  FILLY_TRANSPARENCY: {{ .Values.ratty.fillyTransparency | quote }}
  INSURGENCE_TECHNIQUE: {{ .Values.ratty.insurgenceTechnique | quote }}
  ORATOR: {{ .Values.ratty.orator | quote }}
  PAVEMENT_INCENSE: {{ .Values.ratty.pavementIncense | quote }}
  REDUCTION_ANTICIPATE: {{ .Values.ratty.reductionAnticipate | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "ratty.fullname" . }}-ratty
  labels:
  {{- include "ratty.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: ratty
spec:
  replicas: {{ .Values.ratty.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: ratty
      app.kubernetes.io/name: advocacy
    {{- include "ratty.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: ratty
        app.kubernetes.io/name: advocacy
      {{- include "ratty.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e63048ca5504db74366b6039da5f0e2291116571c4ad74078e51b59802f47fc0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "ratty.fullname" . }}-ratty
        image: {{ .Values.ratty.ratty.image.repository }}:{{ .Values.ratty.ratty.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.ratty.ratty.imagePullPolicy }}
        name: ratty
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.ratty.ratty.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.ratty.ratty.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "ratty.fullname" . }}-ratty
  labels:
  {{- include "ratty.labels" . | nindent 4 }}
spec:
  type: {{ .Values.ratty.type }}
  selector:
    app.kubernetes.io/instance: ratty
    app.kubernetes.io/name: advocacy
  {{- include "ratty.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.ratty.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
ratty:
  combine: chap
  conception: liver
  developerAutumn: someone
  evaporationComplicity: stripe
  fillyTransparency: jerk
  insurgenceTechnique: fritter
  orator: ashtray
  pavementIncense: drive
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  ratty:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  reductionAnticipate: needless
  replicas: 1
  type: ClusterIP
