From 3004a30caff83568d11d553e14ed4ae7fb82fbfe Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 5 Dec 2025 15:40:39 +0100 Subject: [PATCH] change --- dev/argocd/argocd-notifications-cm.yaml | 40 +++++++ dev/argocd/ingressrouteTCP-tls.yaml | 5 - dev/argocd/values.old | 123 ++++++++++++++++++++++ dev/argocd/values.old2 | 95 +++++++++++++++++ dev/argocd/values.yaml | 116 ++++++++------------ dev/{deptrack2 => deptrack}/README.md | 0 dev/{deptrack2 => deptrack}/deptrack.old | 0 dev/{deptrack2 => deptrack}/deptrack.yaml | 0 8 files changed, 303 insertions(+), 76 deletions(-) create mode 100644 dev/argocd/argocd-notifications-cm.yaml create mode 100644 dev/argocd/values.old create mode 100644 dev/argocd/values.old2 rename dev/{deptrack2 => deptrack}/README.md (100%) rename dev/{deptrack2 => deptrack}/deptrack.old (100%) rename dev/{deptrack2 => deptrack}/deptrack.yaml (100%) diff --git a/dev/argocd/argocd-notifications-cm.yaml b/dev/argocd/argocd-notifications-cm.yaml new file mode 100644 index 0000000..511ac55 --- /dev/null +++ b/dev/argocd/argocd-notifications-cm.yaml @@ -0,0 +1,40 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: argocd-notifications-cm + namespace: argocd + labels: + app.kubernetes.io/component: notifications-controller + app.kubernetes.io/instance: argocd + app.kubernetes.io/managed-by: manual + app.kubernetes.io/name: argocd-notifications-controller + app.kubernetes.io/part-of: argocd +data: + context: | + argocdUrl: https://argocd-dev.allarddcs.nl + + service.email.smtp: | + host: mail.allarddcs.nl + port: 587 + from: argocd@allarddcs.nl + username: argocd@allarddcs.nl + password: Argocd01@ + starttls: true + + template.app-sync-failed: | + email: + subject: Failed to sync application {{.app.metadata.name}}. + message: | + The sync of {{.app.metadata.name}} failed at {{.app.status.operationState.finishedAt}}. + Error: {{.app.status.operationState.message}} + More details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true + + trigger.on-sync-failed: | + - description: Application syncing has failed + send: [app-sync-failed] + when: app.status.operationState != nil and app.status.operationState.phase in ['Error','Failed'] + + subscriptions: | + - recipients: + - admin@allarddcs.nl + triggers: diff --git a/dev/argocd/ingressrouteTCP-tls.yaml b/dev/argocd/ingressrouteTCP-tls.yaml index 470b610..007e21a 100755 --- a/dev/argocd/ingressrouteTCP-tls.yaml +++ b/dev/argocd/ingressrouteTCP-tls.yaml @@ -12,11 +12,6 @@ spec: services: - name: argocd-server port: 443 - - match: HostSNI(`argocd-dev.allarddcs.nl`) && Headers(`Content-Type`, `application/grpc`) - priority: 11 - services: - - name: argocd-server - port: 443 tls: passthrough: true diff --git a/dev/argocd/values.old b/dev/argocd/values.old new file mode 100644 index 0000000..b7d0f68 --- /dev/null +++ b/dev/argocd/values.old @@ -0,0 +1,123 @@ +ingress: + server: + enabled: true + ingressClassName: traefik + hosts: + - host: argocd-dev.allarddcs.nl + paths: + - "/" + tls: + - hosts: + - argocd-dev.allarddcs.nl + secretName: argocd-tls-cert + +configs: + secret: + extra: + argocdServerAdminPassword: "$2a$10$CYBSxU6gqSBKP4knIdKDm.pF4TQXmJwUh860yXQEsHFy43Z2fuenK" + params: + # disable insecure (HTTP) + server.insecure: "false" + resource.customizations: | + rbac.authorization.k8s.io/ClusterRole: + ignoreDifferences: | + jsonPointers: + - /metadata/annotations/argocd.argoproj.io~1tracking-id + rbac.authorization.k8s.io/ClusterRoleBinding: + ignoreDifferences: | + jsonPointers: + - /metadata/annotations/argocd.argoproj.io~1tracking-id + +server: + tls: + enabled: true + # name of the TLS secret (created via cert-manager) + secretName: argocd-tls-cert + +repoServer: + extraArgs: + - --parallelismlimit=1 + + readinessProbe: + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 2 + failureThreshold: 10 + + livenessProbe: + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 2 + failureThreshold: 10 + +notifications: + enabled: true + name: notifications-controller + context: + argocdUrl: https://argocd-dev.allarddcs.nl + + secret: + create: true + name: argocd-notifications-secret + items: + email-username: "argocd@allarddcs.nl" + email-password: 'Argocd01@' + cm: + create: true + extra: + service.email: | + host: mail.allarddcs.nl + port: 587 + from: $email-username + username: $email-username + password: $email-password + starttls: true + + templates: + template.app-sync-failed: | + email: + subject: Failed to sync application {{.app.metadata.name}}. + message: | + {{if eq .serviceType "slack"}}:exclamation:{{end}} The sync operation of application {{.app.metadata.name}} has failed at {{.app.status.operationState.finishedAt}} with the following error: {{.app.status.operationState.message}} + Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true . + slack: + attachments: |- + [{ + "title": "{{ .app.metadata.name}}", + "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}", + "color": "#E96D76", + "fields": [ + { + "title": "Sync Status", + "value": "{{.app.status.sync.status}}", + "short": true + }, + { + "title": "Repository", + "value": "{{.app.spec.source.repoURL}}", + "short": true + } + {{range $index, $c := .app.status.conditions}} + {{if not $index}},{{end}} + {{if $index}},{{end}} + { + "title": "{{$c.type}}", + "value": "{{$c.message}}", + "short": true + } + {{end}} + ] + }] + + triggers: + trigger.on-sync-failed: | + - description: Application syncing has failed + send: [app-sync-failed] + when: app.status.operationState != nil and app.status.operationState.phase in ['Error','Failed'] + + subscriptions: + - recipients: + - admin@allarddcs.nl + triggers: + - on-sync-failed + diff --git a/dev/argocd/values.old2 b/dev/argocd/values.old2 new file mode 100644 index 0000000..01f02dd --- /dev/null +++ b/dev/argocd/values.old2 @@ -0,0 +1,95 @@ +ingress: + server: + enabled: true + ingressClassName: traefik + hosts: + - host: argocd-dev.allarddcs.nl + paths: + - "/" + tls: + - hosts: + - argocd-dev.allarddcs.nl + secretName: argocd-tls-cert + +configs: + secret: + extra: + argocdServerAdminPassword: "$2a$10$CYBSxU6gqSBKP4knIdKDm.pF4TQXmJwUh860yXQEsHFy43Z2fuenK" + params: + # disable insecure (HTTP) + server.insecure: "false" + resource.customizations: | + rbac.authorization.k8s.io/ClusterRole: + ignoreDifferences: | + jsonPointers: + - /metadata/annotations/argocd.argoproj.io~1tracking-id + rbac.authorization.k8s.io/ClusterRoleBinding: + ignoreDifferences: | + jsonPointers: + - /metadata/annotations/argocd.argoproj.io~1tracking-id + +server: + tls: + enabled: true + # name of the TLS secret (created via cert-manager) + secretName: argocd-tls-cert + +repoServer: + extraArgs: + - --parallelismlimit=1 + + readinessProbe: + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 2 + failureThreshold: 10 + + livenessProbe: + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 2 + failureThreshold: 10 + +notifications: + enabled: true + + context: + argocdUrl: https://argocd-dev.allarddcs.nl + + cm: + create: true + extra: + service.email: | + host: mail.allarddcs.nl + port: 587 + from: $email-username + username: $email-username + password: $email-password + starttls: true + + secret: + create: true + name: argocd-notifications-secret + items: + email-username: "argocd@allarddcs.nl" + email-password: "Argocd01@" + + templates: + app-sync-failed: | + email: + subject: Failed to sync application {{.app.metadata.name}}. + message: | + The sync operation of application {{.app.metadata.name}} has failed at {{.app.status.operationState.finishedAt}} with the following error: {{.app.status.operationState.message}} + More details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true + + triggers: + on-sync-failed: | + - description: Application syncing has failed + send: [app-sync-failed] + when: app.status.operationState != nil and app.status.operationState.phase in ['Error','Failed'] + + subscriptions: + - recipients: + - admin@allarddcs.nl + triggers: + - on-sync-failed diff --git a/dev/argocd/values.yaml b/dev/argocd/values.yaml index 45f8fbc..1cf1b8e 100644 --- a/dev/argocd/values.yaml +++ b/dev/argocd/values.yaml @@ -1,3 +1,6 @@ +global: + domain: argocd-dev.allarddcs.nl + ingress: server: enabled: true @@ -11,57 +14,6 @@ ingress: - argocd-dev.allarddcs.nl secretName: argocd-tls-cert -configs: - params: - # disable insecure (HTTP) - server.insecure: "false" - -configs: - resource.customizations: | - rbac.authorization.k8s.io/ClusterRole: - ignoreDifferences: | - jsonPointers: - - /metadata/annotations/argocd.argoproj.io~1tracking-id - rbac.authorization.k8s.io/ClusterRoleBinding: - ignoreDifferences: | - jsonPointers: - - /metadata/annotations/argocd.argoproj.io~1tracking-id - -server: - tls: - enabled: true - # name of the TLS secret (created via cert-manager) - secretName: argocd-tls-cert - -repoServer: - extraArgs: - - --parallelismlimit=1 - - readinessProbe: - initialDelaySeconds: 10 - periodSeconds: 5 - timeoutSeconds: 2 - failureThreshold: 10 - - livenessProbe: - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 2 - failureThreshold: 10 -ingress: - server: - enabled: true - ingressClassName: traefik - hosts: - - host: argocd-dev.allarddcs.nl - paths: - - "/" - tls: - - hosts: - - argocd-dev.allarddcs.nl - secretName: argocd-tls-cert - -configs: params: server.insecure: "false" @@ -83,44 +35,66 @@ server: repoServer: extraArgs: - --parallelismlimit=1 + readinessProbe: initialDelaySeconds: 10 periodSeconds: 5 timeoutSeconds: 2 failureThreshold: 10 + livenessProbe: initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 2 failureThreshold: 10 -# ---------------- Notifications ---------------- notifications: enabled: true - + name: notifications-controller + # Context available in templates context: - argocdUrl: https://argocd-dev.allarddcs.nl + argocdUrl: "https://argocd-dev.allarddcs.nl" - config: - # SMTP email service - service.email.smtp: | - username: argocd@allarddcs.nl - password: Argocd01@ - host: smtp.allarddcs.nl - port: 587 - from: argocd@allarddcs.nl + # Secret for SMTP credentials + secret: + create: true + name: argocd-notifications-secret + items: + email-username: "argocd@allarddcs.nl" + email-password: "Argocd01@" - # Optional template for sync failure - template.app-sync-failed: | - subject: ArgoCD: Application {{.app.metadata.name}} sync failed - body: | - Application {{.app.metadata.name}} failed to sync. - Status: {{.app.status.sync.status}} - Health: {{.app.status.health.status}} + # ConfigMap used by notifications-controller + cm: + create: false + extra: + service.email.smtp: | + host: mail.allarddcs.nl + port: 587 + from: argocd@allarddcs.nl + username: argocd@allarddcs.nl + password: Argocd01@ + starttls: true - # Global subscription for all apps + # Templates + templates: + app-sync-failed: | + email: + subject: Failed to sync application {{.app.metadata.name}}. + message: | + The sync of {{.app.metadata.name}} failed at {{.app.status.operationState.finishedAt}}. + Error: {{.app.status.operationState.message}} + More details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true + + # Triggers + triggers: + on-sync-failed: | + - description: Application syncing has failed + send: [app-sync-failed] + when: app.status.operationState != nil and app.status.operationState.phase in ['Error','Failed'] + + # Subscriptions subscriptions: - recipients: - admin@allarddcs.nl triggers: - - app-sync-failed + - on-sync-failed diff --git a/dev/deptrack2/README.md b/dev/deptrack/README.md similarity index 100% rename from dev/deptrack2/README.md rename to dev/deptrack/README.md diff --git a/dev/deptrack2/deptrack.old b/dev/deptrack/deptrack.old similarity index 100% rename from dev/deptrack2/deptrack.old rename to dev/deptrack/deptrack.old diff --git a/dev/deptrack2/deptrack.yaml b/dev/deptrack/deptrack.yaml similarity index 100% rename from dev/deptrack2/deptrack.yaml rename to dev/deptrack/deptrack.yaml