added repo
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
{{/*
|
||||
nginx auth secret name
|
||||
*/}}
|
||||
{{- define "mimir.nginxAuthSecret" -}}
|
||||
{{ .Values.nginx.basicAuth.existingSecret | default (include "mimir.resourceName" (dict "ctx" . "component" "nginx") ) }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Returns the HorizontalPodAutoscaler API version for this version of kubernetes.
|
||||
*/}}
|
||||
{{- define "mimir.hpa.version" -}}
|
||||
{{- if semverCompare ">= 1.23-0" (include "mimir.kubeVersion" .) -}}
|
||||
autoscaling/v2
|
||||
{{- else -}}
|
||||
autoscaling/v2beta1
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,48 @@
|
||||
{{- if not .Values.enterprise.enabled -}}
|
||||
{{- if .Values.nginx.enabled -}}
|
||||
{{- if .Values.nginx.ingress.enabled -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
|
||||
labels:
|
||||
{{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }}
|
||||
{{- with .Values.nginx.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
spec:
|
||||
{{- if .Values.nginx.ingress.ingressClassName }}
|
||||
ingressClassName: {{ .Values.nginx.ingress.ingressClassName }}
|
||||
{{- end -}}
|
||||
{{- if .Values.nginx.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.nginx.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .secretName }}
|
||||
secretName: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.nginx.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
pathType: {{ .pathType }}
|
||||
backend:
|
||||
service:
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "nginx") }}
|
||||
port:
|
||||
number: {{ $.Values.nginx.service.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,14 @@
|
||||
{{- if not .Values.enterprise.enabled -}}
|
||||
{{- if .Values.nginx.enabled }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
|
||||
labels:
|
||||
{{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
data:
|
||||
nginx.conf: |
|
||||
{{- tpl .Values.nginx.nginxConfig.file . | nindent 4 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,142 @@
|
||||
{{- if not .Values.enterprise.enabled -}}
|
||||
{{- if .Values.nginx.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
|
||||
labels:
|
||||
{{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }}
|
||||
annotations:
|
||||
{{- toYaml .Values.nginx.annotations | nindent 4 }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
spec:
|
||||
{{- if not .Values.nginx.autoscaling.enabled }}
|
||||
replicas: {{ .Values.nginx.replicas }}
|
||||
{{- end }}
|
||||
{{- with .Values.nginx.deploymentStrategy }}
|
||||
strategy:
|
||||
{{ toYaml . | trim | indent 4 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "mimir.selectorLabels" (dict "ctx" . "component" "nginx") | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/config: {{ include (print .Template.BasePath "/nginx/nginx-configmap.yaml") . | sha256sum }}
|
||||
{{- with .Values.global.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nginx.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "mimir.podLabels" (dict "ctx" . "component" "nginx") | nindent 8 }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
spec:
|
||||
serviceAccountName: {{ include "mimir.serviceAccountName" . }}
|
||||
{{- if .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.nginx.priorityClassName }}
|
||||
priorityClassName: {{ .Values.nginx.priorityClassName }}
|
||||
{{- end }}
|
||||
securityContext:
|
||||
{{- include "mimir.lib.podSecurityContext" (dict "ctx" . "component" "nginx") | nindent 8 }}
|
||||
terminationGracePeriodSeconds: {{ .Values.nginx.terminationGracePeriodSeconds }}
|
||||
containers:
|
||||
- name: nginx
|
||||
image: {{ .Values.nginx.image.registry }}/{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag }}
|
||||
imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
|
||||
{{- with .Values.nginx.extraArgs }}
|
||||
args:
|
||||
{{- range $key, $value := . }}
|
||||
- "-{{ $key }} {{ $value }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-metric
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
{{- if or .Values.global.extraEnv .Values.nginx.extraEnv }}
|
||||
env:
|
||||
{{- with .Values.global.extraEnv }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nginx.extraEnv }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if or .Values.global.extraEnvFrom .Values.nginx.extraEnvFrom }}
|
||||
envFrom:
|
||||
{{- with .Values.global.extraEnvFrom }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nginx.extraEnvFrom }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
readinessProbe:
|
||||
{{- toYaml .Values.nginx.readinessProbe | nindent 12 }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.nginx.containerSecurityContext | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /etc/nginx/nginx.conf
|
||||
subPath: nginx.conf
|
||||
{{- if .Values.nginx.basicAuth.enabled }}
|
||||
- name: auth
|
||||
mountPath: /etc/nginx/secrets
|
||||
{{- end }}
|
||||
- name: tmp
|
||||
mountPath: /tmp
|
||||
- name: docker-entrypoint-d-override
|
||||
mountPath: /docker-entrypoint.d
|
||||
{{- if .Values.nginx.extraVolumeMounts }}
|
||||
{{- toYaml .Values.nginx.extraVolumeMounts | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.extraVolumeMounts }}
|
||||
{{- toYaml .Values.global.extraVolumeMounts | nindent 12 }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.nginx.resources | nindent 12 }}
|
||||
{{- if .Values.nginx.extraContainers }}
|
||||
{{- toYaml .Values.nginx.extraContainers | nindent 8}}
|
||||
{{- end }}
|
||||
{{- with .Values.nginx.affinity }}
|
||||
affinity:
|
||||
{{- tpl . $ | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- include "mimir.lib.topologySpreadConstraints" (dict "ctx" . "component" "nginx") | nindent 6 }}
|
||||
{{- with .Values.nginx.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nginx.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ include "mimir.fullname" . }}-nginx
|
||||
{{- if .Values.nginx.basicAuth.enabled }}
|
||||
- name: auth
|
||||
secret:
|
||||
secretName: {{ include "mimir.nginxAuthSecret" . }}
|
||||
{{- end }}
|
||||
- name: tmp
|
||||
emptyDir: {}
|
||||
- name: docker-entrypoint-d-override
|
||||
emptyDir: {}
|
||||
{{- if .Values.nginx.extraVolumes }}
|
||||
{{- toYaml .Values.nginx.extraVolumes | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.extraVolumes }}
|
||||
{{- toYaml .Values.global.extraVolumes | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,3 @@
|
||||
{{- if and .Values.nginx.enabled (not .Values.enterprise.enabled) -}}
|
||||
{{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "nginx") }}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,14 @@
|
||||
{{- if not .Values.enterprise.enabled -}}
|
||||
{{- if and .Values.nginx.enabled .Values.nginx.basicAuth.enabled (not .Values.nginx.basicAuth.existingSecret) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
|
||||
labels:
|
||||
{{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
stringData:
|
||||
.htpasswd: |
|
||||
{{- tpl .Values.nginx.basicAuth.htpasswd $ | nindent 4 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,34 @@
|
||||
{{- if not .Values.enterprise.enabled -}}
|
||||
{{- if .Values.nginx.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
|
||||
labels:
|
||||
{{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }}
|
||||
{{- with .Values.nginx.service.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- toYaml .Values.nginx.service.annotations | nindent 4 }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
spec:
|
||||
type: {{ .Values.nginx.service.type }}
|
||||
{{- with .Values.nginx.service.clusterIP }}
|
||||
clusterIP: {{ . }}
|
||||
{{- end }}
|
||||
{{- if and (eq "LoadBalancer" .Values.nginx.service.type) .Values.nginx.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.nginx.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-metric
|
||||
port: {{ .Values.nginx.service.port }}
|
||||
targetPort: http-metric
|
||||
{{- if and (eq "NodePort" .Values.nginx.service.type) .Values.nginx.service.nodePort }}
|
||||
nodePort: {{ .Values.nginx.service.nodePort }}
|
||||
{{- end }}
|
||||
protocol: TCP
|
||||
selector:
|
||||
{{- include "mimir.selectorLabels" (dict "ctx" . "component" "nginx") | nindent 4 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,37 @@
|
||||
{{- if not .Values.enterprise.enabled -}}
|
||||
{{- if .Values.nginx.autoscaling.enabled }}
|
||||
{{- if eq (include "mimir.hpa.version" .) "autoscaling/v2" }}
|
||||
apiVersion: autoscaling/v2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
|
||||
labels:
|
||||
{{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
|
||||
minReplicas: {{ .Values.nginx.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.nginx.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- with .Values.nginx.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.nginx.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,33 @@
|
||||
{{- if not .Values.enterprise.enabled -}}
|
||||
{{- if .Values.nginx.autoscaling.enabled }}
|
||||
{{- if eq (include "mimir.hpa.version" .) "autoscaling/v2beta1" }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
|
||||
labels:
|
||||
{{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
|
||||
minReplicas: {{ .Values.nginx.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.nginx.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- with .Values.nginx.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.nginx.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,25 @@
|
||||
{{- if .Values.nginx.route.enabled }}
|
||||
kind: Route
|
||||
apiVersion: route.openshift.io/v1
|
||||
metadata:
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
|
||||
labels:
|
||||
{{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }}
|
||||
{{- with .Values.nginx.route.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
spec:
|
||||
host: {{ .Values.nginx.route.host }}
|
||||
to:
|
||||
kind: Service
|
||||
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }}
|
||||
weight: 100
|
||||
port:
|
||||
targetPort: http-metric
|
||||
{{- if .Values.nginx.route.tls }}
|
||||
tls:
|
||||
{{- toYaml .Values.nginx.route.tls | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user