{{- if .Values.adminrpc.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "gitdata.fullname" . }}-adminrpc namespace: {{ include "gitdata.namespace" . }} labels: app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-adminrpc app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} spec: replicas: 1 selector: matchLabels: app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-adminrpc app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: labels: app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-adminrpc app.kubernetes.io/instance: {{ .Release.Name }} spec: {{- if $.Values.image.pullSecrets }} imagePullSecrets: {{- range $.Values.image.pullSecrets }} - name: {{ . }} {{- end }} {{- end }} terminationGracePeriodSeconds: 10 containers: - name: adminrpc image: "{{ .Values.image.registry }}/{{ .Values.adminrpc.image.repository }}:{{ .Values.adminrpc.image.tag }}" imagePullPolicy: {{ .Values.adminrpc.image.pullPolicy | default .Values.image.pullPolicy }} ports: - name: grpc containerPort: {{ .Values.adminrpc.service.port }} protocol: TCP - name: http containerPort: {{ .Values.adminrpc.service.http_port }} protocol: TCP args: - --bind - "0.0.0.0:{{ .Values.adminrpc.service.port }}" envFrom: - configMapRef: name: {{ include "gitdata.fullname" . }}-config livenessProbe: tcpSocket: port: {{ .Values.adminrpc.service.http_port }} initialDelaySeconds: 5 periodSeconds: 10 readinessProbe: tcpSocket: port: {{ .Values.adminrpc.service.http_port }} initialDelaySeconds: 5 periodSeconds: 5 {{- if .Values.adminrpc.resources }} resources: {{- toYaml .Values.adminrpc.resources | nindent 12 }} {{- end }} {{- with .Values.adminrpc.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.adminrpc.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.adminrpc.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} --- apiVersion: v1 kind: Service metadata: name: {{ include "gitdata.fullname" . }}-adminrpc namespace: {{ include "gitdata.namespace" . }} labels: app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-adminrpc app.kubernetes.io/instance: {{ .Release.Name }} spec: type: ClusterIP ports: - port: {{ .Values.adminrpc.service.port }} targetPort: grpc protocol: TCP name: grpc - port: {{ .Values.adminrpc.service.http_port }} targetPort: http protocol: TCP name: http selector: app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-adminrpc app.kubernetes.io/instance: {{ .Release.Name }} {{- if .Values.adminrpc.autoscaling.enabled }} --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "gitdata.fullname" . }}-adminrpc namespace: {{ include "gitdata.namespace" . }} labels: app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-adminrpc app.kubernetes.io/instance: {{ .Release.Name }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: {{ include "gitdata.fullname" . }}-adminrpc minReplicas: {{ .Values.adminrpc.autoscaling.minReplicas }} maxReplicas: {{ .Values.adminrpc.autoscaling.maxReplicas }} metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: {{ .Values.adminrpc.autoscaling.targetCPUUtilizationPercentage }} - type: Resource resource: name: memory target: type: Utilization averageUtilization: {{ .Values.adminrpc.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }}