# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "siege.fullname" . }}-siege
  labels:
  {{- include "siege.labels" . | nindent 4 }}
data:
  ASCENT_STRONG_HORIZON: {{ .Values.siege.ascentStrongHorizon | quote }}
  CUDDLY_INTERFEROMETER: {{ .Values.siege.cuddlyInterferometer | quote }}
  MEND: {{ .Values.siege.mend | quote }}
  PARANOIA_BROTHER-IN-LAW: {{ .Values.siege.paranoiaBrotherInLaw | quote }}
  PINT: {{ .Values.siege.pint | quote }}
  SLASH_ACTIVITY: {{ .Values.siege.slashActivity | quote }}
  SURVEY_QUILT_HANDICAP: {{ .Values.siege.surveyQuiltHandicap | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "siege.fullname" . }}-siege
  labels:
  {{- include "siege.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: siege
spec:
  replicas: {{ .Values.siege.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: siege
      app.kubernetes.io/name: speech
    {{- include "siege.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: siege
        app.kubernetes.io/name: speech
      {{- include "siege.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: cb9e133ebd0c0cd774c899e63fd3a4cd0c54c6eb9a5a7a78ce2bfda5778c0638
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "siege.fullname" . }}-siege
        image: {{ .Values.siege.siege.image.repository }}:{{ .Values.siege.siege.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.siege.siege.imagePullPolicy }}
        name: siege
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.siege.siege.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.siege.siege.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "siege.fullname" . }}-siege
  labels:
  {{- include "siege.labels" . | nindent 4 }}
spec:
  type: {{ .Values.siege.type }}
  selector:
    app.kubernetes.io/instance: siege
    app.kubernetes.io/name: speech
  {{- include "siege.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.siege.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
siege:
  ascentStrongHorizon: demand
  cuddlyInterferometer: debtor
  mend: rid
  paranoiaBrotherInLaw: narrative
  pint: truck
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  siege:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  slashActivity: malicious
  surveyQuiltHandicap: suitcase
  type: ClusterIP
