From 7d327b33692723ef12109ba05fe9fd4319d7bbf0 Mon Sep 17 00:00:00 2001 From: prakarsh-dt Date: Thu, 7 Dec 2023 13:58:57 +0000 Subject: [PATCH] Synching Repo --- charts/devtron/Chart.yaml | 4 +- charts/devtron/devtron-bom.yaml | 29 +- charts/devtron/templates/app-sync-job.yaml | 4 +- charts/devtron/templates/devtron.yaml | 5 +- charts/devtron/templates/nats-server.yaml | 316 +++++++++++++++++++++ charts/devtron/values.yaml | 29 +- 6 files changed, 366 insertions(+), 21 deletions(-) create mode 100644 charts/devtron/templates/nats-server.yaml diff --git a/charts/devtron/Chart.yaml b/charts/devtron/Chart.yaml index da3248f3..50d826bd 100644 --- a/charts/devtron/Chart.yaml +++ b/charts/devtron/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: devtron-operator -appVersion: 0.6.24 +appVersion: 0.6.25 description: Chart to configure and install Devtron. Devtron is a Kubernetes Orchestration system. keywords: - Devtron @@ -11,7 +11,7 @@ keywords: - argocd - Hyperion engine: gotpl -version: 0.22.64 +version: 0.22.65 sources: - https://github.com/devtron-labs/charts dependencies: diff --git a/charts/devtron/devtron-bom.yaml b/charts/devtron/devtron-bom.yaml index dcbcab22..d9dffc25 100644 --- a/charts/devtron/devtron-bom.yaml +++ b/charts/devtron/devtron-bom.yaml @@ -9,13 +9,13 @@ global: runAsNonRoot: true installer: - release: "v0.6.24" + release: "v0.6.25" image: "quay.io/devtron/inception" tag: "44b30917-185-13275" components: dashboard: - image: "quay.io/devtron/dashboard:94cb7168-325-19078" + image: "quay.io/devtron/dashboard:b880ad10-325-19906" config: extraConfigs: USE_V2: "true" @@ -25,16 +25,16 @@ components: ENABLE_SCOPED_VARIABLES: "true" ENABLE_CI_JOB: "true" devtron: - image: "quay.io/devtron/hyperion:6822926b-280-19032" - cicdImage: "quay.io/devtron/devtron:6822926b-434-19035" + image: "quay.io/devtron/hyperion:95146ae5-280-19913" + cicdImage: "quay.io/devtron/devtron:95146ae5-434-19914" customOverrides: - DEFAULT_CI_IMAGE: "quay.io/devtron/ci-runner:ad3af321-138-18662" + DEFAULT_CI_IMAGE: "quay.io/devtron/ci-runner:560e6867-138-19679" argocdDexServer: image: "ghcr.io/dexidp/dex:v2.30.2" initContainer: authenticator: "quay.io/devtron/authenticator:e414faff-393-13273" kubelink: - image: "quay.io/devtron/kubelink:2dbe99a8-564-19001" + image: "quay.io/devtron/kubelink:59a19eb7-564-19917" configs: ENABLE_HELM_RELEASE_CACHE: "true" MANIFEST_FETCH_BATCH_SIZE: "2" @@ -53,7 +53,7 @@ components: image: "quay.io/devtron/postgres:11.9.0-debian-10-r26" armImage: "quay.io/devtron/postgres:11.9" gitsensor: - image: "quay.io/devtron/git-sensor:b6c3ea0e-200-16327" + image: "quay.io/devtron/git-sensor:4f3b9a14-200-19136" imagePullPolicy: "IfNotPresent" serviceMonitor: enabled: false @@ -81,6 +81,19 @@ components: dbconfig: secretName: postgresql-postgresql keyName: postgresql-password + nats: + image: nats:2.9.3-alpine + imagePullPolicy: IfNotPresent + reloader: + image: quay.io/devtron/nats-server-config-reloader:0.6.2 + imagePullPolicy: IfNotPresent + metrics: + image: quay.io/devtron/prometheus-nats-exporter:0.9.0 + imagePullPolicy: IfNotPresent + serviceMonitor: + enabled: false + persistence: + storage: 5Gi migrator: image: "quay.io/devtron/migrator:v4.16.2" envVars: @@ -106,7 +119,7 @@ workflowController: security: imageScanner: - image: "quay.io/devtron/image-scanner:ea03b0af-334-15158" + image: "quay.io/devtron/image-scanner:abb1e033-334-19909" notifier: image: "quay.io/devtron/notifier:d71bcbcd-372-18717" diff --git a/charts/devtron/templates/app-sync-job.yaml b/charts/devtron/templates/app-sync-job.yaml index d69ea552..57ff6abe 100644 --- a/charts/devtron/templates/app-sync-job.yaml +++ b/charts/devtron/templates/app-sync-job.yaml @@ -31,7 +31,7 @@ spec: {{- end }} containers: - name: chart-sync - image: quay.io/devtron/chart-sync:0e8c785e-373-16172 + image: quay.io/devtron/chart-sync:98957687-150-19133 {{- if and $.Values.global $.Values.global.containerSecurityContext }} securityContext: {{- toYaml $.Values.global.containerSecurityContext | nindent 10 }} @@ -80,7 +80,7 @@ spec: {{- end }} containers: - name: chart-sync - image: quay.io/devtron/chart-sync:0e8c785e-373-16172 + image: quay.io/devtron/chart-sync:98957687-150-19133 {{- if and $.Values.global $.Values.global.containerSecurityContext }} securityContext: {{- toYaml $.Values.global.containerSecurityContext | nindent 14 }} diff --git a/charts/devtron/templates/devtron.yaml b/charts/devtron/templates/devtron.yaml index 81079ebf..8821f261 100644 --- a/charts/devtron/templates/devtron.yaml +++ b/charts/devtron/templates/devtron.yaml @@ -18,10 +18,13 @@ data: PG_DATABASE: orchestrator DEX_HOST: http://argocd-dex-server.devtroncd DEX_PORT: "5556" - APP_SYNC_IMAGE: "quay.io/devtron/chart-sync:0e8c785e-373-16172" + APP_SYNC_IMAGE: "quay.io/devtron/chart-sync:98957687-150-19133" {{- if $.Values.installer.modules }} {{- if has "cicd" $.Values.installer.modules }} RUN_HELM_INSTALL_IN_ASYNC_MODE_HELM_APPS: "true" + ENABLE_ASYNC_INSTALL_DEVTRON_CHART: "true" + DEVTRON_CHART_INSTALL_REQUEST_TIMEOUT: "6" + CONSUMER_CONFIG_JSON: '{"DEVTRON-CHART-INSTALL-DURABLE":{"natsMsgProcessingBatchSize":1}}' {{- if $.Values.configs }} {{- if or ($.Values.minio.enabled) ($.Values.configs.BLOB_STORAGE_PROVIDER) }} BLOB_STORAGE_ENABLED: "true" diff --git a/charts/devtron/templates/nats-server.yaml b/charts/devtron/templates/nats-server.yaml new file mode 100644 index 00000000..59eeafe5 --- /dev/null +++ b/charts/devtron/templates/nats-server.yaml @@ -0,0 +1,316 @@ +{{- if $.Values.installer.modules }} +{{- if has "cicd" $.Values.installer.modules }} +{{- with .Values.components.nats }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: devtron-nats-config + namespace: "devtroncd" + labels: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: devtron-nats + app.kubernetes.io/managed-by: Helm +data: + nats.conf: | + # PID file shared with configuration reloader. + pid_file: "/var/run/nats/nats.pid" + ############### + # # + # Monitoring # + # # + ############### + http: 8222 + server_name:$POD_NAME + ################################### + # # + # NATS JetStream # + # # + ################################### + jetstream { + max_mem: 1Gi + domain: devtron-jet + } + lame_duck_duration: 120s +--- +# Source: nats/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: devtron-nats + namespace: "devtroncd" + labels: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: devtron-nats + app.kubernetes.io/managed-by: Helm +spec: + selector: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: devtron-nats + clusterIP: None + ports: + - name: client + port: 4222 + - name: cluster + port: 6222 + - name: monitor + port: 8222 + - name: metrics + port: 7777 + - name: leafnodes + port: 7422 + - name: gateways + port: 7522 +--- +# Source: nats/templates/statefulset.yaml +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: devtron-nats + namespace: "devtroncd" + labels: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: devtron-nats + app.kubernetes.io/managed-by: Helm +spec: + selector: + matchLabels: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: devtron-nats + replicas: 1 + serviceName: devtron-nats + template: + metadata: + annotations: + prometheus.io/path: /metrics + prometheus.io/port: "7777" + prometheus.io/scrape: "true" + labels: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: devtron-nats + spec: + # Common volumes for the containers. + volumes: + - name: config-volume + + configMap: + name: devtron-nats-config + + + # Local volume shared with the reloader. + - name: pid + emptyDir: {} + + ################# + # # + # TLS Volumes # + # # + ################# + + + + # Required to be able to HUP signal and apply config + # reload to the server without restarting the pod. + shareProcessNamespace: true + + ################# + # # + # NATS Server # + # # + ################# + terminationGracePeriodSeconds: 120 + containers: + - name: nats + image: {{ .image }} + imagePullPolicy: {{ .imagePullPolicy }} + resources: + {} + ports: + - containerPort: 4222 + name: client + - containerPort: 7422 + name: leafnodes + - containerPort: 7522 + name: gateways + - containerPort: 6222 + name: cluster + - containerPort: 8222 + name: monitor + - containerPort: 7777 + name: metrics + + command: + - "nats-server" + - "--config" + - "/etc/nats-config/nats.conf" + + # Required to be able to define an environment variable + # that refers to other environment variables. This env var + # is later used as part of the configuration file. + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: SERVER_NAME + value: $(POD_NAME) + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: CLUSTER_ADVERTISE + value: $(POD_NAME).devtron-nats.$(POD_NAMESPACE).svc.cluster.local + volumeMounts: + - name: config-volume + mountPath: /etc/nats-config + - name: pid + mountPath: /var/run/nats + - name: data + mountPath: /tmp/nats/jetstream + + # Liveness/Readiness probes against the monitoring. + # + livenessProbe: + httpGet: + path: / + port: 8222 + initialDelaySeconds: 10 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: / + port: 8222 + initialDelaySeconds: 10 + timeoutSeconds: 5 + + # Gracefully stop NATS Server on pod deletion or image upgrade. + # + lifecycle: + preStop: + exec: + # Using the alpine based NATS image, we add an extra sleep that is + # the same amount as the terminationGracePeriodSeconds to allow + # the NATS Server to gracefully terminate the client connections. + # + command: + - "/bin/sh" + - "-c" + - "nats-server -sl=ldm=/var/run/nats/nats.pid && /bin/sleep 120" + + ################################# + # # + # NATS Configuration Reloader # + # # + ################################# + + - name: reloader + image: {{ .reloader.image }} + imagePullPolicy: {{ .reloader.imagePullPolicy }} + resources: + null + command: + - "nats-server-config-reloader" + - "-pid" + - "/var/run/nats/nats.pid" + - "-config" + - "/etc/nats-config/nats.conf" + volumeMounts: + - name: config-volume + mountPath: /etc/nats-config + - name: pid + mountPath: /var/run/nats + + + ############################## + # # + # NATS Prometheus Exporter # + # # + ############################## + + - name: metrics + image: {{ .metrics.image }} + imagePullPolicy: {{ .metrics.imagePullPolicy }} + resources: + {} + args: + - -connz + - -routez + - -subz + - -varz + - -jsz=all + - -prefix=nats + - -use_internal_server_id + - http://localhost:8222/ + ports: + - containerPort: 7777 + name: metrics + + + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: {{ .persistence.storage }} +--- +# Source: nats/templates/tests/test-request-reply.yaml +apiVersion: v1 +kind: Pod +metadata: + name: "devtron-nats-test-request-reply" + labels: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: devtron-nats + app.kubernetes.io/managed-by: Helm + annotations: + "helm.sh/hook": test +spec: + containers: + - name: nats-box + image: quay.io/devtron/nats-box + env: + - name: NATS_HOST + value: devtron-nats + command: + - /bin/sh + - -ec + - | + nats reply -s nats://$NATS_HOST:4222 'name.>' --command "echo 1" & + - | + "&&" + - | + name=$(nats request -s nats://$NATS_HOST:4222 name.test '' 2>/dev/null) + - | + "&&" + - | + [ $name = test ] + + restartPolicy: Never +{{- if .serviceMonitor.enabled }} +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + kind: Prometheus + app: devtron-nats + release: monitoring + name: devtron-nats-server +spec: + endpoints: + - interval: 30s + path: /metrics + port: metrics + jobLabel: nats-server + namespaceSelector: + matchNames: + - devtroncd + selector: + matchLabels: + app.kubernetes.io/instance: devtron-nats + app.kubernetes.io/name: nats +{{- end }} +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/devtron/values.yaml b/charts/devtron/values.yaml index 0a7a406f..bd9ced5d 100644 --- a/charts/devtron/values.yaml +++ b/charts/devtron/values.yaml @@ -9,7 +9,7 @@ global: runAsNonRoot: true installer: repo: "devtron-labs/devtron" - release: "v0.6.24" + release: "v0.6.25" image: quay.io/devtron/inception tag: 44b30917-185-13275 source: "github" # Available options are github and gitee @@ -56,15 +56,15 @@ components: HIDE_EXCLUDE_INCLUDE_GIT_COMMITS: "false" ENABLE_SCOPED_VARIABLES: "true" ENABLE_CI_JOB: "true" - image: "quay.io/devtron/dashboard:94cb7168-325-19078" + image: "quay.io/devtron/dashboard:b880ad10-325-19906" imagePullPolicy: IfNotPresent devtron: - image: "quay.io/devtron/hyperion:6822926b-280-19032" - cicdImage: "quay.io/devtron/devtron:6822926b-434-19035" + image: "quay.io/devtron/hyperion:95146ae5-280-19913" + cicdImage: "quay.io/devtron/devtron:95146ae5-434-19914" imagePullPolicy: IfNotPresent customOverrides: - DEFAULT_CI_IMAGE: "quay.io/devtron/ci-runner:ad3af321-138-18662" + DEFAULT_CI_IMAGE: "quay.io/devtron/ci-runner:560e6867-138-19679" serviceMonitor: enabled: false service: @@ -94,7 +94,7 @@ components: authenticator: "quay.io/devtron/authenticator:e414faff-393-13273" kubelink: - image: "quay.io/devtron/kubelink:2dbe99a8-564-19001" + image: "quay.io/devtron/kubelink:59a19eb7-564-19917" imagePullPolicy: IfNotPresent configs: ENABLE_HELM_RELEASE_CACHE: "true" @@ -118,7 +118,7 @@ components: persistence: volumeSize: "20Gi" gitsensor: - image: "quay.io/devtron/git-sensor:b6c3ea0e-200-16327" + image: "quay.io/devtron/git-sensor:4f3b9a14-200-19136" imagePullPolicy: "IfNotPresent" serviceMonitor: enabled: false @@ -146,6 +146,19 @@ components: dbconfig: secretName: postgresql-postgresql keyName: postgresql-password + nats: + image: nats:2.9.3-alpine + imagePullPolicy: IfNotPresent + reloader: + image: quay.io/devtron/nats-server-config-reloader:0.6.2 + imagePullPolicy: IfNotPresent + metrics: + image: quay.io/devtron/prometheus-nats-exporter:0.9.0 + imagePullPolicy: IfNotPresent + serviceMonitor: + enabled: false + persistence: + storage: 5Gi migrator: image: "quay.io/devtron/migrator:v4.16.2" envVars: @@ -314,7 +327,7 @@ argo-cd: security: enabled: false imageScanner: - image: "quay.io/devtron/image-scanner:ea03b0af-334-15158" + image: "quay.io/devtron/image-scanner:abb1e033-334-19909" # Values for trivy trivy: enabled: false