디렉토리 구조 및 각 서비스 추가
This commit is contained in:
196
helm/argo-cd/templates/dex/deployment.yaml
Executable file
196
helm/argo-cd/templates/dex/deployment.yaml
Executable file
@@ -0,0 +1,196 @@
|
||||
{{- if .Values.dex.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.dex.deploymentAnnotations) }}
|
||||
annotations:
|
||||
{{- range $key, $value := . }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
name: {{ template "argo-cd.dex.fullname" . }}
|
||||
labels:
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
revisionHistoryLimit: {{ .Values.global.revisionHistoryLimit }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.dex.name) | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/cmd-params: {{ include (print $.Template.BasePath "/argocd-configs/argocd-cmd-params-cm.yaml") . | sha256sum }}
|
||||
{{- if .Values.dex.certificateSecret.enabled }}
|
||||
checksum/dex-server-tls: {{ include (print $.Template.BasePath "/argocd-configs/argocd-dex-server-tls-secret.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.dex.podAnnotations) }}
|
||||
{{- range $key, $value := . }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 8 }}
|
||||
{{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.dex.podLabels) }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.dex.imagePullSecrets | default .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.global.hostAliases }}
|
||||
hostAliases:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with.Values.global.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.dex.priorityClassName | default .Values.global.priorityClassName }}
|
||||
priorityClassName: {{ . }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "argo-cd.dexServiceAccountName" . }}
|
||||
containers:
|
||||
- name: {{ .Values.dex.name }}
|
||||
image: {{ .Values.dex.image.repository }}:{{ .Values.dex.image.tag }}
|
||||
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.dex.image.imagePullPolicy }}
|
||||
command:
|
||||
- /shared/argocd-dex
|
||||
args:
|
||||
- rundex
|
||||
{{- with .Values.dex.extraArgs }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
env:
|
||||
{{- with .Values.dex.env }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
- name: ARGOCD_DEX_SERVER_DISABLE_TLS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: argocd-cmd-params-cm
|
||||
key: dexserver.disable.tls
|
||||
optional: true
|
||||
{{- with .Values.dex.envFrom }}
|
||||
envFrom:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.dex.containerPorts.http }}
|
||||
protocol: TCP
|
||||
- name: grpc
|
||||
containerPort: {{ .Values.dex.containerPorts.grpc }}
|
||||
protocol: TCP
|
||||
- name: metrics
|
||||
containerPort: {{ .Values.dex.containerPorts.metrics }}
|
||||
protocol: TCP
|
||||
{{- if .Values.dex.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz/live
|
||||
port: metrics
|
||||
initialDelaySeconds: {{ .Values.dex.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.dex.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.dex.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.dex.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.dex.livenessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.dex.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /healthz/ready
|
||||
port: metrics
|
||||
initialDelaySeconds: {{ .Values.dex.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.dex.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.dex.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.dex.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.dex.readinessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.dex.resources | nindent 10 }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.dex.containerSecurityContext | nindent 10 }}
|
||||
volumeMounts:
|
||||
{{- with .Values.dex.volumeMounts }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
- name: static-files
|
||||
mountPath: /shared
|
||||
- name: dexconfig
|
||||
mountPath: /tmp
|
||||
- name: argocd-dex-server-tls
|
||||
mountPath: /tls
|
||||
{{- with .Values.dex.extraContainers }}
|
||||
{{- tpl (toYaml .) $ | nindent 6 }}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
- name: copyutil
|
||||
image: {{ default .Values.global.image.repository .Values.dex.initImage.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.dex.initImage.tag }}
|
||||
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.dex.initImage.imagePullPolicy }}
|
||||
command:
|
||||
- cp
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /shared/argocd-dex
|
||||
volumeMounts:
|
||||
- mountPath: /shared
|
||||
name: static-files
|
||||
- mountPath: /tmp
|
||||
name: dexconfig
|
||||
resources:
|
||||
{{- toYaml .Values.dex.resources | nindent 10 }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.dex.containerSecurityContext | nindent 10 }}
|
||||
{{- with .Values.dex.initContainers }}
|
||||
{{- tpl (toYaml .) $ | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- with include "argo-cd.affinity" (dict "context" . "component" .Values.dex) }}
|
||||
affinity:
|
||||
{{- trim . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.dex.nodeSelector | default .Values.global.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.dex.tolerations | default .Values.global.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.dex.topologySpreadConstraints | default .Values.global.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{- range $constraint := . }}
|
||||
- {{ toYaml $constraint | nindent 8 | trim }}
|
||||
{{- if not $constraint.labelSelector }}
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" $ "name" $.Values.dex.name) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: static-files
|
||||
emptyDir: {}
|
||||
- name: dexconfig
|
||||
emptyDir: {}
|
||||
- name: argocd-dex-server-tls
|
||||
secret:
|
||||
secretName: argocd-dex-server-tls
|
||||
optional: true
|
||||
items:
|
||||
- key: tls.crt
|
||||
path: tls.crt
|
||||
- key: tls.key
|
||||
path: tls.key
|
||||
- key: ca.crt
|
||||
path: ca.crt
|
||||
{{- with .Values.dex.volumes }}
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- with .Values.dex.dnsConfig }}
|
||||
dnsConfig:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
dnsPolicy: {{ .Values.dex.dnsPolicy }}
|
||||
{{- end }}
|
||||
31
helm/argo-cd/templates/dex/networkpolicy.yaml
Normal file
31
helm/argo-cd/templates/dex/networkpolicy.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
{{- if and .Values.global.networkPolicy.create .Values.dex.enabled }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
|
||||
name: {{ template "argo-cd.dex.fullname" . }}
|
||||
spec:
|
||||
ingress:
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.server.name) | nindent 10 }}
|
||||
ports:
|
||||
- port: http
|
||||
protocol: TCP
|
||||
- port: grpc
|
||||
protocol: TCP
|
||||
{{- if .Values.dex.metrics.enabled }}
|
||||
- from:
|
||||
- namespaceSelector: {}
|
||||
ports:
|
||||
- port: metrics
|
||||
protocol: TCP
|
||||
{{- end }}
|
||||
podSelector:
|
||||
matchLabels:
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.dex.name) | nindent 6 }}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
{{- end }}
|
||||
26
helm/argo-cd/templates/dex/pdb.yaml
Normal file
26
helm/argo-cd/templates/dex/pdb.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
{{- if and .Values.dex.enabled .Values.dex.pdb.enabled }}
|
||||
apiVersion: policy/v1
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ include "argo-cd.dex.fullname" . }}
|
||||
labels:
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
|
||||
{{- with .Values.dex.pdb.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.dex.pdb.annotations }}
|
||||
annotations:
|
||||
{{- range $key, $value := . }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.dex.pdb.maxUnavailable }}
|
||||
maxUnavailable: {{ . }}
|
||||
{{- else }}
|
||||
minAvailable: {{ .Values.dex.pdb.minAvailable | default 0 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.dex.name) | nindent 6 }}
|
||||
{{- end }}
|
||||
18
helm/argo-cd/templates/dex/role.yaml
Normal file
18
helm/argo-cd/templates/dex/role.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- if .Values.dex.enabled }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: {{ template "argo-cd.dex.fullname" . }}
|
||||
labels:
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
- configmaps
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
{{- end }}
|
||||
16
helm/argo-cd/templates/dex/rolebinding.yaml
Normal file
16
helm/argo-cd/templates/dex/rolebinding.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
{{- if .Values.dex.enabled }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: {{ template "argo-cd.dex.fullname" . }}
|
||||
labels:
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: {{ template "argo-cd.dex.fullname" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "argo-cd.dexServiceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
35
helm/argo-cd/templates/dex/service.yaml
Normal file
35
helm/argo-cd/templates/dex/service.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
{{- if .Values.dex.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "argo-cd.dex.fullname" . }}
|
||||
{{- if .Values.dex.metrics.service.annotations }}
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.dex.metrics.service.annotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
|
||||
{{- if .Values.dex.metrics.service.labels }}
|
||||
{{- toYaml .Values.dex.metrics.service.labels | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
ports:
|
||||
- name: {{ .Values.dex.servicePortHttpName }}
|
||||
protocol: TCP
|
||||
port: {{ .Values.dex.servicePortHttp }}
|
||||
targetPort: http
|
||||
- name: {{ .Values.dex.servicePortGrpcName }}
|
||||
protocol: TCP
|
||||
port: {{ .Values.dex.servicePortGrpc }}
|
||||
targetPort: grpc
|
||||
{{- if .Values.dex.metrics.enabled }}
|
||||
- name: {{ .Values.dex.metrics.service.portName }}
|
||||
protocol: TCP
|
||||
port: {{ .Values.dex.servicePortMetrics }}
|
||||
targetPort: metrics
|
||||
{{- end }}
|
||||
selector:
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.dex.name) | nindent 4 }}
|
||||
{{- end }}
|
||||
15
helm/argo-cd/templates/dex/serviceaccount.yaml
Normal file
15
helm/argo-cd/templates/dex/serviceaccount.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- if and .Values.dex.enabled .Values.dex.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
automountServiceAccountToken: {{ .Values.dex.serviceAccount.automountServiceAccountToken }}
|
||||
metadata:
|
||||
name: {{ template "argo-cd.dexServiceAccountName" . }}
|
||||
{{- if .Values.dex.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.dex.serviceAccount.annotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
|
||||
{{- end }}
|
||||
49
helm/argo-cd/templates/dex/servicemonitor.yaml
Normal file
49
helm/argo-cd/templates/dex/servicemonitor.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
{{- if and .Values.dex.metrics.enabled .Values.dex.metrics.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ template "argo-cd.dex.fullname" . }}
|
||||
{{- with .Values.dex.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ . }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
|
||||
{{- with .Values.dex.metrics.serviceMonitor.selector }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.dex.metrics.serviceMonitor.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.dex.metrics.serviceMonitor.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
endpoints:
|
||||
- port: {{ .Values.dex.metrics.service.portName }}
|
||||
{{- with .Values.dex.metrics.serviceMonitor.interval }}
|
||||
interval: {{ . }}
|
||||
{{- end }}
|
||||
path: /metrics
|
||||
{{- with .Values.dex.metrics.serviceMonitor.relabelings }}
|
||||
relabelings:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.dex.metrics.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings:
|
||||
{{- toYaml . |nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.dex.metrics.serviceMonitor.scheme }}
|
||||
scheme: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.dex.metrics.serviceMonitor.tlsConfig }}
|
||||
tlsConfig:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 6 }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user