apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "cluster-proxy.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "cluster-proxy.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      {{- include "cluster-proxy.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      {{- with .Values.podAnnotations }}
      annotations:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      labels:
        {{- include "cluster-proxy.selectorLabels" . | nindent 8 }}
    spec:
      serviceAccountName: {{ include "cluster-proxy.serviceAccountName" . }}
      containers:
        - name: {{ .Chart.Name }}
          ports:
          - http: 80
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          resources:
            {{- toYaml .Values.resources | nindent 12 }}
          command:
          - /proxy
          - --dev
          - --port
          - {{ .Values.service.port | quote }}
          - --gotty-image
          - "{{ .Values.gotty.repository }}:{{ .Values.gotty.tag }}"
          - --gotty-cmd
          - /gotty -w --max-connection 1 --timeout 60 --reconnect /usql --password
          
