# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "rag.fullname" . }}-rag
  labels:
  {{- include "rag.labels" . | nindent 4 }}
data:
  ARMOR_BREATH: {{ .Values.rag.armorBreath | quote }}
  CALL_TYPEWRITER_MRNA: {{ .Values.rag.callTypewriterMrna | quote }}
  GELDING_MITER_DEER: {{ .Values.rag.geldingMiterDeer | quote }}
  WITTY_SIGNIFICANCE: {{ .Values.rag.wittySignificance | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "rag.fullname" . }}-rag
  labels:
  {{- include "rag.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: rag
spec:
  replicas: {{ .Values.rag.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: rag
      app.kubernetes.io/name: filly
    {{- include "rag.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: rag
        app.kubernetes.io/name: filly
      {{- include "rag.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 316c0f3a03dd1e97396b8769c0e0d5e8382ce65f5e7b65540c62f295db36fce0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "rag.fullname" . }}-rag
        image: {{ .Values.rag.rag.image.repository }}:{{ .Values.rag.rag.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.rag.rag.imagePullPolicy }}
        name: rag
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.rag.rag.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.rag.rag.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "rag.fullname" . }}-rag
  labels:
  {{- include "rag.labels" . | nindent 4 }}
spec:
  type: {{ .Values.rag.type }}
  selector:
    app.kubernetes.io/instance: rag
    app.kubernetes.io/name: filly
  {{- include "rag.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.rag.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
rag:
  armorBreath: doughnut
  callTypewriterMrna: chestnut
  geldingMiterDeer: privilege
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rag:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  type: ClusterIP
  wittySignificance: socialism
