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