Files
sova-deploy/apps/docs/templates/all.yaml
T
Valeriy Petrov b0e527e970 Enable ingress basic auth for remote test contour.
Protect all public URLs via nginx basic auth; exempt Gitea API/registry/git paths for CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 03:25:26 +03:00

83 lines
2.2 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: docs
namespace: {{ .Values.namespace }}
labels:
app: docs
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: docs
template:
metadata:
labels:
app: docs
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: docs
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 8080
name: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
---
apiVersion: v1
kind: Service
metadata:
name: docs
namespace: {{ .Values.namespace }}
spec:
selector:
app: docs
ports:
- port: 80
targetPort: 8080
---
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: docs
namespace: {{ .Values.namespace }}
{{- if or .Values.ingress.tls.enabled .Values.ingress.basicAuth.enabled }}
annotations:
{{- if .Values.ingress.tls.enabled }}
cert-manager.io/cluster-issuer: {{ .Values.ingress.tls.clusterIssuer | quote }}
nginx.ingress.kubernetes.io/ssl-redirect: "true"
{{- end }}
{{- if .Values.ingress.basicAuth.enabled }}
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: {{ .Values.ingress.basicAuth.secretName | quote }}
nginx.ingress.kubernetes.io/auth-realm: {{ .Values.ingress.basicAuth.realm | quote }}
nginx.ingress.kubernetes.io/auth-skip-locations: {{ .Values.ingress.basicAuth.skipLocations | quote }}
{{- end }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.className }}
{{- if .Values.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.ingress.host }}
secretName: {{ .Values.ingress.tls.secretName }}
{{- end }}
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: docs
port:
number: 80
{{- end }}