add part two
This commit is contained in:
183
2.ArgoCD/templates/applicationset/deployment.yaml
Normal file
183
2.ArgoCD/templates/applicationset/deployment.yaml
Normal file
@@ -0,0 +1,183 @@
|
||||
{{- if .Values.applicationSet.enabled }}
|
||||
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "argocd.applicationSet" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: applicationSet
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: {{ .Values.applicationSet.replicaCount }}
|
||||
{{- if .Values.applicationSet.updateStrategy }}
|
||||
strategy: {{- toYaml .Values.applicationSet.updateStrategy | nindent 4 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: applicationSet
|
||||
template:
|
||||
metadata:
|
||||
{{- if .Values.applicationSet.podAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||
app.kubernetes.io/component: applicationSet
|
||||
{{- if .Values.applicationSet.podLabels }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.podLabels "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
serviceAccountName: {{ include "argocd.applicationSet.serviceAccountName" . }}
|
||||
{{- include "argocd.imagePullSecrets" . | nindent 6 }}
|
||||
{{- if .Values.applicationSet.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.applicationSet.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.applicationSet.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.applicationSet.podAffinityPreset "component" "applicationSet" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.applicationSet.podAntiAffinityPreset "component" "applicationSet" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.applicationSet.nodeAffinityPreset.type "key" .Values.applicationSet.nodeAffinityPreset.key "values" .Values.applicationSet.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.tolerations "context" .) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.priorityClassName }}
|
||||
priorityClassName: {{ .Values.applicationSet.priorityClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.podSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.applicationSet.podSecurityContext "enabled" | toYaml | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: applicationset-controller
|
||||
image: {{ include "argocd.image" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
{{- if .Values.applicationSet.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.command "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.args }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.args "context" $) | nindent 12 }}
|
||||
{{- else }}
|
||||
args:
|
||||
- argocd-applicationset-controller
|
||||
- --logformat
|
||||
- {{ .Values.applicationSet.logFormat | quote }}
|
||||
- --loglevel
|
||||
- {{ .Values.applicationSet.logLevel | quote }}
|
||||
- --metrics-addr
|
||||
- ":{{ .Values.applicationSet.containerPorts.metrics }}"
|
||||
- --probe-addr
|
||||
- ":{{ .Values.applicationSet.containerPorts.probe }}"
|
||||
{{- if or (gt ( .Values.applicationSet.replicaCount | int64) 1) .Values.applicationSet.defaultArgs.enableLeaderElection }}
|
||||
- --enable-leader-election=true
|
||||
{{- end }}
|
||||
- --argocd-repo-server
|
||||
- {{ include "argocd.repo-server" . }}:{{ .Values.repoServer.service.port }}
|
||||
- --policy
|
||||
- {{ .Values.applicationSet.defaultArgs.policy | quote }}
|
||||
- --debug
|
||||
- {{ .Values.applicationSet.defaultArgs.debug | quote }}
|
||||
- --dry-run
|
||||
- {{ .Values.applicationSet.defaultArgs.dryRun | quote }}
|
||||
{{- if .Values.applicationSet.extraArgs }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.extraArgs "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
env:
|
||||
{{- if .Values.applicationSet.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
envFrom:
|
||||
{{- if .Values.applicationSet.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" .Values.applicationSet.extraEnvVarsCM "context" $) }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" .Values.applicationSet.extraEnvVarsSecret "context" $) }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: {{ .Values.applicationSet.containerPorts.metrics }}
|
||||
protocol: TCP
|
||||
- name: probe
|
||||
containerPort: {{ .Values.applicationSet.containerPorts.probe }}
|
||||
protocol: TCP
|
||||
- name: webhook
|
||||
containerPort: 7000
|
||||
protocol: TCP
|
||||
{{- if .Values.applicationSet.customLivenessProbe }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- else if .Values.applicationSet.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: probe
|
||||
initialDelaySeconds: {{ .Values.applicationSet.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.applicationSet.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.applicationSet.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.applicationSet.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.applicationSet.livenessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.customReadinessProbe }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.customReadinessProbe "context" $) | nindent 12 }}
|
||||
{{- else if .Values.applicationSet.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: probe
|
||||
initialDelaySeconds: {{ .Values.applicationSet.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.applicationSet.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.applicationSet.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.applicationSet.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.applicationSet.readinessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.resources }}
|
||||
resources: {{- toYaml .Values.applicationSet.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.containerSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.applicationSet.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- mountPath: /app/config/ssh
|
||||
name: ssh-known-hosts
|
||||
{{- if .Values.config.tlsCerts }}
|
||||
- mountPath: /app/config/tls
|
||||
name: tls-certs
|
||||
{{- end }}
|
||||
{{- if .Values.config.gpgKeys }}
|
||||
- mountPath: /app/config/gpg/source
|
||||
name: gpg-keys
|
||||
{{- end }}
|
||||
- mountPath: /app/config/gpg/keys
|
||||
name: gpg-keyring
|
||||
- mountPath: /tmp
|
||||
name: tmp
|
||||
{{- if .Values.applicationSet.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.extraVolumeMounts "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: ssh-known-hosts
|
||||
configMap:
|
||||
name: argocd-ssh-known-hosts-cm
|
||||
{{- if .Values.config.tlsCerts }}
|
||||
- name: tls-certs
|
||||
configMap:
|
||||
name: argocd-tls-certs-cm
|
||||
{{- end }}
|
||||
{{- if .Values.config.gpgKeys }}
|
||||
- name: gpg-keys
|
||||
configMap:
|
||||
name: argocd-gpg-keys-cm
|
||||
{{- end }}
|
||||
- name: gpg-keyring
|
||||
emptyDir: {}
|
||||
- name: tmp
|
||||
emptyDir: {}
|
||||
{{- if .Values.applicationSet.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.extraVolumes "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
64
2.ArgoCD/templates/applicationset/ingress-webhook.yaml
Normal file
64
2.ArgoCD/templates/applicationset/ingress-webhook.yaml
Normal file
@@ -0,0 +1,64 @@
|
||||
{{- if and .Values.applicationSet.enabled .Values.applicationSet.webhook.ingress.enabled -}}
|
||||
apiVersion: {{ include "common.capabilities.webhook.ingress.apiVersion" . }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "argocd.applicationSet" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: applicationSet
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.webhook.ingress.labels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.applicationSet.webhook.ingress.labels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.applicationSet.webhook.ingress.annotations .Values.commonAnnotations .Values.applicationSet.webhook.ingress.certManager }}
|
||||
annotations:
|
||||
{{- if .Values.applicationSet.webhook.ingress.certManager }}
|
||||
kubernetes.io/tls-acme: "true"
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.webhook.ingress.annotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.applicationSet.webhook.ingress.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if and .Values.applicationSet.webhook.ingress.ingressClassName (eq "true" (include "common.webhook.ingress.supportsIngressClassname" .)) }}
|
||||
ingressClassName: {{ .Values.applicationSet.webhook.ingress.ingressClassName | quote }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- if .Values.applicationSet.webhook.ingress.hostname }}
|
||||
- host: {{ .Values.applicationSet.webhook.ingress.hostname }}
|
||||
http:
|
||||
paths:
|
||||
{{- if .Values.applicationSet.webhook.ingress.extraPaths }}
|
||||
{{- toYaml .Values.applicationSet.webhook.ingress.extraPaths | nindent 10 }}
|
||||
{{- end }}
|
||||
- path: {{ .Values.applicationSet.webhook.ingress.path }}
|
||||
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
|
||||
pathType: {{ .Values.applicationSet.webhook.ingress.pathType }}
|
||||
{{- end }}
|
||||
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "argocd.server" .) "servicePort" (ternary "https" "http" .Values.applicationSet.webhook.ingress.tls) "context" $) | nindent 14 }}
|
||||
{{- end }}
|
||||
{{- range .Values.applicationSet.webhook.ingress.extraHosts }}
|
||||
- host: {{ .name | quote }}
|
||||
http:
|
||||
paths:
|
||||
- path: {{ default "/" .path }}
|
||||
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
|
||||
pathType: {{ default "ImplementationSpecific" .pathType }}
|
||||
{{- end }}
|
||||
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "argocd.server" $) "servicePort" (ternary "https" "http" $.Values.applicationSet.webhook.ingress.tls) "context" $) | nindent 14 }}
|
||||
{{- end }}
|
||||
tls:
|
||||
{{- if .Values.applicationSet.webhook.ingress.tls }}
|
||||
- hosts:
|
||||
- {{ .Values.applicationSet.webhook.ingress.hostname }}
|
||||
secretName: {{ printf "%s-tls" .Values.applicationSet.webhook.ingress.hostname }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.webhook.ingress.extraTls }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.applicationSet.webhook.ingress.extraTls "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
53
2.ArgoCD/templates/applicationset/metrics-svc.yaml
Normal file
53
2.ArgoCD/templates/applicationset/metrics-svc.yaml
Normal file
@@ -0,0 +1,53 @@
|
||||
{{- if and .Values.applicationSet.enabled .Values.applicationSet.metrics.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "argocd.applicationSet" . }}-metrics
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
app.kubernetes.io/part-of: applicationSet
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.applicationSet.metrics.service.annotations }}
|
||||
annotations:
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.service.annotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.applicationSet.metrics.service.annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.applicationSet.metrics.service.type }}
|
||||
{{- if and .Values.applicationSet.metrics.service.clusterIP (eq .Values.applicationSet.metrics.service.type "ClusterIP") }}
|
||||
clusterIP: {{ .Values.applicationSet.metrics.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if (or (eq .Values.applicationSet.metrics.service.type "LoadBalancer") (eq .Values.applicationSet.metrics.service.type "NodePort")) }}
|
||||
externalTrafficPolicy: {{ .Values.applicationSet.metrics.service.externalTrafficPolicy | quote }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.applicationSet.metrics.service.type "LoadBalancer" }}
|
||||
loadBalancerSourceRanges: {{ .Values.applicationSet.metrics.service.loadBalancerSourceRanges }}
|
||||
{{- end }}
|
||||
{{- if (and (eq .Values.applicationSet.metrics.service.type "LoadBalancer") (not (empty .Values.applicationSet.metrics.service.loadBalancerIP))) }}
|
||||
loadBalancerIP: {{ .Values.applicationSet.metrics.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.service.sessionAffinity }}
|
||||
sessionAffinity: {{ .Values.applicationSet.metrics.service.sessionAffinity }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.service.sessionAffinityConfig }}
|
||||
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.metrics.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: {{ .Values.applicationSet.metrics.service.port }}
|
||||
protocol: TCP
|
||||
{{- if (and (or (eq .Values.applicationSet.service.type "NodePort") (eq .Values.applicationSet.service.type "LoadBalancer")) (not (empty .Values.applicationSet.metrics.service.nodePort))) }}
|
||||
nodePort: {{ .Values.applicationSet.metrics.service.nodePort }}
|
||||
{{- else if eq .Values.applicationSet.metrics.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: applicationSet
|
||||
{{- end }}
|
91
2.ArgoCD/templates/applicationset/role.yaml
Normal file
91
2.ArgoCD/templates/applicationset/role.yaml
Normal file
@@ -0,0 +1,91 @@
|
||||
{{- if and .Values.rbac.create .Values.applicationSet.enabled }}
|
||||
kind: Role
|
||||
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
||||
metadata:
|
||||
name: {{ include "argocd.applicationSet" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- argoproj.io
|
||||
resources:
|
||||
- applications
|
||||
- applicationsets
|
||||
- applicationsets/finalizers
|
||||
- applicationsets/status
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- argoproj.io
|
||||
resources:
|
||||
- applicationsets/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- argoproj.io
|
||||
resources:
|
||||
- appprojects
|
||||
verbs:
|
||||
- get
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- events
|
||||
verbs:
|
||||
- create
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
- configmaps
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- apps
|
||||
- extensions
|
||||
resources:
|
||||
- deployments
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
# Leader election
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
verbs:
|
||||
- create
|
||||
- update
|
||||
- delete
|
||||
- patch
|
||||
- apiGroups:
|
||||
- coordination.k8s.io
|
||||
resources:
|
||||
- leases
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
{{- end }}
|
18
2.ArgoCD/templates/applicationset/rolebinding.yaml
Normal file
18
2.ArgoCD/templates/applicationset/rolebinding.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- if and .Values.applicationSet.enabled .Values.applicationSet.serviceAccount.create .Values.rbac.create }}
|
||||
kind: RoleBinding
|
||||
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
||||
metadata:
|
||||
name: {{ include "argocd.applicationSet" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "argocd.applicationSet.serviceAccountName" . }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: {{ include "argocd.applicationSet" . }}
|
||||
{{- end }}
|
22
2.ArgoCD/templates/applicationset/service-account.yaml
Normal file
22
2.ArgoCD/templates/applicationset/service-account.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
{{- if and .Values.applicationSet.enabled .Values.rbac.create .Values.applicationSet.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "argocd.applicationSet.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
{{- if or .Values.applicationSet.serviceAccount.annotations .Values.commonAnnotations }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: applicationSet
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.serviceAccount.annotations }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.serviceAccount.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
automountServiceAccountToken: {{ .Values.applicationSet.serviceAccount.automountServiceAccountToken }}
|
||||
{{- end }}
|
55
2.ArgoCD/templates/applicationset/service.yaml
Normal file
55
2.ArgoCD/templates/applicationset/service.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
{{- if .Values.applicationSet.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "argocd.applicationSet" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: applicationSet
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.commonAnnotations .Values.applicationSet.service.annotations }}
|
||||
annotations:
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.service.annotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.applicationSet.service.annotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.applicationSet.service.type }}
|
||||
{{- if and .Values.applicationSet.service.clusterIP (eq .Values.applicationSet.service.type "ClusterIP") }}
|
||||
clusterIP: {{ .Values.applicationSet.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if (or (eq .Values.applicationSet.service.type "LoadBalancer") (eq .Values.applicationSet.service.type "NodePort")) }}
|
||||
externalTrafficPolicy: {{ .Values.applicationSet.service.externalTrafficPolicy | quote }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.applicationSet.service.type "LoadBalancer" }}
|
||||
loadBalancerSourceRanges: {{ .Values.applicationSet.service.loadBalancerSourceRanges }}
|
||||
{{- end }}
|
||||
{{- if (and (eq .Values.applicationSet.service.type "LoadBalancer") (not (empty .Values.applicationSet.service.loadBalancerIP))) }}
|
||||
loadBalancerIP: {{ .Values.applicationSet.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.service.sessionAffinity }}
|
||||
sessionAffinity: {{ .Values.applicationSet.service.sessionAffinity }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.service.sessionAffinityConfig }}
|
||||
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: webhook
|
||||
port: {{ .Values.applicationSet.service.port }}
|
||||
targetPort: webhook
|
||||
{{- if (and (or (eq .Values.applicationSet.service.type "NodePort") (eq .Values.applicationSet.service.type "LoadBalancer")) (not (empty .Values.applicationSet.service.nodePort))) }}
|
||||
nodePort: {{ .Values.applicationSet.service.nodePort }}
|
||||
{{- else if eq .Values.applicationSet.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.service.extraPorts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.service.extraPorts "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: applicationSet
|
||||
{{- end }}
|
49
2.ArgoCD/templates/applicationset/servicemonitor.yaml
Normal file
49
2.ArgoCD/templates/applicationset/servicemonitor.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
{{- if and .Values.applicationSet.enabled .Values.applicationSet.metrics.enabled .Values.applicationSet.metrics.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ include "argo-cd.applicationSet" . }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ .Values.applicationSet.metrics.serviceMonitor.namespace | quote }}
|
||||
{{- else }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
{{- end }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.selector }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.metrics.serviceMonitor.selector "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/component: applicationSet
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
endpoints:
|
||||
- port: http-metrics
|
||||
path: /metrics
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.interval }}
|
||||
interval: {{ .Values.applicationSet.metrics.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.applicationSet.metrics.serviceMonitor.scrapeTimeout }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.honorLabels }}
|
||||
honorLabels: {{ .Values.applicationSet.metrics.serviceMonitor.honorLabels }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.applicationSet.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.relabelings }}
|
||||
relabelings: {- include "common.tplvalues.render" ( dict "value" .Values.applicationSet.metrics.serviceMonitor.relabelings "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
app.kubernetes.io/part-of: applicationSet
|
||||
{{- end }}
|
Reference in New Issue
Block a user