From 72a11e2c8307884e3429721b0a9ab52f9b8f4298 Mon Sep 17 00:00:00 2001 From: Satyam Soni <94950988+satyampsoni@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:19:23 +0530 Subject: [PATCH 01/16] Update development.md --- developers-guide/README.md | 70 ++++++++++++++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/developers-guide/README.md b/developers-guide/README.md index 7d9e669742..f915b268a3 100644 --- a/developers-guide/README.md +++ b/developers-guide/README.md @@ -1,12 +1,68 @@ -# Local Devtron Dev Setup +# Development Guide for Devtron -For all the open source contributors out there looking for contributing to Devtron’s code base, here’s how easily you can start contributing in Devtron. +This document provides instructions for setting up a development environment to help you get started with contributing to [Devtron](github.com/devtron-labs/devtron). Make sure to review the [contributing.md](https://github.com/devtron-labs/devtron/blob/main/CONTRIBUTING.md) file for more details on contributing. This document will help guide you through understanding the build process. -## Prerequisite -Any kubernetes Cluster +## Requirements +- [Go Programming language](https://go.dev/) +- [Docker](https://www.docker.com/) +- [Kubernetes Cluster](https://kubernetes.io/) +- [Helm v3](https://helm.sh/) ## Setup Guide -We have documented some of the most popular and easiest ways of creating local kubernetes clusters and setting up the development environment for devtron in our machine. -* [Over Minikube Cluster](https://dev.to/arushi09/local-kubernetes-development-made-easy-with-minikube-devtron-17hf) -* [Over k3s Cluster using k3d](https://hackernoon.com/how-to-install-k3d-and-devtron-locally-for-local-kubernetes-development) \ No newline at end of file +### Install Devtron in a Kubernetes cluster + +1. [Create a Kubernetes Cluster](https://docs.devtron.ai/getting-started#create-a-kubernetes-cluster) + - 2 vCPUs + - 4GB+ of free memory + - 20GB+ free disk space + +2. [Install Devtron with CI/CD along with GitOps (Argo CD) - Full mode](https://docs.devtron.ai/install/install-devtron-with-cicd-with-gitops) + + ```bash + helm repo add devtron https://helm.devtron.ai + helm repo update devtron + helm install devtron devtron/devtron-operator \ + --create-namespace --namespace devtroncd \ + --set installer.modules={cicd} \ + --set argo-cd.enabled=true + ``` + + Note: If you want to install Devtron on a Managed Kubernetes cluster, please [refer to the guide](https://docs.devtron.ai/install/demo-tutorials). + +3. Download the kubeconfig file to access your cluster. It’s a good idea to set it up locally and configure the context to point to the specific cluster you’re working with. + +4. Forward the port of PostgreSQL service and Devtron NATS service: + + ```bash + kubectl -n devtroncd port-forward svc/devtron-nats 4222:4222 + kubectl -n devtroncd port-forward svc/postgresql-postgresql 5432:5432 + ``` + +5. Use this command to extract the password of PostgreSQL (Required to put in ENV): + + ```bash + kubectl exec -it -n devtroncd postgresql-postgresql-0 -- printenv | grep POSTGRES_PASSWORD + ``` + +### Prepare Your Local Workspace + +Navigate to the `github.com` directory on your local machine: + +- `cd go/src/github.com` +- `git clone http://github.com/devtron-labs/devtron` +- Configure [Environment Variables](https://github.com/devtron-labs/devtron/blob/main/scripts/dev-conf/envfile.env) +- Run the server: + + ```bash + make run + ``` + +This will start your server on `localhost:8080`. + +### Need help? + +If you’re looking for the fastest response to your questions, we encourage you to visit our Discord community. Specifically, you can post your inquiries in the [#setup-and-installation](https://discord.com/channels/769482988882493450/801441246849007667) channel, where our team and community members are actively available to assist you on discord channel. + + + From f32d626e3c388490de3b19a15c79a871975fda7c Mon Sep 17 00:00:00 2001 From: Satyam Soni <94950988+satyampsoni@users.noreply.github.com> Date: Wed, 7 May 2025 11:45:09 +0530 Subject: [PATCH 02/16] Update README.md --- developers-guide/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/developers-guide/README.md b/developers-guide/README.md index f915b268a3..4ab50da9c9 100644 --- a/developers-guide/README.md +++ b/developers-guide/README.md @@ -52,7 +52,8 @@ Navigate to the `github.com` directory on your local machine: - `cd go/src/github.com` - `git clone http://github.com/devtron-labs/devtron` - Configure [Environment Variables](https://github.com/devtron-labs/devtron/blob/main/scripts/dev-conf/envfile.env) -- Run the server: +- Install [wire]{https://github.com/google/wire} (Required) +- Run the server: ```bash make run From f7bb9cf72e7fad4bf08b6ef489e2654d68e04bff Mon Sep 17 00:00:00 2001 From: Satyam Soni <94950988+satyampsoni@users.noreply.github.com> Date: Wed, 7 May 2025 13:08:17 +0530 Subject: [PATCH 03/16] Update README.md --- developers-guide/README.md | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/developers-guide/README.md b/developers-guide/README.md index 4ab50da9c9..8f962e7c4f 100644 --- a/developers-guide/README.md +++ b/developers-guide/README.md @@ -32,12 +32,19 @@ This document provides instructions for setting up a development environment to 3. Download the kubeconfig file to access your cluster. It’s a good idea to set it up locally and configure the context to point to the specific cluster you’re working with. -4. Forward the port of PostgreSQL service and Devtron NATS service: - - ```bash - kubectl -n devtroncd port-forward svc/devtron-nats 4222:4222 - kubectl -n devtroncd port-forward svc/postgresql-postgresql 5432:5432 - ``` +4. Forward the necessary service ports (e.g., PostgreSQL, NATS) for local access + + ``` + #Required + kubectl -n devtroncd port-forward svc/devtron-nats 4222:4222 # Allows event driven communictation between microservices. + kubectl -n devtroncd port-forward svc/postgresql-postgresql 5432:5432 #Allows your local code to connect to the database running in the cluster. + + #Optional + kubectl -n devtroncd port-forward svc/argocd-server 8000:80 #Required to interact with ArgoCD's API (GitOps) + kubectl -n devtroncd port-forward svc/argocd-dex-server 5556:5556 #Required for SSO Logins. + kubectl -n devtroncd port-forward svc/kubelink-service 50051:50051 #Required for no-gitops (helm) and fetches the status of resources. + kubectl -n devtroncd port-forward svc/git-sensor-service 7070:80 # Monitors Git repositories for changes and triggers appropriate workflows in Devtron. + ``` 5. Use this command to extract the password of PostgreSQL (Required to put in ENV): @@ -52,7 +59,7 @@ Navigate to the `github.com` directory on your local machine: - `cd go/src/github.com` - `git clone http://github.com/devtron-labs/devtron` - Configure [Environment Variables](https://github.com/devtron-labs/devtron/blob/main/scripts/dev-conf/envfile.env) -- Install [wire]{https://github.com/google/wire} (Required) +- Install [wire](ttps://github.com/google/wire) (Required) - Run the server: ```bash @@ -61,7 +68,20 @@ Navigate to the `github.com` directory on your local machine: This will start your server on `localhost:8080`. -### Need help? +## Cleanup + + ``` + 1. Uninstall Devtron and delete the 'devtroncd' namespace + helm uninstall devtron -n devtroncd + kubectl delete namespace devtroncd + + 2. Remove the local Devtron codebase + rm -rf ~/go/src/github.com/devtron-labs/devtron + ``` +## Contributing +Please check [contributing guidelines](https://github.com/devtron-labs/devtron/blob/main/CONTRIBUTING.md) + +## Need help? If you’re looking for the fastest response to your questions, we encourage you to visit our Discord community. Specifically, you can post your inquiries in the [#setup-and-installation](https://discord.com/channels/769482988882493450/801441246849007667) channel, where our team and community members are actively available to assist you on discord channel. From 55ca520c19750c92a568ebb20b5af2a0769bc0d9 Mon Sep 17 00:00:00 2001 From: Satyam Soni <94950988+satyampsoni@users.noreply.github.com> Date: Fri, 9 May 2025 12:58:51 +0530 Subject: [PATCH 04/16] Update README.md --- developers-guide/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/developers-guide/README.md b/developers-guide/README.md index 8f962e7c4f..15ea852144 100644 --- a/developers-guide/README.md +++ b/developers-guide/README.md @@ -30,7 +30,7 @@ This document provides instructions for setting up a development environment to Note: If you want to install Devtron on a Managed Kubernetes cluster, please [refer to the guide](https://docs.devtron.ai/install/demo-tutorials). -3. Download the kubeconfig file to access your cluster. It’s a good idea to set it up locally and configure the context to point to the specific cluster you’re working with. +3. [Download the kubeconfig file](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/(url)) to access your cluster. It’s a good idea to set it up locally and configure the context to point to the specific cluster you’re working with. 4. Forward the necessary service ports (e.g., PostgreSQL, NATS) for local access @@ -59,7 +59,7 @@ Navigate to the `github.com` directory on your local machine: - `cd go/src/github.com` - `git clone http://github.com/devtron-labs/devtron` - Configure [Environment Variables](https://github.com/devtron-labs/devtron/blob/main/scripts/dev-conf/envfile.env) -- Install [wire](ttps://github.com/google/wire) (Required) +- Install [wire](https://github.com/google/wire) (Required) - Run the server: ```bash From 28c3045b5d88e8d59cb979a51ee8cf8abb0fc100 Mon Sep 17 00:00:00 2001 From: Kiran <155609672+kirandevtn@users.noreply.github.com> Date: Tue, 13 May 2025 14:57:53 +0530 Subject: [PATCH 05/16] added support for relabelings in servicemonitor (#6562) --- .../statefulset-chart_5-1-0/templates/servicemonitor.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/templates/servicemonitor.yaml b/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/templates/servicemonitor.yaml index 57d745dbe8..ba714bf9a2 100644 --- a/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/templates/servicemonitor.yaml +++ b/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/templates/servicemonitor.yaml @@ -55,6 +55,10 @@ spec: {{- if .servicemonitor.metricRelabelings}} metricRelabelings: {{toYaml .servicemonitor.metricRelabelings | indent 8 }} + {{- end }} + {{- if .servicemonitor.relabelings }} + relabelings: +{{ toYaml .servicemonitor.relabelings | indent 8 }} {{- end }} {{- end }} {{- end }} @@ -94,6 +98,10 @@ spec: {{- if .servicemonitor.metricRelabelings}} metricRelabelings: {{toYaml .servicemonitor.metricRelabelings | indent 8 }} + {{- end }} + {{- if .servicemonitor.relabelings }} + relabelings: +{{ toYaml .servicemonitor.relabelings | indent 8 }} {{- end }} {{- end }} {{- end }} From afc0794334286da383400373742f02169e36eb27 Mon Sep 17 00:00:00 2001 From: iamayushm <32041961+iamayushm@users.noreply.github.com> Date: Thu, 15 May 2025 13:06:27 +0530 Subject: [PATCH 06/16] removing rollout chart name condition (#6571) --- pkg/deployment/manifest/ManifestCreationService.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/deployment/manifest/ManifestCreationService.go b/pkg/deployment/manifest/ManifestCreationService.go index da286d1bdf..ef1e84e969 100644 --- a/pkg/deployment/manifest/ManifestCreationService.go +++ b/pkg/deployment/manifest/ManifestCreationService.go @@ -379,9 +379,6 @@ func (impl *ManifestCreationServiceImpl) GetEnvOverrideForSpecificConfigTrigger( } templateName := deploymentTemplateHistory.TemplateName templateVersion := deploymentTemplateHistory.TemplateVersion - if templateName == "Rollout Deployment" { - templateName = "" - } //getting chart_ref by id _, span = otel.Tracer("orchestrator").Start(ctx, "chartRefRepository.FindByVersionAndName") chartRefDto, err := impl.chartRefService.FindByVersionAndName(templateVersion, templateName) From 1d67dd5ed69f845e3e9b2e696afdcbd7dff10591 Mon Sep 17 00:00:00 2001 From: Rupin Solanki Date: Thu, 15 May 2025 14:12:35 +0530 Subject: [PATCH 07/16] rollout reference chart 5-1-0 --- .../reference-chart_5-1-0/.helmignore | 22 + .../.image_descriptor_template.json | 1 + .../reference-chart_5-1-0/Chart.yaml | 5 + .../reference-chart_5-1-0/README.md | 863 +++++++++++ .../reference-chart_5-1-0/app-values.yaml | 448 ++++++ .../reference-chart_5-1-0/env-values.yaml | 66 + .../pipeline-values.yaml | 26 + .../reference-chart_5-1-0/release-values.yaml | 14 + .../reference-chart_5-1-0/schema.json | 1363 +++++++++++++++++ .../secrets-test-values.yaml | 1 + .../reference-chart_5-1-0/templates/NOTES.txt | 19 + .../templates/_helpers.tpl | 167 ++ .../templates/ambassador.yaml | 86 ++ .../templates/analysis-template.yaml | 34 + .../templates/configmap.yaml | 22 + .../templates/deployment.yaml | 761 +++++++++ .../templates/externalsecrets.yaml | 76 + .../templates/generic.yaml | 4 + .../reference-chart_5-1-0/templates/hpa.yaml | 93 ++ .../templates/ingress.yaml | 187 +++ .../templates/istio-authorizationpolicy.yaml | 45 + .../templates/istio-destinationrule.yaml | 42 + .../templates/istio-gateway.yaml | 73 + .../templates/istio-peerauthentication.yaml | 44 + .../istio-requestauthentication.yaml | 42 + .../templates/istio-virtualservice.yaml | 68 + .../templates/keda-autoscaling.yaml | 78 + .../templates/metrics-service-monitor.yaml | 35 + .../templates/networkpolicy.yaml | 52 + .../templates/persistent-volume-claim.yaml | 27 + .../templates/poddisruptionbudget.yaml | 38 + .../templates/pre-sync-job.yaml | 23 + .../templates/prometheusrules.yaml | 22 + .../templates/secret.yaml | 69 + .../templates/service.yaml | 106 ++ .../templates/serviceaccount.yaml | 16 + .../templates/servicemonitor.yaml | 117 ++ .../templates/sidecar-configmap.yaml | 169 ++ .../templates/vertical-pod-autoscaler.yaml | 41 + .../templates/winter-soldier.yaml | 45 + .../reference-chart_5-1-0/test_values.yaml | 716 +++++++++ .../reference-chart_5-1-0/values.yaml | 668 ++++++++ scripts/sql/32603301_reference-5-1-0.down.sql | 5 + scripts/sql/32603301_reference-5-1-0.up.sql | 9 + 44 files changed, 6808 insertions(+) create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/.helmignore create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/.image_descriptor_template.json create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/Chart.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/README.md create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/app-values.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/env-values.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/pipeline-values.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/release-values.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/schema.json create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/secrets-test-values.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/NOTES.txt create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/_helpers.tpl create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/ambassador.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/analysis-template.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/configmap.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/deployment.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/externalsecrets.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/generic.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/hpa.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/ingress.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-authorizationpolicy.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-destinationrule.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-gateway.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-peerauthentication.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-requestauthentication.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-virtualservice.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/keda-autoscaling.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/metrics-service-monitor.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/networkpolicy.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/persistent-volume-claim.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/poddisruptionbudget.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/pre-sync-job.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/prometheusrules.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/secret.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/service.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/serviceaccount.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/servicemonitor.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/sidecar-configmap.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/vertical-pod-autoscaler.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/winter-soldier.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/test_values.yaml create mode 100644 scripts/devtron-reference-helm-charts/reference-chart_5-1-0/values.yaml create mode 100644 scripts/sql/32603301_reference-5-1-0.down.sql create mode 100644 scripts/sql/32603301_reference-5-1-0.up.sql diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/.helmignore b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/.helmignore new file mode 100644 index 0000000000..50af031725 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/.image_descriptor_template.json b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/.image_descriptor_template.json new file mode 100644 index 0000000000..bd2472da07 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/.image_descriptor_template.json @@ -0,0 +1 @@ +{"server":{"deployment":{"image_tag":"{{.Tag}}","image":"{{.Name}}"}},"pipelineName": "{{.PipelineName}}","releaseVersion":"{{.ReleaseVersion}}","deploymentType": "{{.DeploymentType}}", "app": "{{.App}}", "env": "{{.Env}}", "appMetrics": {{.AppMetrics}}} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/Chart.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/Chart.yaml new file mode 100644 index 0000000000..9587b93fcc --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: A Helm chart for Kubernetes +name: reference-chart_5-1-0 +version: 5.1.0 \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/README.md b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/README.md new file mode 100644 index 0000000000..fcd6785033 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/README.md @@ -0,0 +1,863 @@ + +# Rollout Deployment Chart - v5.0 + +## 1. Yaml File - + +### Container Ports + +This defines ports on which application services will be exposed to other services + +```yaml +ContainerPort: + - envoyPort: 8799 + idleTimeout: + name: app + port: 8080 + servicePort: 80 + nodePort: 32056 + supportStreaming: true + useHTTP2: true +``` + +| Key | Description | +| :--- | :--- | +| `envoyPort` | envoy port for the container. | +| `idleTimeout` | the duration of time that a connection is idle before the connection is terminated. | +| `name` | name of the port. | +| `port` | port for the container. | +| `servicePort` | port of the corresponding kubernetes service. | +| `nodePort` | nodeport of the corresponding kubernetes service. | +| `supportStreaming` | Used for high performance protocols like grpc where timeout needs to be disabled. | +| `useHTTP2` | Envoy container can accept HTTP2 requests. | + +### EnvVariables +```yaml +EnvVariables: [] +``` +To set environment variables for the containers that run in the Pod. + +### EnvVariablesFromSecretKeys +```yaml +EnvVariablesFromSecretKeys: + - name: ENV_NAME + secretName: SECRET_NAME + keyName: SECRET_KEY + +``` + It is use to get the name of Environment Variable name, Secret name and the Key name from which we are using the value in that corresponding Environment Variable. + + ### EnvVariablesFromConfigMapKeys +```yaml +EnvVariablesFromConfigMapKeys: + - name: ENV_NAME + configMapName: CONFIG_MAP_NAME + keyName: CONFIG_MAP_KEY + +``` + It is use to get the name of Environment Variable name, Config Map name and the Key name from which we are using the value in that corresponding Environment Variable. + +### Liveness Probe + +If this check fails, kubernetes restarts the pod. This should return error code in case of non-recoverable error. + +```yaml +LivenessProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: + - name: Custom-Header + value: abc + scheme: "" + tcp: true +``` + +| Key | Description | +| :--- | :--- | +| `Path` | It define the path where the liveness needs to be checked. | +| `initialDelaySeconds` | It defines the time to wait before a given container is checked for liveliness. | +| `periodSeconds` | It defines the time to check a given container for liveness. | +| `successThreshold` | It defines the number of successes required before a given container is said to fulfil the liveness probe. | +| `timeoutSeconds` | It defines the time for checking timeout. | +| `failureThreshold` | It defines the maximum number of failures that are acceptable before a given container is not considered as live. | +| `httpHeaders` | Custom headers to set in the request. HTTP allows repeated headers,You can override the default headers by defining .httpHeaders for the probe. | +| `scheme` | Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP. +| `tcp` | The kubelet will attempt to open a socket to your container on the specified port. If it can establish a connection, the container is considered healthy. | + + +### MaxUnavailable + +```yaml + MaxUnavailable: 0 +``` +The maximum number of pods that can be unavailable during the update process. The value of "MaxUnavailable: " can be an absolute number or percentage of the replicas count. The default value of "MaxUnavailable: " is 25%. + +### MaxSurge + +```yaml +MaxSurge: 1 +``` +The maximum number of pods that can be created over the desired number of pods. For "MaxSurge: " also, the value can be an absolute number or percentage of the replicas count. +The default value of "MaxSurge: " is 25%. + +### Min Ready Seconds + +```yaml +MinReadySeconds: 60 +``` +This specifies the minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available. This defaults to 0 (the Pod will be considered available as soon as it is ready). + +### Readiness Probe + +If this check fails, kubernetes stops sending traffic to the application. This should return error code in case of errors which can be recovered from if traffic is stopped. + +```yaml +ReadinessProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: + - name: Custom-Header + value: abc + scheme: "" + tcp: true +``` + +| Key | Description | +| :--- | :--- | +| `Path` | It define the path where the readiness needs to be checked. | +| `initialDelaySeconds` | It defines the time to wait before a given container is checked for readiness. | +| `periodSeconds` | It defines the time to check a given container for readiness. | +| `successThreshold` | It defines the number of successes required before a given container is said to fulfill the readiness probe. | +| `timeoutSeconds` | It defines the time for checking timeout. | +| `failureThreshold` | It defines the maximum number of failures that are acceptable before a given container is not considered as ready. | +| `httpHeaders` | Custom headers to set in the request. HTTP allows repeated headers,You can override the default headers by defining .httpHeaders for the probe. | +| `scheme` | Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP. +| `tcp` | The kubelet will attempt to open a socket to your container on the specified port. If it can establish a connection, the container is considered healthy. | + +### Pod Disruption Budget + +You can create `PodDisruptionBudget` for each application. A PDB limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, an application would like to ensure the number of replicas running is never brought below the certain number. + +```yaml +podDisruptionBudget: + minAvailable: 1 +``` + +or + +```yaml +podDisruptionBudget: + maxUnavailable: 50% +``` + +You can specify either `maxUnavailable` or `minAvailable` in a PodDisruptionBudget and it can be expressed as integers or as a percentage + +| Key | Description | +| :--- | :--- | +| `minAvailable` | Evictions are allowed as long as they leave behind 1 or more healthy pods of the total number of desired replicas. | +| `maxUnavailable` | Evictions are allowed as long as at most 1 unhealthy replica among the total number of desired replicas. | + +### Ambassador Mappings + +You can create ambassador mappings to access your applications from outside the cluster. At its core a Mapping resource maps a resource to a service. + +```yaml +ambassadorMapping: + ambassadorId: "prod-emissary" + cors: {} + enabled: true + hostname: devtron.example.com + labels: {} + prefix: / + retryPolicy: {} + rewrite: "" + tls: + context: "devtron-tls-context" + create: false + hosts: [] + secretName: "" +``` + +| Key | Description | +| :--- | :--- | +| `enabled` | Set true to enable ambassador mapping else set false.| +| `ambassadorId` | used to specify id for specific ambassador mappings controller. | +| `cors` | used to specify cors policy to access host for this mapping. | +| `weight` | used to specify weight for canary ambassador mappings. | +| `hostname` | used to specify hostname for ambassador mapping. | +| `prefix` | used to specify path for ambassador mapping. | +| `labels` | used to provide custom labels for ambassador mapping. | +| `retryPolicy` | used to specify retry policy for ambassador mapping. | +| `corsPolicy` | Provide cors headers on flagger resource. | +| `rewrite` | used to specify whether to redirect the path of this mapping and where. | +| `tls` | used to create or define ambassador TLSContext resource. | +| `extraSpec` | used to provide extra spec values which not present in deployment template for ambassador resource. | + +### Autoscaling + +This is connected to HPA and controls scaling up and down in response to request load. + +```yaml +autoscaling: + enabled: false + MinReplicas: 1 + MaxReplicas: 2 + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 + extraMetrics: [] +``` + +| Key | Description | +| :--- | :--- | +| `enabled` | Set true to enable autoscaling else set false.| +| `MinReplicas` | Minimum number of replicas allowed for scaling. | +| `MaxReplicas` | Maximum number of replicas allowed for scaling. | +| `TargetCPUUtilizationPercentage` | The target CPU utilization that is expected for a container. | +| `TargetMemoryUtilizationPercentage` | The target memory utilization that is expected for a container. | +| `extraMetrics` | Used to give external metrics for autoscaling. | + +### Fullname Override + +```yaml +fullnameOverride: app-name +``` +`fullnameOverride` replaces the release fullname created by default by devtron, which is used to construct Kubernetes object names. By default, devtron uses {app-name}-{environment-name} as release fullname. + +### Image + +```yaml +image: + pullPolicy: IfNotPresent +``` + +Image is used to access images in kubernetes, pullpolicy is used to define the instances calling the image, here the image is pulled when the image is not present,it can also be set as "Always". + +### imagePullSecrets + +`imagePullSecrets` contains the docker credentials that are used for accessing a registry. + +```yaml +imagePullSecrets: + - regcred +``` +regcred is the secret that contains the docker credentials that are used for accessing a registry. Devtron will not create this secret automatically, you'll have to create this secret using dt-secrets helm chart in the App store or create one using kubectl. You can follow this documentation Pull an Image from a Private Registry [https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) . + +### Ingress + +This allows public access to the url, please ensure you are using right nginx annotation for nginx class, its default value is nginx + +```yaml +ingress: + enabled: false + # For K8s 1.19 and above use ingressClassName instead of annotation kubernetes.io/ingress.class: + className: nginx + annotations: {} + hosts: + - host: example1.com + paths: + - /example + - host: example2.com + paths: + - /example2 + - /example2/healthz + tls: [] +``` +Legacy deployment-template ingress format + +```yaml +ingress: + enabled: false + # For K8s 1.19 and above use ingressClassName instead of annotation kubernetes.io/ingress.class: + ingressClassName: nginx-internal + annotations: {} + path: "" + host: "" + tls: [] +``` + +| Key | Description | +| :--- | :--- | +| `enabled` | Enable or disable ingress | +| `annotations` | To configure some options depending on the Ingress controller | +| `path` | Path name | +| `host` | Host name | +| `tls` | It contains security details | +### additionalBackends + +This defines additional backend path in the ingress . + +```yaml + hosts: + - host: chart-example2.local + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + additionalBackends: + - path: /example1 + pathType: "ImplementationSpecific" + backend: + service: + name: test-service + port: + number: 80 +``` +### Ingress Internal + +This allows private access to the url, please ensure you are using right nginx annotation for nginx class, its default value is nginx + +```yaml +ingressInternal: + enabled: false + # For K8s 1.19 and above use ingressClassName instead of annotation kubernetes.io/ingress.class: + ingressClassName: nginx-internal + annotations: {} + hosts: + - host: example1.com + paths: + - /example + - host: example2.com + paths: + - /example2 + - /example2/healthz + tls: [] +``` + +| Key | Description | +| :--- | :--- | +| `enabled` | Enable or disable ingress | +| `annotations` | To configure some options depending on the Ingress controller | +| `path` | Path name | +| `host` | Host name | +| `tls` | It contains security details | + +### Init Containers +```yaml +initContainers: + - reuseContainerImage: true + securityContext: + runAsUser: 1000 + runAsGroup: 3000 + fsGroup: 2000 + volumeMounts: + - mountPath: /etc/ls-oms + name: ls-oms-cm-vol + command: + - flyway + - -configFiles=/etc/ls-oms/flyway.conf + - migrate + + - name: nginx + image: nginx:1.14.2 + securityContext: + privileged: true + ports: + - containerPort: 80 + command: ["/usr/local/bin/nginx"] + args: ["-g", "daemon off;"] +``` +Specialized containers that run before app containers in a Pod. Init containers can contain utilities or setup scripts not present in an app image. One can use base image inside initContainer by setting the reuseContainerImage flag to `true`. + +### Istio + +Istio is a service mesh which simplifies observability, traffic management, security and much more with it's virtual services and gateways. + +```yaml +istio: + enable: true + gateway: + annotations: {} + enabled: false + host: example.com + labels: {} + tls: + enabled: false + secretName: example-tls-secret + virtualService: + annotations: {} + enabled: false + gateways: [] + hosts: [] + http: + - corsPolicy: + allowCredentials: false + allowHeaders: + - x-some-header + allowMethods: + - GET + allowOrigin: + - example.com + maxAge: 24h + headers: + request: + add: + x-some-header: value + match: + - uri: + prefix: /v1 + - uri: + prefix: /v2 + retries: + attempts: 2 + perTryTimeout: 3s + rewriteUri: / + route: + - destination: + host: service1 + port: 80 + timeout: 12s + - route: + - destination: + host: service2 + labels: {} +``` + +### Pause For Seconds Before Switch Active +```yaml +pauseForSecondsBeforeSwitchActive: 30 +``` +To wait for given period of time before switch active the container. + + +### Winter-Soldier +Winter Soldier can be used to +- cleans up (delete) Kubernetes resources +- reduce workload pods to 0 + +**_NOTE:_** After deploying this we can create the Hibernator object and provide the custom configuration by which workloads going to delete, sleep and many more. for more information check [the main repo](https://github.com/devtron-labs/winter-soldier) + +Given below is template values you can give in winter-soldier: +```yaml +winterSoilder: + enable: false + apiVersion: pincher.devtron.ai/v1alpha1 + action: sleep + timeRangesWithZone: + timeZone: "Asia/Kolkata" + timeRanges: [] + targetReplicas: [] + fieldSelector: [] +``` +Here, +| Key | values | Description | +| :--- | :--- | :--- | +| `enable` | `fasle`,`true` | decide the enabling factor | +| `apiVersion` | `pincher.devtron.ai/v1beta1`, `pincher.devtron.ai/v1alpha1` | specific api version | +| `action` | `sleep`,`delete`, `scale` | This specify the action need to perform. | +| `timeRangesWithZone`:`timeZone` | eg:- `"Asia/Kolkata"`,`"US/Pacific"` | It use to specify the timeZone used. (It uses standard format. please refer [this](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) | +| `timeRangesWithZone`:`timeRanges` | array of [ `timeFrom`, `timeTo`, `weekdayFrom`, `weekdayTo`] | It use to define time period/range on which the user need to perform the specified action. you can have multiple timeRanges.
These settings will take `action` on Sat and Sun from 00:00 to 23:59:59, | +| `targetReplicas` | `[n]` : n - number of replicas to scale. | These is mandatory field when the `action` is `scale`
Defalut value is `[]`. | +| `fieldSelector` | `- AfterTime(AddTime( ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '5m'), Now()) ` | These value will take a list of methods to select the resources on which we perform specified `action` . | + + +here is an example, +```yaml +winterSoilder: + apiVersion: pincher.devtron.ai/v1alpha1 + enable: true + annotations: {} + labels: {} + timeRangesWithZone: + timeZone: "Asia/Kolkata" + timeRanges: + - timeFrom: 00:00 + timeTo: 23:59:59 + weekdayFrom: Sat + weekdayTo: Sun + - timeFrom: 00:00 + timeTo: 08:00 + weekdayFrom: Mon + weekdayTo: Fri + - timeFrom: 20:00 + timeTo: 23:59:59 + weekdayFrom: Mon + weekdayTo: Fri + action: scale + targetReplicas: [1,1,1] + fieldSelector: + - AfterTime(AddTime( ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '10h'), Now()) +``` +Above settings will take action on `Sat` and `Sun` from 00:00 to 23:59:59, and on `Mon`-`Fri` from 00:00 to 08:00 and 20:00 to 23:59:59. If `action:sleep` then runs hibernate at timeFrom and unhibernate at `timeTo`. If `action: delete` then it will delete workloads at `timeFrom` and `timeTo`. Here the `action:scale` thus it scale the number of resource replicas to `targetReplicas: [1,1,1]`. Here each element of `targetReplicas` array is mapped with the corresponding elments of array `timeRangesWithZone/timeRanges`. Thus make sure the length of both array is equal, otherwise the cnages cannot be observed. + +The above example will select the application objects which have been created 10 hours ago across all namespaces excluding application's namespace. Winter soldier exposes following functions to handle time, cpu and memory. + +- ParseTime - This function can be used to parse time. For eg to parse creationTimestamp use ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z') +- AddTime - This can be used to add time. For eg AddTime(ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '-10h') ll add 10h to the time. Use d for day, h for hour, m for minutes and s for seconds. Use negative number to get earlier time. +- Now - This can be used to get current time. +- CpuToNumber - This can be used to compare CPU. For eg any({{spec.containers.#.resources.requests}}, { MemoryToNumber(.memory) < MemoryToNumber('60Mi')}) will check if any resource.requests is less than 60Mi. + + + +### Resources + +These define minimum and maximum RAM and CPU available to the application. + +```yaml +resources: + limits: + cpu: "1" + memory: "200Mi" + requests: + cpu: "0.10" + memory: "100Mi" +``` + +Resources are required to set CPU and memory usage. + +#### Limits + +Limits make sure a container never goes above a certain value. The container is only allowed to go up to the limit, and then it is restricted. + +#### Requests + +Requests are what the container is guaranteed to get. + +### Service + +This defines annotations and the type of service, optionally can define name also. + +```yaml + service: + type: ClusterIP + annotations: {} +``` + +### Volumes + +```yaml +volumes: + - name: log-volume + emptyDir: {} + - name: logpv + persistentVolumeClaim: + claimName: logpvc +``` + +It is required when some values need to be read from or written to an external disk. + +### Volume Mounts + +```yaml +volumeMounts: + - mountPath: /var/log/nginx/ + name: log-volume + - mountPath: /mnt/logs + name: logpvc + subPath: employee +``` + +It is used to provide mounts to the volume. + +### Affinity and anti-affinity + +```yaml +Spec: + Affinity: + Key: + Values: +``` + +Spec is used to define the desire state of the given container. + +Node Affinity allows you to constrain which nodes your pod is eligible to schedule on, based on labels of the node. + +Inter-pod affinity allow you to constrain which nodes your pod is eligible to be scheduled based on labels on pods. + +#### Key + +Key part of the label for node selection, this should be same as that on node. Please confirm with devops team. + +#### Values + +Value part of the label for node selection, this should be same as that on node. Please confirm with devops team. + +### Tolerations + +```yaml +tolerations: + - key: "key" + operator: "Equal" + value: "value" + effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" +``` + +Taints are the opposite, they allow a node to repel a set of pods. + +A given pod can access the given node and avoid the given taint only if the given pod satisfies a given taint. + +Taints and tolerations are a mechanism which work together that allows you to ensure that pods are not placed on inappropriate nodes. Taints are added to nodes, while tolerations are defined in the pod specification. When you taint a node, it will repel all the pods except those that have a toleration for that taint. A node can have one or many taints associated with it. + +### Arguments + +```yaml +args: + enabled: false + value: [] +``` + +This is used to give arguments to command. + +### Command + +```yaml +command: + enabled: false + value: [] +``` + +It contains the commands for the server. + +| Key | Description | +| :--- | :--- | +| `enabled` | To enable or disable the command. | +| `value` | It contains the commands. | + + +### Containers +Containers section can be used to run side-car containers along with your main container within same pod. Containers running within same pod can share volumes and IP Address and can address each other @localhost. We can use base image inside container by setting the reuseContainerImage flag to `true`. + +```yaml + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 + command: ["/usr/local/bin/nginx"] + args: ["-g", "daemon off;"] + - reuseContainerImage: true + securityContext: + runAsUser: 1000 + runAsGroup: 3000 + fsGroup: 2000 + volumeMounts: + - mountPath: /etc/ls-oms + name: ls-oms-cm-vol + command: + - flyway + - -configFiles=/etc/ls-oms/flyway.conf + - migrate +``` + +### Prometheus + +```yaml + prometheus: + release: monitoring +``` + +It is a kubernetes monitoring tool and the name of the file to be monitored as monitoring in the given case.It describes the state of the prometheus. + +### rawYaml + +```yaml +rawYaml: + - apiVersion: v1 + kind: Service + metadata: + name: my-service + spec: + selector: + app: MyApp + ports: + - protocol: TCP + port: 80 + targetPort: 9376 + type: ClusterIP +``` +Accepts an array of Kubernetes objects. You can specify any kubernetes yaml here and it will be applied when your app gets deployed. + +### Grace Period + +```yaml +GracePeriod: 30 +``` +Kubernetes waits for the specified time called the termination grace period before terminating the pods. By default, this is 30 seconds. If your pod usually takes longer than 30 seconds to shut down gracefully, make sure you increase the `GracePeriod`. + +A Graceful termination in practice means that your application needs to handle the SIGTERM message and begin shutting down when it receives it. This means saving all data that needs to be saved, closing down network connections, finishing any work that is left, and other similar tasks. + +There are many reasons why Kubernetes might terminate a perfectly healthy container. If you update your deployment with a rolling update, Kubernetes slowly terminates old pods while spinning up new ones. If you drain a node, Kubernetes terminates all pods on that node. If a node runs out of resources, Kubernetes terminates pods to free those resources. It’s important that your application handle termination gracefully so that there is minimal impact on the end user and the time-to-recovery is as fast as possible. + + +### Server + +```yaml +server: + deployment: + image_tag: 1-95a53 + image: "" +``` + +It is used for providing server configurations. + +#### Deployment + +It gives the details for deployment. + +| Key | Description | +| :--- | :--- | +| `image_tag` | It is the image tag | +| `image` | It is the URL of the image | + +### Service Monitor + +```yaml +servicemonitor: + enabled: true + path: /abc + scheme: 'http' + interval: 30s + scrapeTimeout: 20s + metricRelabelings: + - sourceLabels: [namespace] + regex: '(.*)' + replacement: myapp + targetLabel: target_namespace +``` + +It gives the set of targets to be monitored. + +### Db Migration Config + +```yaml +dbMigrationConfig: + enabled: false +``` + +It is used to configure database migration. + + +### KEDA Autoscaling +[KEDA](https://keda.sh) is a Kubernetes-based Event Driven Autoscaler. With KEDA, you can drive the scaling of any container in Kubernetes based on the number of events needing to be processed. KEDA can be installed into any Kubernetes cluster and can work alongside standard Kubernetes components like the Horizontal Pod Autoscaler(HPA). + +Example for autosccaling with KEDA using Prometheus metrics is given below: +```yaml +kedaAutoscaling: + enabled: true + minReplicaCount: 1 + maxReplicaCount: 2 + idleReplicaCount: 0 + pollingInterval: 30 + advanced: + restoreToOriginalReplicaCount: true + horizontalPodAutoscalerConfig: + behavior: + scaleDown: + stabilizationWindowSeconds: 300 + policies: + - type: Percent + value: 100 + periodSeconds: 15 + triggers: + - type: prometheus + metadata: + serverAddress: http://:9090 + metricName: http_request_total + query: envoy_cluster_upstream_rq{appId="300", cluster_name="300-0", container="envoy",} + threshold: "50" + triggerAuthentication: + enabled: false + name: + spec: {} + authenticationRef: {} +``` +Example for autosccaling with KEDA based on kafka is given below : +```yaml +kedaAutoscaling: + enabled: true + minReplicaCount: 1 + maxReplicaCount: 2 + idleReplicaCount: 0 + pollingInterval: 30 + advanced: {} + triggers: + - type: kafka + metadata: + bootstrapServers: b-2.kafka-msk-dev.example.c2.kafka.ap-southeast-1.amazonaws.com:9092,b-3.kafka-msk-dev.example.c2.kafka.ap-southeast-1.amazonaws.com:9092,b-1.kafka-msk-dev.example.c2.kafka.ap-southeast-1.amazonaws.com:9092 + topic: Orders-Service-ESP.info + lagThreshold: "100" + consumerGroup: oders-remove-delivered-packages + allowIdleConsumers: "true" + triggerAuthentication: + enabled: true + name: keda-trigger-auth-kafka-credential + spec: + secretTargetRef: + - parameter: sasl + name: keda-kafka-secrets + key: sasl + - parameter: username + name: keda-kafka-secrets + key: username + authenticationRef: + name: keda-trigger-auth-kafka-credential +``` + +### Security Context +A security context defines privilege and access control settings for a Pod or Container. + +To add a security context for main container: +```yaml +containerSecurityContext: + allowPrivilegeEscalation: false +``` + +To add a security context on pod level: +```yaml +podSecurityContext: + runAsUser: 1000 + runAsGroup: 3000 + fsGroup: 2000 +``` + +### Topology Spread Constraints +You can use topology spread constraints to control how Pods are spread across your cluster among failure-domains such as regions, zones, nodes, and other user-defined topology domains. This can help to achieve high availability as well as efficient resource utilization. + +```yaml +topologySpreadConstraints: + - maxSkew: 1 + topologyKey: zone + whenUnsatisfiable: DoNotSchedule + autoLabelSelector: true + customLabelSelector: {} +``` + +### Deployment Metrics + +It gives the realtime metrics of the deployed applications + +| Key | Description | +| :--- | :--- | +| `Deployment Frequency` | It shows how often this app is deployed to production | +| `Change Failure Rate` | It shows how often the respective pipeline fails. | +| `Mean Lead Time` | It shows the average time taken to deliver a change to production. | +| `Mean Time to Recovery` | It shows the average time taken to fix a failed pipeline. | + +## 2. Show application metrics + +If you want to see application metrics like different HTTP status codes metrics, application throughput, latency, response time. Enable the Application metrics from below the deployment template Save button. After enabling it, you should be able to see all metrics on App detail page. By default it remains disabled. +![](../../../.gitbook/assets/deployment_application_metrics%20%282%29.png) + +Once all the Deployment template configurations are done, click on `Save` to save your deployment configuration. Now you are ready to create [Workflow](workflow/) to do CI/CD. + +### Helm Chart Json Schema + +Helm Chart [json schema](../../../scripts/devtron-reference-helm-charts/reference-chart_4-11-0/schema.json) is used to validate the deployment template values. + +### Other Validations in Json Schema + +The values of CPU and Memory in limits must be greater than or equal to in requests respectively. Similarly, In case of envoyproxy, the values of limits are greater than or equal to requests as mentioned below. +``` +resources.limits.cpu >= resources.requests.cpu +resources.limits.memory >= resources.requests.memory +envoyproxy.resources.limits.cpu >= envoyproxy.resources.requests.cpu +envoyproxy.resources.limits.memory >= envoyproxy.resources.requests.memory +``` diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/app-values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/app-values.yaml new file mode 100644 index 0000000000..d579b2259d --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/app-values.yaml @@ -0,0 +1,448 @@ +# Mandatory configs +podDisruptionBudget: {} +rolloutLabels: {} +rolloutAnnotations: {} + +containerSpec: + lifecycle: + enabled: false + preStop: + exec: + command: ["sleep","10"] + postStart: + httpGet: + host: example.com + path: /example + port: 90 + +replicaCount: 1 +MinReadySeconds: 60 +GracePeriod: 30 +image: + pullPolicy: IfNotPresent +restartPolicy: Always +service: + # enabled: true + type: ClusterIP + #name: "service-1234567890" + loadBalancerSourceRanges: [] + # loadBalancerSourceRanges: + # - 1.2.3.4/32 + # - 1.2.5.6/23 + annotations: {} + # test1: test2 + # test3: test4 +ContainerPort: + - name: app + port: 8080 + servicePort: 80 + envoyPort: 8799 + useHTTP2: false + supportStreaming: false + idleTimeout: 1800s + protocol: TCP + resizePolicy: [] +# servicemonitor: +# enabled: true +# path: /abc +# scheme: 'http' +# interval: 30s +# scrapeTimeout: 20s +# metricRelabelings: +# - sourceLabels: [namespace] +# regex: '(.*)' +# replacement: myapp +# targetLabel: target_namespace +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: + cpu: 1 + memory: 200Mi + requests: + cpu: 0.10 + memory: 100Mi + +# Optional configs +LivenessProbe: + Path: "" + port: 8080 + scheme: "" + httpHeaders: [] +# - name: Custom-Header +# value: abc + tcp: false + command: [] + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + +ReadinessProbe: + Path: "" + port: 8080 + scheme: "" + httpHeaders: [] +# - name: Custom-Header +# value: abc + tcp: false + command: [] + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + +StartupProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: [] + command: [] + tcp: false + +ingress: + enabled: false + className: "" + labels: {} + annotations: {} +# nginx.ingress.kubernetes.io/force-ssl-redirect: 'false' +# nginx.ingress.kubernetes.io/ssl-redirect: 'false' +# kubernetes.io/ingress.class: nginx +# nginx.ingress.kubernetes.io/rewrite-target: /$2 +# nginx.ingress.kubernetes.io/canary: "true" +# nginx.ingress.kubernetes.io/canary-weight: "10" + + hosts: + - host: chart-example1.local + pathType: "ImplementationSpecific" + paths: + - /example1 + - host: chart-example2.local + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +ingressInternal: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + # nginx.ingress.kubernetes.io/canary: "true" + # nginx.ingress.kubernetes.io/canary-weight: "10" + + hosts: + - host: chart-example1.internal + pathType: "ImplementationSpecific" + paths: + - /example1 + - host: chart-example2.internal + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +command: + workingDir: {} + enabled: false + value: [] + +args: + enabled: false + value: + - /bin/sh + - -c + - touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600 + +#For adding custom labels to pods + +podLabels: {} +# customKey: customValue +podAnnotations: {} +# customKey: customValue + +rawYaml: [] + +topologySpreadConstraints: [] + +initContainers: [] + ## Additional init containers to run before the Scheduler pods. + ## for example, be used to run a sidecar that chown Logs storage . + #- name: volume-mount-hack + # image: busybox + # command: ["sh", "-c", "chown -R 1000:1000 logs"] + # volumeMounts: + # - mountPath: /usr/local/airflow/logs + # name: logs-data + +containers: [] + ## Additional containers to run along with application pods. + ## for example, be used to run a sidecar that chown Logs storage . + #- name: volume-mount-hack + # image: busybox + # command: ["sh", "-c", "chown -R 1000:1000 logs"] + # volumeMounts: + # - mountPath: /usr/local/airflow/logs + # name: logs-data + +volumeMounts: [] +# - name: log-volume +# mountPath: /var/log + +volumes: [] +# - name: log-volume +# emptyDir: {} + +dbMigrationConfig: + enabled: false + +tolerations: [] + +podSecurityContext: {} + +containerSecurityContext: {} + +Spec: + Affinity: + Key: + # Key: kops.k8s.io/instancegroup + Values: + +affinity: + enabled: false + values: {} + +ambassadorMapping: + enabled: false + labels: {} + prefix: / + ambassadorId: "" + hostname: devtron.example.com + rewrite: "" + retryPolicy: {} + cors: {} + tls: + context: "" + create: false + secretName: "" + hosts: [] + +autoscaling: + enabled: false + MinReplicas: 1 + MaxReplicas: 2 + TargetCPUUtilizationPercentage: 70 + TargetMemoryUtilizationPercentage: 80 + annotations: {} + labels: {} + behavior: {} + containerResource: + enabled: false + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 +# scaleDown: +# stabilizationWindowSeconds: 300 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# scaleUp: +# stabilizationWindowSeconds: 0 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# - type: Pods +# value: 4 +# periodSeconds: 15 +# selectPolicy: Max + + extraMetrics: [] +# - external: +# metricName: pubsub.googleapis.com|subscription|num_undelivered_messages +# metricSelector: +# matchLabels: +# resource.labels.subscription_id: echo-read +# targetAverageValue: "2" +# type: External +# + +kedaAutoscaling: + enabled: false + envSourceContainerName: "" # Optional. Default: .spec.template.spec.containers[0] + minReplicaCount: 1 + maxReplicaCount: 2 + advanced: {} + triggers: [] + triggerAuthentication: + enabled: false + name: "" + spec: {} + authenticationRef: {} + +prometheus: + release: monitoring + +server: + deployment: + image_tag: 1-95af053 + image: "" + +servicemonitor: + additionalLabels: {} + +envoyproxy: + image: quay.io/devtron/envoy:v1.16.0 + configMapName: "" + lifecycle: {} + resources: + limits: + cpu: 50m + memory: 50Mi + requests: + cpu: 50m + memory: 50Mi + +istio: + enable: false + gateway: + enabled: false + labels: {} + annotations: {} + selector: {} + gatewayExtraSpec: {} + host: "example.com" + tls: + enabled: false + secretName: secret-name + virtualService: + enabled: false + labels: {} + annotations: {} + virtualServiceExtraSpec: {} + gateways: [] + hosts: [] + http: [] + # - match: + # - uri: + # prefix: /v1 + # - uri: + # prefix: /v2 + # timeout: 12 + # headers: + # request: + # add: + # x-some-header: "value" + # retries: + # attempts: 2 + # perTryTimeout: 3s + destinationRule: + enabled: false + labels: {} + annotations: {} + subsets: [] + trafficPolicy: {} + peerAuthentication: + enabled: false + labels: {} + annotations: {} + selector: + enabled: false + mtls: + mode: "" + portLevelMtls: {} + requestAuthentication: + enabled: false + labels: {} + annotations: {} + selector: + enabled: false + jwtRules: [] + authorizationPolicy: + enabled: false + labels: {} + annotations: {} + action: + provider: {} + rules: [] + +networkPolicy: + enabled: false + annotations: {} + labels: {} + podSelector: + matchExpressions: [] + matchLabels: {} + policyTypes: [] + ingress: [] + egress: [] + +winterSoldier: + enabled: false + apiVersion: pincher.devtron.ai/v1alpha1 + annotation: {} + labels: {} + type: Rollout + timeRangesWithZone: + timeZone: "Asia/Kolkata" + timeRanges: [] + action: sleep + targetReplicas: [] + fieldSelector: + - AfterTime(AddTime(ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '5m'), Now()) + + + + +## Pods Service Account +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ +## +serviceAccount: + ## @param serviceAccount.create Enable creation of ServiceAccount for pods + ## + create: false + ## @param serviceAccount.name The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the `.Chart.Name .fullname` template + name: "" + ## @param serviceAccount.annotations Annotations for service account. Evaluated as a template. + ## Only used if `create` is `true`. + ## + annotations: {} + +imagePullSecrets: [] + # - test1 + # - test2 +hostAliases: [] +# - ip: "127.0.0.1" +# hostnames: +# - "foo.local" +# - "bar.local" +# - ip: "10.1.2.3" +# hostnames: +# - "foo.remote" +# - "bar.remote" +peristentVolumeClaim: {} + +analysisTemplate: + enabled: false + templates: [] + +verticalPodScaling: + enabled: false diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/env-values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/env-values.yaml new file mode 100644 index 0000000000..5cd07c0269 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/env-values.yaml @@ -0,0 +1,66 @@ +replicaCount: 1 +MaxSurge: 1 +MaxUnavailable: 0 +GracePeriod: 30 +pauseForSecondsBeforeSwitchActive: 30 +waitForSecondsBeforeScalingDown: 30 + +Spec: + Affinity: + key: "" + Values: nodes + +autoscaling: + enabled: false + MinReplicas: 1 + MaxReplicas: 2 + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 + behavior: {} +# scaleDown: +# stabilizationWindowSeconds: 300 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# scaleUp: +# stabilizationWindowSeconds: 0 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# - type: Pods +# value: 4 +# periodSeconds: 15 +# selectPolicy: Max + extraMetrics: [] +# - external: +# metricName: pubsub.googleapis.com|subscription|num_undelivered_messages +# metricSelector: +# matchLabels: +# resource.labels.subscription_id: echo-read +# targetAverageValue: "2" +# type: External +# +secret: + enabled: false + data: {} +# my_own_secret: S3ViZXJuZXRlcyBXb3Jrcw== + +EnvVariables: [] +# - name: FLASK_ENV +# value: qa + +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: + cpu: "0.05" + memory: 50Mi + requests: + cpu: "0.01" + memory: 10Mi + + diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/pipeline-values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/pipeline-values.yaml new file mode 100644 index 0000000000..da8360dd02 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/pipeline-values.yaml @@ -0,0 +1,26 @@ +deployment: + strategy: + blueGreen: + autoPromotionSeconds: 30 + scaleDownDelaySeconds: 30 + previewReplicaCount: 1 + autoPromotionEnabled: true + rolling: + maxSurge: "25%" + maxUnavailable: 1 + canary: + maxSurge: "25%" + maxUnavailable: 1 + steps: + - setWeight: 25 + - pause: + duration: 15 # 1 min + - setWeight: 50 + - pause: + duration: 15 # 1 min + - setWeight: 75 + - pause: + duration: 15 # 1 min + recreate: + maxSurge: "0%" + maxUnavailable: "100%" \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/release-values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/release-values.yaml new file mode 100644 index 0000000000..48eb3f482c --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/release-values.yaml @@ -0,0 +1,14 @@ +server: + deployment: + image_tag: IMAGE_TAG + image: IMAGE_REPO + enabled: false +dbMigrationConfig: + enabled: false + +pauseForSecondsBeforeSwitchActive: 0 +waitForSecondsBeforeScalingDown: 0 +autoPromotionSeconds: 30 + +#used for deployment algo selection +orchestrator.deploymant.algo: 1 diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/schema.json b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/schema.json new file mode 100644 index 0000000000..2a43e937cd --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/schema.json @@ -0,0 +1,1363 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "containerExtraSpecs": { + "type": "object", + "title": "containerExtraSpecs", + "description": "Define container extra specs here" + }, + "ContainerPort": { + "type": "array", + "description": "defines ports on which application services will be exposed to other services", + "title": "Container Port", + "items": { + "type": "object", + "properties": { + "envoyPort": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "envoy port for the container", + "title": "Envoy Port" + }, + "idleTimeout": { + "type": "string", + "description": "duration of time for which a connection is idle before the connection is terminated", + "title": "Idle Timeout" + }, + "name": { + "type": "string", + "description": "name of the port", + "title": "Name" + }, + "port": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "Port", + "title": "port for the container" + }, + "servicePort": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "port of the corresponding kubernetes service", + "title": "Service Port" + }, + "nodePort": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "nodeport of the corresponding kubernetes service", + "title": "Node Port" + }, + "supportStreaming": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "field to enable/disable timeout for high performance protocols like grpc", + "title": "Support Streaming" + }, + "useHTTP2": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": " field for setting if envoy container can accept(or not) HTTP2 requests", + "title": "Use HTTP2" + } + } + } + }, + "EnvVariables": { + "type": "array", + "items": {}, + "description": "contains environment variables needed by the containers", + "title": "Environment Variables" + }, + "EnvVariablesFromFieldPath": { + "type": "array", + "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs", + "title": "EnvVariablesFromFieldPath", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "name", + "description": "Env variable name to be" + }, + "fieldPath": { + "type": "string", + "title": "fieldPath", + "description": "Path of the field to select in the specified API version" + } + } + } + ] + }, + "EnvVariablesFromSecretKeys": { + "type": "array", + "description": "Selects a field of the deployment: It is use to get the name of Environment Variable name, Secret name and the Key name from which we are using the value in that corresponding Environment Variable.", + "title": "EnvVariablesFromSecretKeys", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "name", + "description": "Env variable name to be used." + }, + "secretName": { + "type": "string", + "title": "secretName", + "description": "Name of Secret from which we are taking the value." + }, + "keyName": { + "type": "string", + "title": "keyName", + "description": "Name of The Key Where the value is mapped with." + } + } + } + ] + }, + "EnvVariablesFromConfigMapKeys": { + "type": "array", + "description": "Selects a field of the deployment: It is use to get the name of Environment Variable name, Config Map name and the Key name from which we are using the value in that corresponding Environment Variable.", + "title": "EnvVariablesFromConfigMapKeys", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "name", + "description": "Env variable name to be used." + }, + "configMapName": { + "type": "string", + "title": "configMapName", + "description": "Name of configMap from which we are taking the value." + }, + "keyName": { + "type": "string", + "title": "keyName", + "description": "Name of The Key Where the value is mapped with." + } + } + } + ] + }, + "GracePeriod": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "time for which Kubernetes waits before terminating the pods", + "title": "Grace Period" + }, + "LivenessProbe": { + "type": "object", + "description": "used by the kubelet to know when to restart a container", + "title": "Liveness Probe", + "properties": { + "Path": { + "type": "string", + "description": "defines the path where the liveness needs to be checked", + "title": "Path" + }, + "command": { + "type": "array", + "items": {}, + "description": "commands executed to perform a probe", + "title": "Command" + }, + "failureThreshold": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the maximum number of failures that are acceptable before a given container is not considered as live", + "title": "Failure Threshold" + }, + "httpHeaders": { + "type": "array", + "items": {}, + "description": "used to override the default headers by defining .httpHeaders for the probe", + "title": "HTTP headers" + }, + "initialDelaySeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time to wait before a given container is checked for liveness", + "title": "Initial Delay Seconds" + }, + "periodSeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time to check a given container for liveness", + "title": "Period Seconds" + }, + "port": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "port to access on the container", + "title": "Port" + }, + "scheme": { + "type": "string", + "description": "Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP.", + "title": "Scheme" + }, + "successThreshold": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the number of successes required before a given container is said to fulfil the liveness probe", + "title": "Success Threshold" + }, + "tcp": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "If enabled, the kubelet will attempt to open a socket to container. If connection is established, the container is considered healthy", + "title": "TCP" + }, + "timeoutSeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time for checking timeout", + "title": "Timeout Seconds" + } + } + }, + "MaxSurge": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "maximum number of pods that can be created over the desired number of pods", + "title": "Maximum Surge" + }, + "MaxUnavailable": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "maximum number of pods that can be unavailable during the update process", + "title": "Maximum Unavailable" + }, + "MinReadySeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available", + "title": "Minimum Ready Seconds" + }, + "ReadinessProbe": { + "type": "object", + "description": "kubelet uses readiness probes to know when a container is ready to start accepting traffic", + "title": "Readiness Probe", + "properties": { + "Path": { + "type": "string", + "description": "defines the path where the readiness needs to be checked", + "title": "Path" + }, + "command": { + "type": "array", + "items": {}, + "description": "commands executed to perform a probe", + "title": "Command" + }, + "failureThreshold": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the maximum number of failures that are acceptable before a given container is not considered as ready", + "title": "Failure Threshold" + }, + "httpHeader": { + "type": "array", + "items": {}, + "description": "used to override the default headers by defining .httpHeaders for the probe", + "title": "HTTP headers" + }, + "initialDelaySeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time to wait before a given container is checked for readiness", + "title": "Initial Delay Seconds" + }, + "periodSeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time to check a given container for readiness", + "title": "Period Seconds" + }, + "port": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "port to access on the container", + "title": "Port" + }, + "scheme": { + "type": "string", + "description": "Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP.", + "title": "Scheme" + }, + "successThreshold": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the number of successes required before a given container is said to fulfil the readiness probe", + "title": "Success Threshold" + }, + "tcp": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "If enabled, the kubelet will attempt to open a socket to container. If connection is established, the container is considered healthy", + "title": "TCP" + }, + "timeoutSeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time for checking timeout", + "title": "Timeout Seconds" + } + } + }, + "Spec": { + "type": "object", + "description": "used to define the desire state of the given container", + "title": "Spec", + "properties": { + "Affinity": { + "type": "object", + "description": "Node/Inter-pod Affinity allows you to constrain which nodes your pod is eligible to schedule on, based on labels of the node/pods", + "title": "Affinity", + "properties": { + "Key": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "string", + "description": "Key part of the label for node/pod selection", + "title": "Key" + } + ] + }, + "Values": { + "type": "string", + "description": "Value part of the label for node/pod selection", + "title": "Values" + }, + "key": { + "type": "string" + } + } + } + } + }, + "ambassadorMapping": { + "type": "object", + "description": "used to create ambassador mapping resource", + "title": "Mapping", + "properties": { + "ambassadorId": { + "type": "string", + "description": "used to specify id for specific ambassador mappings controller", + "title": "Ambassador ID" + }, + "cors": { + "type": "object", + "description": "used to specify cors policy to access host for this mapping", + "title": "CORS" + }, + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used to specify whether to create an ambassador mapping or not", + "title": "Enabled" + }, + "weight": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used to specify weight for canary ambassador mappings" + }, + "hostname": { + "type": "string", + "description": "used to specify hostname for ambassador mapping", + "title": "Hostname" + }, + "labels": { + "type": "object", + "description": "used to provide custom labels for ambassador mapping", + "title": "Labels" + }, + "prefix": { + "type": "string", + "description": "used to specify path for ambassador mapping", + "title": "Prefix" + }, + "retryPolicy": { + "type": "object", + "description": "used to specify retry policy for ambassador mapping", + "title": "Retry Policy" + }, + "rewrite": { + "type": "string", + "description": "used to specify whether to redirect the path of this mapping and where", + "title": "Rewrite" + }, + "tls": { + "type": "object", + "description": "used to create or define ambassador TLSContext resource", + "title": "TLS Context" + }, + "extraSpec": { + "type": "object", + "description": "used to provide extra spec values which not present in deployment template for ambassador resource", + "title": "Extra Spec" + } + } + }, + "args": { + "type": "object", + "description": " used to give arguments to command", + "title": "Arguments", + "properties": { + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used for enabling/disabling aruguments", + "title": "Enabled" + }, + "value": { + "type": "array", + "description": "values of the arguments", + "title": "Value", + "items": [ + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ] + } + } + }, + "autoscaling": { + "type": "object", + "description": "connected to HPA and controls scaling up and down in response to request load", + "title": "Autoscaling", + "properties": { + "MaxReplicas": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "Maximum number of replicas allowed for scaling", + "title": "Maximum Replicas" + }, + "MinReplicas": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "Minimum number of replicas allowed for scaling", + "title": "Minimum Replicas" + }, + "TargetCPUUtilizationPercentage": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "The target CPU utilization that is expected for a container", + "title": "TargetCPUUtilizationPercentage" + }, + "TargetMemoryUtilizationPercentage": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "The target memory utilization that is expected for a container", + "title": "TargetMemoryUtilizationPercentage" + }, + "behavior": { + "type": "object", + "description": "describes behavior and scaling policies for that behavior", + "title": "Behavior" + }, + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used for enabling/disabling autoscaling", + "title": "Enabled" + }, + "labels": { + "type": "object", + "description": "labels for HPA", + "title": "labels" + }, + "annotations": { + "type": "object", + "description": "used to configure some options for HPA", + "title": "annotations" + }, + "extraMetrics": { + "type": "array", + "items": {}, + "description": "used to give external metrics for autoscaling", + "title": "Extra Metrics" + } + } + }, + "command": { + "type": "object", + "description": "contains the commands for the server", + "title": "Command", + "properties": { + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used for enabling/disabling commands" + }, + "value": { + "type": "array", + "items": {}, + "description": "contains the commands", + "title": "Value" + }, + "workingDir": { + "type": "object", + "items": {}, + "description": "contains the working directory", + "title": "Working directory" + } + } + }, + "containerSecurityContext": { + "type": "object", + "description": " defines privilege and access control settings for a Container", + "title": "Container Security Context" + }, + "containers": { + "type": "array", + "items": {}, + "description": " used to run side-car containers along with the main container within same pod" + }, + "dbMigrationConfig": { + "type": "object", + "description": "used to configure database migration", + "title": "Db Migration Config", + "properties": { + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used for enabling/disabling the config", + "title": "Enabled" + } + } + }, + "envoyproxy": { + "type": "object", + "description": "envoy is attached as a sidecar to the application container to collect metrics like 4XX, 5XX, throughput and latency", + "title": "Envoy Proxy", + "properties": { + "configMapName": { + "type": "string", + "description": "configMap containing configuration for Envoy", + "title": "ConfigMap" + }, + "lifecycle": { + "type": "object", + "description": "Actions that the management system should take in response to container lifecycle events", + "title": "lifecycle", + "properties": { + "enabled": { + "type": "boolean" + }, + "postStart": { + "type": "object", + "title": "postStart", + "description": "PostStart is called immediately after a container is created" + }, + "preStop": { + "type": "object", + "title": "preStop", + "description": "PreStop is called immediately before a container is terminated" + } + } + }, + "image": { + "type": "string", + "description": "image of envoy to be used" + }, + "resources": { + "type": "object", + "description": "minimum and maximum RAM and CPU available to the application", + "title": "Resources", + "properties": { + "limits": { + "type": "object", + "description": "the maximum values a container can reach", + "title": "Limits", + "properties": { + "cpu": { + "type": "string", + "format": "cpu", + "description": "limit of CPU", + "title": "CPU" + }, + "memory": { + "type": "string", + "format": "memory", + "description": "limit of memory", + "title": "Memory" + } + } + }, + "requests": { + "type": "object", + "description": "request is what the container is guaranteed to get", + "title": "Requests", + "properties": { + "cpu": { + "type": "string", + "format": "cpu", + "description": "request value of CPU", + "title": "CPU" + }, + "memory": { + "type": "string", + "format": "memory", + "description": "request value of memory", + "title": "Memory" + } + } + } + } + } + } + }, + "hostAliases": { + "type": "array", + "title": "hostAliases", + "description": "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file", + "items": [ + { + "type": "object", + "properties": { + "ip": { + "type": "string", + "title": "IP", + "description": "IP address of the host file entry" + }, + "hostnames": { + "type": "array", + "description": "Hostnames for the above IP address", + "items": [ + { + "type": "string" + } + ] + } + } + } + ] + }, + "image": { + "type": "object", + "description": "used to access images in kubernetes", + "title": "Image", + "properties": { + "pullPolicy": { + "type": "string", + "description": "used to define the instances calling the image", + "title": "Pull Policy", + "enum": [ + "IfNotPresent", + "Always" + ] + } + } + }, + "restartPolicy": { + "type": "string", + "description": "It restarts the docker container based on defined conditions.", + "title": "Restart Policy", + "enum": [ + "Always", + "OnFailure", + "Never" + ] + }, + "imagePullSecrets": { + "type": "array", + "items": {}, + "description": "contains the docker credentials that are used for accessing a registry", + "title": "Image PullSecrets" + }, + "winterSoldier": { + "type": "object", + "description": "allows to scale, sleep or delete the resource based on time.", + "title": "winterSoldier", + "properties": { + "annotations": { + "type": "object", + "description": "used to configure some options depending on the winterSoldier controller", + "title": "Annotations" + }, + "labels": { + "type": "object", + "description": "labels for winterSoldier", + "title": "winterSoldier labels", + "default": "" + }, + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used to enable or disable ingress", + "title": "Enabled" + }, + "apiVersion": { + "type": "string", + "description": "Api version for winterSoldier", + "title": "winterSoldier apiVersion", + "default": "pincher.devtron.ai/v1alpha1" + }, + "timeRangesWithZone": { + "type": "object", + "description": "describe time zone and time ranges to input in the winterSoldier", + "title": "Time Ranges With Zone", + "timeZone": { + "type": "string", + "description": "describe time zone, and follow standard format", + "title": "Time Zone" + }, + "timeRanges": { + "type": "array", + "items": {}, + "description": "used to take array of time ranges in which each element contains timeFrom, timeTo, weekdayFrom and weekdayTo.", + "title": "Time Ranges" + } + }, + "type": { + "type": "string", + "description": "describe the type of application Rollout/deployment.", + "title": "Type" + }, + "action": { + "type": "string", + "description": "describe the action to be performed by winterSoldier.", + "title": "Action" + }, + "targetReplicas": { + "type": "array", + "description": "describe the number of replicas to which the resource should scale up or down.", + "title": "Target Replicas" + }, + "fieldSelector": { + "type": "array", + "description": "it takes arrays of methods to select specific fields.", + "title": "Field Selector" + } + } + }, + "ingress": { + "type": "object", + "description": "allows public access to URLs", + "title": "Ingress", + "properties": { + "annotations": { + "type": "object", + "description": "used to configure some options depending on the Ingress controller", + "title": "Annotations" + }, + "className": { + "type": "string", + "description": "name of ingress class, a reference to an IngressClass resource that contains additional configuration including the name of the controller", + "title": "Ingress class name", + "default": "nginx" + }, + "labels": { + "type": "object", + "description": "labels for ingress", + "title": "Ingress labels", + "default": "" + }, + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used to enable or disable ingress", + "title": "Enabled" + }, + "hosts": { + "type": "array", + "description": "list of hosts in ingress", + "title": "Hosts", + "items": [ + { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "host URL", + "title": "Host" + }, + "pathType": { + "type": "string", + "description": "type of path", + "title": "PathType" + }, + "paths": { + "type": "array", + "description": "list of paths for a given host", + "title": "Paths", + "items": [ + { + "type": "string" + } + ] + } + } + } + ] + }, + "tls": { + "type": "array", + "items": {}, + "description": "contains security details - private key and certificate", + "title": "TLS" + } + } + }, + "ingressInternal": { + "type": "object", + "description": "allows private access to the URLs", + "properties": { + "annotations": { + "type": "object", + "description": "used to configure some options depending on the Ingress controller", + "title": "Annotations" + }, + "className": { + "type": "string", + "description": "name of ingress class, a reference to an IngressClass resource that contains additional configuration including the name of the controller", + "title": "Ingress class name", + "default": "nginx-internal" + }, + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used to enable or disable ingress", + "title": "Enabled" + }, + "hosts": { + "type": "array", + "description": "list of hosts in ingress", + "title": "Hosts", + "items": [ + { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "host URL", + "title": "Host" + }, + "pathType": { + "type": "string", + "description": "type of path", + "title": "PathType" + }, + "paths": { + "type": "array", + "description": "list of paths for a given host", + "title": "Paths", + "items": [ + { + "type": "string" + } + ] + } + } + } + ] + }, + "tls": { + "type": "array", + "items": {}, + "description": "contains security details - private key and certificate", + "title": "TLS" + } + } + }, + "networkPolicy":{ + "type": "object", + "description": "NetworkPolicy describes what network traffic is allowed for a set of Pods", + "title": "Network Policy", + "properties": { + "enabled":{ + "type":"boolean", + "description": "used to enable or disable NetworkPolicy" + }, + "annotations":{ + "type": "object", + "description": "Annotations for NetworkPolicy" + }, + "labels":{ + "type":"object", + "description": "Labels for NetworkPolicy" + }, + "podSelector":{ + "type": "object", + "description": "Selects the pods to which this NetworkPolicy object applies", + "properties": { + "matchExpressions":{ + "type":"array", + "description": "list of label selector" + }, + "matchLabels":{ + "type":"object", + "description": "map of {key,value} pairs" + } + } + }, + "policyTypes":{ + "type":"array", + "description": "List of rule types that the NetworkPolicy relates to. Valid options are Ingress,Egress." + }, + "ingress":{ + "type":"array", + "description": "List of ingress rules to be applied to the selected pods" + }, + "egress":{ + "type":"array", + "description": "List of egress rules to be applied to the selected pods" + } + } + }, + "istio":{ + "type": "object", + "description": "Istio Service mesh", + "title": "Istio" + }, + "initContainers": { + "type": "array", + "items": {}, + "description": "specialized containers that run before app containers in a Pod, can contain utilities or setup scripts not present in an app image", + "title": "Init Containers" + }, + "kedaAutoscaling": { + "type": "object", + "description": "Kubernetes-based event driven autoscaler. With KEDA, one can drive the scaling of any container in Kubernetes based on the no. of events needing to be processed", + "title": "KEDA Autoscaling", + "properties": { + "advanced": { + "type": "object" + }, + "authenticationRef": { + "type": "object" + }, + "enabled": { + "type": "boolean" + }, + "envSourceContainerName": { + "type": "string" + }, + "maxReplicaCount": { + "type": "integer" + }, + "minReplicaCount": { + "type": "integer" + }, + "triggerAuthentication": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "spec": { + "type": "object" + } + } + }, + "triggers": { + "type": "array", + "items": {} + } + } + }, + "containerSpec": { + "type": "object", + "description": "define the container specic configuration", + "title": "containerSpec", + "properties": { + "lifecycle": { + "type": "object", + "description": "Actions that the management system should take in response to container lifecycle events", + "title": "lifecycle", + "properties": { + "enabled": { + "type": "boolean" + }, + "postStart": { + "type": "object", + "title": "postStart", + "description": "PostStart is called immediately after a container is created.You could use this event to check that a required API is available before the container’s main work begins" + }, + "preStop": { + "type": "object", + "title": "preStop", + "description": "PreStop is called immediately before a container is terminated" + } + } + } + } + }, + "pauseForSecondsBeforeSwitchActive": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "tell how much to wait for given period of time before switch active the container", + "title": "Pause For Seconds Before SwitchActive" + }, + "podAnnotations": { + "type": "object", + "description": "used to attach metadata and configs in Kubernetes", + "title": "Pod Annotations" + }, + "podDisruptionBudget": { + "type": "object", + "description": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods", + "properties": { + "minAvailable": { + "type": "string", + "title": "minAvailable", + "description": "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod" + }, + "maxUnavailable": { + "type": "string", + "title": "maxUnavailable", + "description": "An eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod." + } + } + }, + "podExtraSpecs": { + "type": "object", + "description": "ExtraSpec for the pods to be configured", + "title": "podExtraSpecs" + }, + "podLabels": { + "type": "object", + "description": "key/value pairs that are attached to pods, are intended to be used to specify identifying attributes of objects that are meaningful and relevant to users, but do not directly imply semantics to the core system", + "title": "Pod Labels" + }, + "podSecurityContext": { + "type": "object", + "description": "defines privilege and access control settings for a Pod or Container", + "title": "Pod Security Context" + }, + "prometheus": { + "type": "object", + "description": "a kubernetes monitoring tool", + "title": "Prometheus", + "properties": { + "release": { + "type": "string", + "description": "name of the file to be monitored, describes the state of prometheus" + } + } + }, + "rawYaml": { + "type": "array", + "items": {}, + "description": "Accepts an array of Kubernetes objects. One can specify any kubernetes yaml here & it will be applied when a app gets deployed.", + "title": "Raw YAML" + }, + "replicaCount": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "count of Replicas of pod", + "title": "REplica Count" + }, + "resources": { + "type": "object", + "description": "minimum and maximum RAM and CPU available to the application", + "title": "Resources", + "properties": { + "limits": { + "type": "object", + "description": "the maximum values a container can reach", + "title": "Limits", + "properties": { + "cpu": { + "type": "string", + "format": "cpu", + "description": "limit of CPU", + "title": "CPU" + }, + "memory": { + "type": "string", + "format": "memory", + "description": "limit of memory", + "title": "Memory" + } + } + }, + "requests": { + "type": "object", + "description": "request is what the container is guaranteed to get", + "title": "Requests", + "properties": { + "cpu": { + "type": "string", + "format": "cpu", + "description": "request value of CPU", + "title": "CPU" + }, + "memory": { + "type": "string", + "format": "memory", + "description": "request value of memory", + "title": "Memory" + } + } + } + } + }, + "secret": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "enabled": { + "type": "boolean" + } + } + }, + "server": { + "type": "object", + "description": "used for providing server configurations.", + "title": "Server", + "properties": { + "deployment": { + "type": "object", + "description": "gives the details for deployment", + "title": "Deployment", + "properties": { + "image": { + "type": "string", + "description": "URL of the image", + "title": "Image" + }, + "image_tag": { + "type": "string", + "description": "tag of the image", + "title": "Image Tag" + } + } + } + } + }, + "service": { + "type": "object", + "description": "defines annotations and the type of service", + "title": "Service", + "properties": { + "annotations": { + "type": "object", + "title": "Annotations", + "description": "annotations of service" + }, + "type": { + "type": "string", + "description": "type of service", + "title": "Type", + "enum": [ + "ClusterIP", + "LoadBalancer", + "NodePort", + "ExternalName" + ] + }, + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used to enable or disable service", + "title": "Enabled" + } + } + }, + "serviceAccount": { + "type": "object", + "description": "defines service account for pods", + "title": "Service Account", + "properties": { + "annotations": { + "type": "object", + "title": "Annotations", + "description": "annotations of service account" + }, + "name": { + "type": "string", + "description": "name of service account", + "title": "Name" + }, + "create": { + "type": "boolean" + } + } + }, + "servicemonitor": { + "type": "object", + "description": "gives the set of targets to be monitored", + "title": "Service Monitor", + "properties": { + "additionalLabels": { + "type": "object" + } + } + }, + "tolerations": { + "type": "array", + "items": {}, + "description": "a mechanism which work together with Taints which ensures that pods are not placed on inappropriate nodes", + "title": "Tolerations" + }, + "topologySpreadConstraints": { + "type": "array", + "items": {}, + "description": "used to control how Pods are spread across a cluster among failure-domains such as regions, zones, nodes, and other user-defined topology domains", + "title": "Topology Spread Constraints" + }, + "volumeMounts": { + "type": "array", + "items": {}, + "description": "used to provide mounts to the volume", + "title": "Volume Mounts" + }, + "volumes": { + "type": "array", + "items": {}, + "description": "required when some values need to be read from or written to an external disk", + "title": "Volumes" + }, + "waitForSecondsBeforeScalingDown": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "Wait for given period of time before scaling down the container", + "title": "Wait For Seconds Before Scaling Down" + } + } +} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/secrets-test-values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/secrets-test-values.yaml new file mode 100644 index 0000000000..4a20404db8 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/secrets-test-values.yaml @@ -0,0 +1 @@ +{"ConfigSecrets":{"enabled":true,"secrets":[{"data":{"standard_key":"c3RhbmRhcmQtdmFsdWU="},"external":false,"externalType":"","mountPath":"/test","name":"normal-secret","type":"volume"},{"data":{"secret_key":"U0VDUkVUIERBVEE="},"external":true,"externalType":"AWSSecretsManager","mountPath":"","name":"external-secret-3","type":"environment"}]}} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/NOTES.txt b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/NOTES.txt new file mode 100644 index 0000000000..2b14478168 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range $.Values.ingress.paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include ".Chart.Name .fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include ".Chart.Name .fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include ".Chart.Name .fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include ".Chart.Name .name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/_helpers.tpl b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/_helpers.tpl new file mode 100644 index 0000000000..813a7186ff --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/_helpers.tpl @@ -0,0 +1,167 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define ".Chart.Name .name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create service name +*/}} +{{- define ".servicename" -}} +{{- if .Values.service.name -}} +{{- .Values.service.name | trunc 63 | trimSuffix "-" -}} +{{- else if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 55 | trimSuffix "-" -}}-service +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 55 | trimSuffix "-" -}}-service +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 55 | trimSuffix "-" -}}-service +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create preview service name +*/}} +{{- define ".previewservicename" -}} +{{- if .Values.service.name -}} +{{- .Values.service.name | trunc 55 | trimSuffix "-" -}}-preview +{{- else if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 47 | trimSuffix "-" -}}-preview-service +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 47 | trimSuffix "-" -}}-preview-service +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 47 | trimSuffix "-" -}}-preview-service +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define ".Chart.Name .fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define ".Chart.Name .chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define ".Chart.Name .color" -}} +{{- $active0 := (index .Values.server.deployment 0).enabled -}} +{{/* +{{- $active1 := (index .Values.server.deployment 1).enabled -}} +*/}} +{{- $active1 := include "safeenabledcheck" . -}} +{{- $active := and $active0 $active1 -}} +{{- $active -}} +{{- end -}} + +{{- define "safeenabledcheck" -}} +{{- if (eq (len .Values.server.deployment) 2) -}} + {{- if (index .Values.server.deployment 1).enabled -}} + {{- $active := true -}} + {{- $active -}} + {{- else -}} + {{- $active := false -}} + {{- $active -}} + {{- end -}} +{{- else -}} + {{- $active := false -}} + {{- $active -}} +{{- end -}} +{{- end -}} + + +{{- define "isCMVolumeExists" -}} + {{- $isCMVolumeExists := false -}} + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "volume"}} + {{- $isCMVolumeExists = true}} + {{- end }} + {{- end }} + {{- end }} + {{- $isCMVolumeExists -}} +{{- end -}} + +{{- define "isSecretVolumeExists" -}} + {{- $isSecretVolumeExists := false -}} + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "volume"}} + {{- $isSecretVolumeExists = true}} + {{- end }} + {{- end }} + {{- end }} + {{- $isSecretVolumeExists -}} +{{- end -}} + + + + +{{- define "serviceMonitorEnabled" -}} + {{- $SMenabled := false -}} + {{- range .Values.ContainerPort }} + {{- if .servicemonitor }} + {{- if and .servicemonitor.enabled }} + {{- $SMenabled = true -}} + {{- end }} + {{- end }} + {{- end }} + {{- $SMenabled -}} +{{- end -}} + +{{/* Create the name of the service account to use */}} +{{- define "serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include ".Chart.Name .fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{- define "VerticalPodAutoScalingEnabled" -}} + {{- $SMenabled := false -}} + {{- if and .Values.verticalPodScaling.enabled }} + {{- $SMenabled = true -}} + {{- end }} + {{- $SMenabled -}} +{{- end -}} + +{{/* Check for app/release labels in customPodLabels and replace accordingly */}} +{{- define "customPodLabelsContainsApp" -}} + {{- $LabelsContain := false -}} + {{- if hasKey .Values.customPodLabels "app" }} + {{- $LabelsContain = true -}} + {{- end }} + {{- $LabelsContain -}} +{{- end -}} + +{{- define "customPodLabelsContainsRelease" -}} + {{- $LabelsContain := false -}} + {{- if hasKey .Values.customPodLabels "release" }} + {{- $LabelsContain = true -}} + {{- end }} + {{- $LabelsContain -}} +{{- end -}} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/ambassador.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/ambassador.yaml new file mode 100644 index 0000000000..7c374a70e8 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/ambassador.yaml @@ -0,0 +1,86 @@ +{{ $svcName := include ".servicename" . }} +{{ $svcPort := (index .Values.ContainerPort 0).servicePort }} +{{- if $.Values.ambassadorMapping.enabled }} +{{- with $.Values.ambassadorMapping }} +apiVersion: getambassador.io/v3alpha1 +kind: Mapping +metadata: + name: {{ include ".Chart.Name .fullname" $ }}-mapping + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + releaseVersion: {{ $.Values.releaseVersion | quote }} + pipelineName: {{ $.Values.pipelineName }} + {{- if .labels }} +{{ toYaml .labels | nindent 4 }} + {{- end }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + {{- if .ambassadorId }} + ambassador_id: {{ .ambassadorId }} + {{- end }} + {{- if .hostname }} + hostname: {{ .hostname | quote }} + {{- end }} + prefix: {{ .prefix }} + {{- if .rewrite }} + rewrite: {{ .rewrite }} + {{- end }} + service: {{ $svcName }}.{{ $.Release.Namespace }}:{{ $svcPort }} + {{- if .retryPolicy }} + retry_policy: +{{ toYaml .retryPolicy | indent 4 }} + {{- end }} + {{- if .cors }} + cors: +{{ toYaml .cors | indent 4 }} + {{- end }} + {{- if .weight }} + weight: {{ .weight }} + {{- end }} + {{- if .method }} + method: {{ .method }} + {{- end }} + {{- if .extraSpec }} +{{ toYaml .extraSpec | indent 2 }} + {{- end }} + {{- if .tls }} + {{- if .tls.context }} + tls: {{ .tls.context }} +{{- if .tls.create }} +--- +apiVersion: getambassador.io/v3alpha1 +kind: TLSContext +metadata: + name: {{ .tls.context }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + releaseVersion: {{ $.Values.releaseVersion | quote }} + pipelineName: {{ $.Values.pipelineName }} + {{- if .tls.labels }} +{{ toYaml .tls.labels | nindent 4 }} + {{- end }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + {{- if .tls.secretName }} + secret: {{ .tls.secretName }} + {{- end }} + {{- if .tls.hosts }} + hosts: +{{ toYaml .tls.hosts | nindent 4 }} + {{- end }} + {{- if .tls.extraSpec }} +{{ toYaml .tls.extraSpec | indent 2 }} + {{- end }} +{{- end }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/analysis-template.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/analysis-template.yaml new file mode 100644 index 0000000000..53ff5f6909 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/analysis-template.yaml @@ -0,0 +1,34 @@ +{{- if .Values.analysisTemplate.enabled }} +{{- range .Values.analysisTemplate.templates }} +apiVersion: argoproj.io/v1alpha1 +kind: AnalysisTemplate +metadata: + {{- if .annotations }} + annotations: +{{ toYaml .annotations | indent 4 }} + {{- end }} + name: {{ .name }} + labels: + app: {{ template ".Chart.Name .name" $ }} + release: {{ $.Release.Name }} + pipelineName: {{ $.Values.pipelineName }} + {{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} + {{- end }} + {{- if .labels }} +{{ toYaml .labels | indent 4 }} + {{- end }} +spec: + {{- if .args }} + args: +{{ toYaml .args | indent 2 }} + {{- end }} + {{- if .measurementRetention }} + measurementRetention: +{{ toYaml .measurementRetention | indent 2 }} + {{- end }} + metrics: +{{ toYaml .metrics | indent 2 }} +--- +{{- end }} +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/configmap.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/configmap.yaml new file mode 100644 index 0000000000..4e7879665e --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/configmap.yaml @@ -0,0 +1,22 @@ +{{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{if eq .external false}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .name}}-{{ $.Values.app }} + labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +data: +{{ toYaml .data | trim | indent 2 }} + {{- end}} + {{- end}} +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/deployment.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/deployment.yaml new file mode 100644 index 0000000000..6a4db0bb5a --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/deployment.yaml @@ -0,0 +1,761 @@ + {{- $hasCMEnvExists := false -}} + {{- $hasCMVolumeExists := false -}} + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "volume"}} + {{- $hasCMVolumeExists = true}} + {{- end }} + {{- if eq .type "environment"}} + {{- $hasCMEnvExists = true}} + {{- end }} + {{- end }} + {{- end }} + + {{- $hasPVCExists := false -}} + {{- if .Values.persistentVolumeClaim.name }} + {{- $hasPVCExists = true }} + {{- end }} + + {{- $hasSecretEnvExists := false -}} + {{- $hasSecretVolumeExists := false -}} + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "volume"}} + {{- $hasSecretVolumeExists = true}} + {{- end }} + {{- if eq .type "environment"}} + {{- $hasSecretEnvExists = true}} + {{- end }} + {{- end }} + {{- end }} + {{ $CustomLabelsApp:= include "customPodLabelsContainsApp" . }} + {{ $CustomLabelsRelease:= include "customPodLabelsContainsRelease" . }} + + +apiVersion: argoproj.io/v1alpha1 +kind: Rollout +metadata: + name: {{ include ".Chart.Name .fullname" $ }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + releaseVersion: {{ $.Values.releaseVersion | quote }} + pipelineName: {{ .Values.pipelineName }} +{{- if .Values.rolloutLabels }} +{{ toYaml .Values.rolloutLabels | indent 4 }} +{{- end }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} +{{- if .Values.rolloutAnnotations }} + annotations: +{{ toYaml .Values.rolloutAnnotations | indent 4 }} +{{- end }} +spec: +{{- if .Values.workloadRef }} +{{ toYaml .Values.workloadRef | indent 4 }} +{{- end }} +{{- if .Values.rollbackWindow.revisions }} + rollbackWindow: + revisions: {{ .Values.rollbackWindow.revisions }} +{{- end }} + {{- if .Values.analysis }} + analysis: +{{ toYaml .Values.analysis | indent 4 }} + {{- end }} + selector: + matchLabels: +{{- if .Values.customMatchLabels }} +{{ toYaml .Values.customMatchLabels | indent 6 }} +{{- else }} + app: {{ .Values.customPodLabels.app | default (include ".Chart.Name .name" $) }} + release: {{ .Values.customPodLabels.release | default $.Release.Name }} +{{- end }} + replicas: {{ $.Values.replicaCount }} + minReadySeconds: {{ $.Values.MinReadySeconds }} + template: + metadata: + {{- if .Values.podAnnotations }} + annotations: + {{- range $key, $value := .Values.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} + labels: + {{- if not (eq "true" $CustomLabelsApp) }} + app: {{ .Values.customPodLabels.app | default (include ".Chart.Name .name" $) }} + {{- end }} + {{- if not (eq "true" $CustomLabelsRelease) }} + release: {{ .Values.customPodLabels.release |default $.Release.Name }} + {{- end }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} +{{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 8 }} +{{- end }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 8 }} +{{- end }} +{{- if .Values.podLabels }} +{{ toYaml .Values.podLabels | indent 8 }} +{{- end }} + spec: +{{- if $.Values.schedulingGates.name }} + schedulingGates: + name: {{ $.Values.schedulingGates.name }} +{{- end }} +{{- if $.Values.podExtraSpecs }} +{{ toYaml .Values.podExtraSpecs | indent 6 }} +{{- end }} + terminationGracePeriodSeconds: {{ $.Values.GracePeriod }} + restartPolicy: Always +{{- if $.Values.hostAliases }} + hostAliases: +{{ toYaml .Values.hostAliases | indent 8 }} +{{- end }} +{{- if and $.Values.Spec.Affinity.Key $.Values.Spec.Affinity.Values }} + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: {{ $.Values.Spec.Affinity.Key }} + operator: In + values: + - {{ $.Values.Spec.Affinity.Values | default "nodes" }} +{{- else if $.Values.affinity.enabled }} + affinity: +{{ toYaml .Values.affinity.values | indent 8 }} +{{- end }} +{{- if $.Values.serviceAccountName }} + serviceAccountName: {{ $.Values.serviceAccountName }} +{{- else }} + serviceAccountName: {{ template "serviceAccountName" . }} +{{- end }} +{{- if $.Values.schedulerName }} + schedulerName: {{ .Values.schedulerName }} +{{- end }} + {{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 8 }} + {{- end }} +{{- if $.Values.imagePullSecrets}} + imagePullSecrets: + {{- range .Values.imagePullSecrets }} + - name: {{ . }} + {{- end }} +{{- end}} +{{- if $.Values.topologySpreadConstraints }} + topologySpreadConstraints: +{{- range $.Values.topologySpreadConstraints }} + - maxSkew: {{ .maxSkew }} + topologyKey: {{ .topologyKey }} + whenUnsatisfiable: {{ .whenUnsatisfiable }} + {{- if semverCompare "<=1.30-0" $.Capabilities.KubeVersion.GitVersion }} + {{- if .minDomains }} + minDomains: {{ .minDomains }} + {{- end }} + {{- end }} + {{- if .nodeAffinityPolicy }} + nodeAffinityPolicy: {{ .nodeAffinityPolicy }} + {{- end }} + {{- if .nodeTaintsPolicy }} + nodeTaintsPolicy: {{ .nodeTaintsPolicy }} + {{- end }} + labelSelector: + matchLabels: + {{- if and .autoLabelSelector .customLabelSelector }} +{{ toYaml .customLabelSelector | indent 12 }} + {{- else if .autoLabelSelector }} + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ $.Release.Name }} + {{- else if .customLabelSelector }} +{{ toYaml .customLabelSelector | indent 12 }} + {{- end }} +{{- end }} +{{- end }} +{{- if $.Values.topologySpreadConstraint }} + topologySpreadConstraints: +{{ toYaml .Values.topologySpreadConstraint }} +{{- end }} +{{- if $.Values.podSecurityContext }} + securityContext: +{{ toYaml .Values.podSecurityContext | indent 8 }} +{{- end }} +{{- if $.Values.restartPolicy }} + restartPolicy: {{ $.Values.restartPolicy }} +{{- end }} +{{- if $.Values.podSecurityContext }} + securityContext: +{{ toYaml .Values.podSecurityContext | indent 8 }} +{{- end }} +{{- if $.Values.restartPolicy }} + restartPolicy: {{ $.Values.restartPolicy }} +{{- end }} +{{- if $.Values.initContainers}} + initContainers: +{{- range $i, $c := .Values.initContainers }} +{{- if .reuseContainerImage}} + - name: {{ $.Chart.Name }}-init-{{ add1 $i }} + image: "{{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} +{{- if .securityContext }} + securityContext: +{{ toYaml .securityContext | indent 12 }} +{{- end }} +{{- if .command}} + command: +{{ toYaml .command | indent 12 -}} +{{- end}} +{{- if .args}} + args: +{{ toYaml .args | indent 12 -}} +{{- end}} +{{- if .resources}} + resources: +{{ toYaml .resources | indent 12 -}} +{{- end}} +{{- if .volumeMounts}} + volumeMounts: +{{ toYaml .volumeMounts | indent 12 -}} +{{- end}} +{{- else}} + - +{{ toYaml . | indent 10 }} +{{- end}} +{{- end}} +{{- end}} + containers: + - name: {{ $.Chart.Name }} + image: "{{ .Values.server.deployment.image }}:{{ .Values.server.deployment.image_tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} + {{- if $.Values.containerSpec.lifecycle.enabled }} + lifecycle: + {{- if $.Values.containerSpec.lifecycle.preStop }} + preStop: +{{ toYaml $.Values.containerSpec.lifecycle.preStop | indent 12 -}} + {{- end }} + {{- if $.Values.containerSpec.lifecycle.postStart }} + postStart: +{{ toYaml $.Values.containerSpec.lifecycle.postStart | indent 12 -}} + {{- end }} + {{- end }} +{{- if and $.Values.containerSecurityContext $.Values.privileged }} + securityContext: + privileged: true +{{ toYaml .Values.containerSecurityContext | indent 12 }} +{{- else if $.Values.privileged }} + securityContext: + privileged: true +{{- else if $.Values.containerSecurityContext }} + securityContext: +{{ toYaml .Values.containerSecurityContext | indent 12 }} +{{- end }} +{{- if $.Values.containerExtraSpecs }} +{{ toYaml .Values.containerExtraSpecs | indent 10 }} +{{- end }} +{{- if $.Values.resizePolicy }} + resizePolicy: +{{ toYaml .Values.resizePolicy | indent 12 }} +{{- end }} + ports: + {{- range $.Values.ContainerPort }} + - name: {{ .name}} + containerPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end}} +{{- if and $.Values.command.enabled $.Values.command.workingDir }} + workingDir: {{ $.Values.command.workingDir }} +{{- end}} +{{- if and $.Values.command.value $.Values.command.enabled}} + command: +{{ toYaml $.Values.command.value | indent 12 -}} +{{- end}} +{{- if and $.Values.args.value $.Values.args.enabled}} + args: +{{ toYaml $.Values.args.value | indent 12 -}} +{{- end }} + env: + - name: CONFIG_HASH + value: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}{{ if and (.Values.devtronInternal) (.Values.devtronInternal.containerSpecs.ConfigHash) }}{{ .Values.devtronInternal.containerSpecs.ConfigHash }}{{ end }} + - name: SECRET_HASH + value: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}{{ if and (.Values.devtronInternal) (.Values.devtronInternal.containerSpecs.SecretHash) }}{{ .Values.devtronInternal.containerSpecs.SecretHash }}{{ end }} + - name: DEVTRON_APP_NAME + value: {{ template ".Chart.Name .name" $ }} + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: DEVTRON_CONTAINER_REPO + value: "{{ .Values.server.deployment.image }}" + - name: DEVTRON_CONTAINER_TAG + value: "{{ .Values.server.deployment.image_tag }}" + {{- range $.Values.EnvVariablesFromFieldPath }} + {{- if and .name .fieldPath }} + - name: {{ .name }} + valueFrom: + fieldRef: + fieldPath: {{ .fieldPath }} + {{- end }} + {{- end }} + {{- range $.Values.EnvVariables }} + {{- if and .name .value }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} + {{- end }} + {{- range $.Values.EnvVariablesFromSecretKeys }} + {{- if and .name .secretName .keyName }} + - name: {{ .name }} + valueFrom: + secretKeyRef: + name: {{ .secretName }} + key: {{ .keyName }} + {{- end }} + {{- end }} + {{- range $.Values.EnvVariablesFromConfigMapKeys }} + {{- if and .name .configMapName .keyName }} + - name: {{ .name }} + valueFrom: + configMapKeyRef: + name: {{ .configMapName }} + key: {{ .keyName }} + {{- end }} + {{- end }} + {{- if or (and ($hasCMEnvExists) (.Values.ConfigMaps.enabled)) (and ($hasSecretEnvExists) (.Values.ConfigSecrets.enabled)) }} + envFrom: + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "environment" }} + - configMapRef: + {{- if eq .external true }} + name: {{ .name }} + {{- else if eq .external false }} + name: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "environment" }} + - secretRef: + {{if eq .external true}} + name: {{ .name }} + {{else if eq .external false}} + name: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + +{{- if or $.Values.LivenessProbe.Path $.Values.LivenessProbe.command $.Values.LivenessProbe.tcp }} + livenessProbe: +{{- if $.Values.LivenessProbe.Path }} + httpGet: + path: {{ $.Values.LivenessProbe.Path }} + port: {{ $.Values.LivenessProbe.port }} + scheme: {{ $.Values.LivenessProbe.scheme }} + {{- if $.Values.LivenessProbe.httpHeaders }} + httpHeaders: + {{- range $.Values.LivenessProbe.httpHeaders}} + - name: {{.name}} + value: {{.value}} + {{- end}} + {{- end }} +{{- end }} +{{- if $.Values.LivenessProbe.command }} + exec: + command: +{{ toYaml .Values.LivenessProbe.command | indent 16 }} +{{- end}} +{{- if and $.Values.LivenessProbe.tcp }} + tcpSocket: + port: {{ $.Values.LivenessProbe.port }} +{{- end}} +{{- if and $.Values.LivenessProbe.grpc }} + grpc: + port: {{ $.Values.LivenessProbe.port }} + service: {{ $.Values.service.name }} +{{- end}} + initialDelaySeconds: {{ $.Values.LivenessProbe.initialDelaySeconds }} + periodSeconds: {{ $.Values.LivenessProbe.periodSeconds }} + successThreshold: {{ $.Values.LivenessProbe.successThreshold }} + timeoutSeconds: {{ $.Values.LivenessProbe.timeoutSeconds }} + failureThreshold: {{ $.Values.LivenessProbe.failureThreshold }} +{{- end }} +{{- if or $.Values.ReadinessProbe.Path $.Values.ReadinessProbe.command $.Values.ReadinessProbe.tcp }} + readinessProbe: +{{- if $.Values.ReadinessProbe.Path }} + httpGet: + path: {{ $.Values.ReadinessProbe.Path }} + port: {{ $.Values.ReadinessProbe.port }} + scheme: {{ $.Values.ReadinessProbe.scheme }} + {{- if $.Values.ReadinessProbe.httpHeaders }} + httpHeaders: + {{- range $.Values.ReadinessProbe.httpHeaders}} + - name: {{.name}} + value: {{.value}} + {{- end}} + {{- end }} +{{- end }} +{{- if $.Values.ReadinessProbe.command }} + exec: + command: +{{ toYaml .Values.ReadinessProbe.command | indent 16 }} +{{- end}} +{{- if and $.Values.ReadinessProbe.tcp }} + tcpSocket: + port: {{ $.Values.ReadinessProbe.port }} +{{- end}} +{{- if and $.Values.ReadinessProbe.grpc }} + grpc: + port: {{ $.Values.ReadinessProbe.port }} + service: {{ $.Values.service.name }} +{{- end}} + initialDelaySeconds: {{ $.Values.ReadinessProbe.initialDelaySeconds }} + periodSeconds: {{ $.Values.ReadinessProbe.periodSeconds }} + successThreshold: {{ $.Values.ReadinessProbe.successThreshold }} + timeoutSeconds: {{ $.Values.ReadinessProbe.timeoutSeconds }} + failureThreshold: {{ $.Values.ReadinessProbe.failureThreshold }} +{{- end }} + resources: +{{ toYaml $.Values.resources | trim | indent 12 }} +{{- if or $.Values.StartupProbe.Path $.Values.StartupProbe.command $.Values.StartupProbe.tcp }} + startupProbe: +{{- if $.Values.StartupProbe.Path }} + httpGet: + path: {{ $.Values.StartupProbe.Path }} + port: {{ $.Values.StartupProbe.port }} + {{- if $.Values.StartupProbe.httpHeaders }} + httpHeaders: + {{- range $.Values.StartupProbe.httpHeaders}} + - name: {{.name}} + value: {{.value}} + {{- end}} + {{- end }} +{{- end }} +{{- if $.Values.StartupProbe.command }} + exec: + command: +{{ toYaml .Values.StartupProbe.command | indent 16 }} +{{- end}} +{{- if and $.Values.StartupProbe.tcp }} + tcpSocket: + port: {{ $.Values.StartupProbe.port }} +{{- end}} + initialDelaySeconds: {{ $.Values.StartupProbe.initialDelaySeconds }} + periodSeconds: {{ $.Values.StartupProbe.periodSeconds }} + successThreshold: {{ $.Values.StartupProbe.successThreshold }} + timeoutSeconds: {{ $.Values.StartupProbe.timeoutSeconds }} + failureThreshold: {{ $.Values.StartupProbe.failureThreshold }} +{{- end }} + volumeMounts: +{{- with .Values.volumeMounts }} +{{ toYaml . | trim | indent 12 }} +{{- end }} +{{- if $.Values.persistentVolumeClaim.name }} + - name: {{ .Values.persistentVolumeClaim.name }}-vol + mountPath: {{ .Values.persistentVolumeClaim.mountPath | default "/tmp" }} +{{- end}} + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "volume"}} + {{- $cmName := .name -}} + {{- $cmMountPath := .mountPath -}} + {{- if eq .subPath false }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath }} + + {{- else }} + {{- range $k, $v := .data }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath }}/{{ $k}} + subPath: {{ $k}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "volume"}} + {{- $cmName := .name -}} + {{- $cmMountPath := .mountPath -}} + {{- if eq .subPath false }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath }} + + {{- else }} + {{if (or (eq .externalType "ESO_GoogleSecretsManager") (eq .externalType "ESO_AWSSecretsManager") (eq .externalType "ESO_HashiCorpVault") (eq .externalType "ESO_AzureSecretsManager"))}} + {{- if and (.esoSubPath) (ne (len .esoSubPath) 0) }} + {{- range .esoSubPath }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath}}/{{ . }} + subPath: {{ . }} + {{- end }} + {{- else }} + {{- range .esoSecretData.esoData }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath}}/{{ .secretKey }} + subPath: {{ .secretKey }} + {{- end }} + {{- end }} + {{- else }} + {{- range $k, $v := .data }} # for others secrets the mount path will be .data[i].secretKey + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath}}/{{ $k}} + subPath: {{ $k}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) }} []{{- end }} + {{- if and (eq (len .Values.volumeMounts) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) }} [] {{- end }} +{{- if $.Values.appMetrics }} + - name: envoy + image: {{ $.Values.envoyproxy.image | default "quay.io/devtron/envoy:v1.16.0"}} + {{- if $.Values.envoyproxy.lifecycle }} + lifecycle: +{{ toYaml .Values.envoyproxy.lifecycle | indent 12 -}} + {{- else if $.Values.containerSpec.lifecycle.enabled }} + lifecycle: + {{- if $.Values.containerSpec.lifecycle.preStop }} + preStop: +{{ toYaml $.Values.containerSpec.lifecycle.preStop | indent 12 -}} + {{- end }} + {{- end }} + resources: +{{ toYaml $.Values.envoyproxy.resources | trim | indent 12 }} + ports: + - containerPort: 9901 + protocol: TCP + name: envoy-admin + {{- range $index, $element := .Values.ContainerPort }} + - name: envoy-{{ $element.name}} + containerPort: {{ $element.envoyPort | default (add 8790 $index) }} + protocol: TCP + {{- end }} + command: ["/usr/local/bin/envoy"] + args: ["-c", "/etc/envoy-config/envoy-config.json", "-l", "info", "--log-format", "[METADATA][%Y-%m-%d %T.%e][%t][%l][%n] %v"] + volumeMounts: + - name: {{ $.Values.envoyproxy.configMapName | default "envoy-config-volume" }} + mountPath: /etc/envoy-config/ +{{- if $.Values.envoyproxy.readinessProbe}} + readinessProbe: +{{ toYaml $.Values.envoyproxy.readinessProbe | indent 12}} +{{- end }} +{{- if $.Values.envoyproxy.livenessProbe}} + livenessProbe: +{{ toYaml $.Values.envoyproxy.livenessProbe | indent 12}} +{{- end }} +{{- end}} +{{- if $.Values.containers }} +{{- range $i, $c := .Values.containers }} +{{- if .reuseContainerImage}} + - name: {{ $.Chart.Name }}-sidecontainer-{{ add1 $i }} + image: "{{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} +{{- if .env }} + env: +{{ toYaml .env | indent 12 }} +{{- end }} + {{- if .envFrom }} + envFrom: +{{ toYaml .env | indent 12 }} +{{- end }} +{{- if .securityContext }} + securityContext: +{{ toYaml .securityContext | indent 12 }} +{{- end }} +{{- if .command}} + command: +{{ toYaml .command | indent 12 -}} +{{- end}} +{{- if .resizePolicy }} + resizePolicy: +{{ toYaml .resziePolicy | indent 12}} +{{- end }} +{{- if .resources}} + resources: +{{ toYaml .resources | indent 12 -}} +{{- end}} +{{- if .volumeMounts}} + volumeMounts: +{{ toYaml .volumeMounts | indent 12 -}} +{{- end}} +{{- else}} + - +{{ toYaml . | indent 10 }} +{{- end}} +{{- end}} +{{- end}} + volumes: + {{- if $.Values.appMetrics }} + - name: envoy-config-volume + configMap: + name: sidecar-config-{{ template ".Chart.Name .name" $ }} + {{- end }} +{{- if .Values.persistentVolumeClaim.name }} + - name: {{.Values.persistentVolumeClaim.name}}-vol + persistentVolumeClaim: + claimName: {{.Values.persistentVolumeClaim.name }} +{{- end}} +{{- with .Values.volumes }} +{{ toYaml . | trim | indent 8 }} +{{- end }} + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "volume"}} + - name: {{ .name | replace "." "-"}}-vol + configMap: + {{- if eq .external true }} + name: {{ .name }} + {{- else if eq .external false }} + name: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- if eq (len .filePermission) 0 }} + {{- else }} + defaultMode: {{ .filePermission}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "volume"}} + - name: {{ .name | replace "." "-"}}-vol + secret: + {{- if eq .external true }} + secretName: {{ .name }} + {{- else if eq .external false }} + secretName: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- if eq (len .filePermission) 0 }} + {{- else }} + defaultMode: {{ .filePermission}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) (eq (.Values.appMetrics) false) }} []{{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) (eq (.Values.appMetrics) false) }} []{{- end }} + revisionHistoryLimit: 3 +## pauseForSecondsBeforeSwitchActive: {{ $.Values.pauseForSecondsBeforeSwitchActive }} +# waitForSecondsBeforeScalingDown: {{ $.Values.waitForSecondsBeforeScalingDown }} + strategy: + {{- if eq .Values.deploymentType "BLUE-GREEN" }} + blueGreen: # A new field that used to provide configurable options for a BlueGreenUpdate strategy + previewService: {{ template ".previewservicename" . }} # Reference to a service that can serve traffic to a new image before it receives the active traffic + activeService: {{ template ".servicename" . }} # Reference to a service that serves end-user traffic to the replica set + autoPromotionSeconds: {{ $.Values.deployment.strategy.blueGreen.autoPromotionSeconds }} + scaleDownDelaySeconds: {{ $.Values.deployment.strategy.blueGreen.scaleDownDelaySeconds }} + previewReplicaCount: {{ $.Values.deployment.strategy.blueGreen.previewReplicaCount }} + autoPromotionEnabled: {{ $.Values.deployment.strategy.blueGreen.autoPromotionEnabled }} + {{- else if eq .Values.deploymentType "RECREATE" }} + canary: + maxSurge: {{ $.Values.deployment.strategy.recreate.maxSurge }} + maxUnavailable: {{ $.Values.deployment.strategy.recreate.maxUnavailable }} + {{- else if eq .Values.deploymentType "ROLLING" }} + canary: + stableService: {{ template ".servicename" . }} # Reference to a service that serves end-user traffic to the replica set + maxSurge: {{ $.Values.deployment.strategy.rolling.maxSurge }} + maxUnavailable: {{ $.Values.deployment.strategy.rolling.maxUnavailable }} + {{- else if eq .Values.deploymentType "CANARY" }} + canary: + {{- if .Values.deployment.strategy.canary.antiAffinity }} + antiAffinity: +{{ toYaml .Values.deployment.strategy.canary.antiAffinity | indent 8 }} + {{- end }} + {{- if .Values.deployment.strategy.canary.canaryMetadata }} + canaryMetadata: +{{ toYaml .Values.deployment.strategy.canary.canaryMetadata | indent 8 }} + {{- end }} + {{- if .Values.deployment.strategy.canary.pingPong }} + pingPong: +{{ toYaml .Values.deployment.strategy.canary.pingPong | indent 8 }} + {{- end }} + {{- if .Values.deployment.strategy.canary.stableMetadata }} + stableMetadata: +{{ toYaml .Values.deployment.strategy.canary.stableMetadata | indent 8 }} + {{- end }} + {{- if .Values.deployment.strategy.canary.analysis }} + analysis: +{{ toYaml .Values.deployment.strategy.canary.analysis | indent 8 }} + {{- end }} + stableService: {{ template ".servicename" . }} # Reference to a service that serves end-user traffic to the replica set + {{- if .Values.deployment.strategy.canary.canaryService }} + canaryService: {{ $.Values.deployment.strategy.canary.canaryService }} + {{- else }} + canaryService: {{ template ".previewservicename" . }} + {{- end }} + maxSurge: {{ $.Values.deployment.strategy.canary.maxSurge }} + maxUnavailable: {{ $.Values.deployment.strategy.canary.maxUnavailable }} + steps: +{{ toYaml .Values.deployment.strategy.canary.steps | indent 8 }} + {{- if .Values.deployment.strategy.canary.trafficRouting }} + trafficRouting: + {{- if .Values.deployment.strategy.canary.trafficRouting.smi }} + smi: + {{- if .Values.deployment.strategy.canary.trafficRouting.smi.rootService }} + rootService: {{ .Values.deployment.strategy.canary.trafficRouting.smi.rootService }} + {{- else }} + rootService: {{ template ".servicename" . }} + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.smi.trafficSplitName }} + trafficSplitName: {{ .Values.deployment.strategy.canary.trafficRouting.smi.trafficSplitName }} + {{- else }} + trafficSplitName: {{ template ".Chart.Name .fullname" $ }}-traffic-split + {{- end }} + {{- else if .Values.deployment.strategy.canary.trafficRouting.istio }} + istio: + {{ toYaml .Values.deployment.strategy.canary.trafficRouting.istio | indent 10 }} + {{- else if .Values.deployment.strategy.canary.trafficRouting.alb }} + alb: + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.ingress }} + ingress: {{ .Values.deployment.strategy.canary.trafficRouting.alb.ingress }} + {{- else if $.Values.ingress.name }} + ingress: .Values.ingress.name + {{- else }} + ingress: {{ template ".Chart.Name .fullname" . }}-ingress + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.rootService }} + rootService: {{ .Values.deployment.strategy.canary.trafficRouting.alb.rootService }} + {{- else }} + rootService: {{ template ".servicename" . }} + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.annotationPrefix }} + annotationPrefix: {{ .Values.deployment.strategy.canary.trafficRouting.alb.annotationPrefix }} + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.servicePort }} + servicePort: {{ .Values.deployment.strategy.canary.trafficRouting.alb.servicePort }} + {{- else }} + {{- with index .Values.ContainerPort 0 }} + servicePort: {{ .servicePort }} + {{- end }} + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.stickinessConfig }} + stickinessConfig: +{{ toYaml .Values.deployment.strategy.canary.trafficRouting.alb.stickinessConfig | nindent 12 }} + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.ingresses }} + ingresses: + {{- range .Values.deployment.strategy.canary.trafficRouting.alb.ingresses }} + - {{ . }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.managedRoutes }} + managedRoutes: + {{ toYaml .Values.deployment.strategy.canary.trafficRouting.managedRoutes | indent 10 }} + {{- end }} + {{- end }} + {{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/externalsecrets.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/externalsecrets.yaml new file mode 100644 index 0000000000..efd291af5d --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/externalsecrets.yaml @@ -0,0 +1,76 @@ +{{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{if eq .external true }} + {{if (or (eq .externalType "ESO_GoogleSecretsManager") (eq .externalType "ESO_AWSSecretsManager") (eq .externalType "ESO_HashiCorpVault") (eq .externalType "ESO_AzureSecretsManager"))}} +{{- if .esoSecretData.secretStore }} +--- +apiVersion: external-secrets.io/v1beta1 +kind: SecretStore +metadata: + name: {{ .name}} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + provider: + {{- toYaml .esoSecretData.secretStore | nindent 4 }} +{{- end }} +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: {{ .name }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + {{- if .esoSecretData.refreshInterval }} + refreshInterval: {{ .esoSecretData.refreshInterval }} + {{- else }} + refreshInterval: 1h + {{- end}} + {{- if and .esoSecretData.secretStoreRef (not .esoSecretData.secretStore) }} + secretStoreRef: +{{ toYaml .esoSecretData.secretStoreRef | indent 4 }} + {{- else }} + secretStoreRef: + name: {{ .name}} + kind: SecretStore + {{- end }} + target: + name: {{ .name}} + {{- if .esoSecretData.template }} + template: + {{- toYaml .esoSecretData.template | nindent 6 }} + {{- end }} + creationPolicy: Owner + {{- if .esoSecretData.esoDataFrom }} + dataFrom: + {{- toYaml .esoSecretData.esoDataFrom | nindent 4 }} + {{- else }} + data: + {{- range .esoSecretData.esoData }} + - secretKey: {{ .secretKey }} + remoteRef: + key: {{ .key }} + {{- if .property }} + property: {{ .property }} + {{- end }} + {{- end}} +{{- end}} +{{- end}} +{{- end}} +{{- end}} +{{- end}} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/generic.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/generic.yaml new file mode 100644 index 0000000000..db95e84267 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/generic.yaml @@ -0,0 +1,4 @@ +{{- range .Values.rawYaml }} +--- +{{ toYaml . }} + {{- end -}} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/hpa.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/hpa.yaml new file mode 100644 index 0000000000..76ba9455c2 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/hpa.yaml @@ -0,0 +1,93 @@ +{{- if $.Values.autoscaling.enabled }} +{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} +apiVersion: autoscaling/v2 +{{- else if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }} +apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} +kind: HorizontalPodAutoscaler +metadata: + {{- if $.Values.autoscaling.name }} + name: {{ $.Values.autoscaling.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-hpa + {{- end }} + {{- if .Values.autoscaling.annotations }} + annotations: +{{ toYaml .Values.autoscaling.annotations | indent 4 }} + {{- end }} + labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + {{- if .Values.autoscaling.labels }} +{{ toYaml .Values.autoscaling.labels | indent 4 }} + {{- end }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + scaleTargetRef: + apiVersion: argoproj.io/v1alpha1 + kind: Rollout + name: {{ include ".Chart.Name .fullname" $ }} + minReplicas: {{ $.Values.autoscaling.MinReplicas }} + maxReplicas: {{ $.Values.autoscaling.MaxReplicas }} + metrics: + {{- if $.Values.autoscaling.containerResource.enabled }} + {{- with $.Values.autoscaling.containerResource }} + {{- if .TargetCPUUtilizationPercentage }} + - type: ContainerResource + containerResource: + name: cpu + container: {{ $.Chart.Name }} + target: + type: Utilization + averageUtilization: {{ .TargetCPUUtilizationPercentage }} + {{- end}} + {{- if .TargetMemoryUtilizationPercentage }} + - type: ContainerResource + containerResource: + name: memory + container: {{ $.Chart.Name }} + target: + type: Utilization + averageUtilization: {{ .TargetMemoryUtilizationPercentage }} + {{- end}} + {{- end }} + {{- end }} + {{- if $.Values.autoscaling.TargetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + {{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ $.Values.autoscaling.TargetMemoryUtilizationPercentage }} + {{- else }} + targetAverageUtilization: {{ $.Values.autoscaling.TargetMemoryUtilizationPercentage }} + {{- end }} + {{- end }} + {{- if $.Values.autoscaling.TargetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + {{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ $.Values.autoscaling.TargetCPUUtilizationPercentage }} + {{- else }} + targetAverageUtilization: {{ $.Values.autoscaling.TargetCPUUtilizationPercentage }} + {{- end }} + {{- end }} + {{- if and $.Values.autoscaling.extraMetrics (semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion) }} + {{- toYaml $.Values.autoscaling.extraMetrics | nindent 2 }} + {{- end}} + {{- if and $.Values.autoscaling.behavior (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + behavior: + {{- toYaml $.Values.autoscaling.behavior | nindent 4 }} + {{- end }} + {{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/ingress.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/ingress.yaml new file mode 100644 index 0000000000..1d47899d0b --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/ingress.yaml @@ -0,0 +1,187 @@ +{{ $svcName := include ".servicename" . }} +{{ $svcPort := (index .Values.ContainerPort 0).servicePort }} +{{- if $.Values.ingress.enabled -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- if and .Values.ingressInternal.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingressInternal.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingressInternal.annotations "kubernetes.io/ingress.class" .Values.ingressInternal.className}} + {{- end }} +{{- end }} +{{- end }} +--- +{{ if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + {{- if $.Values.ingress.name }} + name: {{ $.Values.ingress.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" . }}-ingress + {{- end }} + namespace: {{ $.Values.NameSpace }} + labels: + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Release.Name }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} + {{- if .Values.ingress.labels }} +{{ toYaml .Values.ingress.labels | indent 4 }} + {{- end }} +{{- if .Values.ingress.annotations }} + annotations: +{{ toYaml .Values.ingress.annotations | indent 4 }} +{{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + rules: + {{- if or .Values.ingress.host .Values.ingress.path }} + - host: {{ .Values.ingress.host }} + http: + paths: + - path: {{ .Values.ingress.path }} + {{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ $.Values.ingress.pathType | default "ImplementationSpecific" }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $svcName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $svcName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- if and ($.Values.ingress.hosts) (not ($.Values.ingress.host )) }} + {{- range .Values.ingress.hosts }} + {{ $outer := . -}} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + {{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ $outer.pathType | default "ImplementationSpecific" | quote }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $svcName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $svcName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- if .additionalBackends }} +{{ toYaml .additionalBackends | indent 10 }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: +{{ toYaml .Values.ingress.tls | indent 4 }} + {{- end -}} +{{- end }} +{{- if $.Values.ingressInternal.enabled }} +--- +{{ if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{ else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{ else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + {{- if $.Values.ingressInternal.name }} + name: {{ $.Values.ingressInternal.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" . }}-ingress-internal + {{- end }} + namespace: {{ $.Values.NameSpace }} + labels: + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Release.Name }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} +{{- if .Values.ingressInternal.annotations }} + annotations: +{{ toYaml .Values.ingressInternal.annotations | indent 4 }} +{{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingressInternal.className }} + {{- end }} + rules: + {{- if or .Values.ingressInternal.host .Values.ingressInternal.path }} + - host: {{ .Values.ingressInternal.host }} + http: + paths: + - path: {{ .Values.ingressInternal.path }} + {{- if and .Values.ingressInternal.pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ $.Values.ingressInternal.pathType | default "Prefix" | quote }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $svcName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $svcName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- if and ($.Values.ingressInternal.hosts) (not ($.Values.ingressInternal.host )) }} + {{- range .Values.ingressInternal.hosts }} + {{ $outer := . -}} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + {{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ $outer.pathType | default "ImplementationSpecific" | quote }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $svcName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $svcName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- if .additionalBackends }} +{{ toYaml .additionalBackends | indent 10 }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.ingressInternal.tls }} + tls: +{{ toYaml .Values.ingressInternal.tls | indent 4 }} + {{- end -}} +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-authorizationpolicy.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-authorizationpolicy.yaml new file mode 100644 index 0000000000..df063920a7 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-authorizationpolicy.yaml @@ -0,0 +1,45 @@ +{{- with .Values.istio }} +{{- if and .enable .authorizationPolicy.enabled }} +{{ if semverCompare ">=1.22-0" $.Capabilities.KubeVersion.GitVersion -}} +apiVersion: security.istio.io/v1 +{{- else -}} +apiVersion: security.istio.io/v1beta1 +{{- end }} +kind: AuthorizationPolicy +metadata: + {{- if .authorizationPolicy.name }} + name: {{ .authorizationPolicy.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }} + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .authorizationPolicy.labels }} +{{ toYaml .authorizationPolicy.labels | indent 4 }} + {{- end }} +{{- if .authorizationPolicy.annotations }} + annotations: +{{ toYaml .authorizationPolicy.annotations | indent 4 }} +{{- end }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ template ".Chart.Name .fullname" $ }} + action: {{ .authorizationPolicy.action }} +{{- if $.Values.istio.authorizationPolicy.provider }} + provider: +{{ toYaml $.Values.istio.authorizationPolicy.provider | indent 4 }} +{{- end }} +{{- if $.Values.istio.authorizationPolicy.rules }} + rules: +{{ toYaml $.Values.istio.authorizationPolicy.rules | indent 4 }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-destinationrule.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-destinationrule.yaml new file mode 100644 index 0000000000..bc665e6ec0 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-destinationrule.yaml @@ -0,0 +1,42 @@ +{{- with .Values.istio }} +{{- if and .enable .destinationRule.enabled }} +{{ if semverCompare ">=1.22-0" $.Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.istio.io/v1 +{{ else }} +apiVersion: networking.istio.io/v1beta1 +{{- end }} +kind: DestinationRule +metadata: + {{- if .destinationRule.name }} + name: {{ .destinationRule.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-destinationrule + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .destinationRule.labels }} +{{ toYaml .destinationRule.labels | indent 4 }} + {{- end }} +{{- if .destinationRule.annotations }} + annotations: +{{ toYaml .destinationRule.annotations | indent 4 }} +{{- end }} +spec: + host: "{{ include ".servicename" $ }}.{{ $.Release.Namespace }}.svc.cluster.local" +{{- if $.Values.istio.destinationRule.subsets }} + subsets: +{{ toYaml $.Values.istio.destinationRule.subsets | indent 4 }} +{{- end }} +{{- if $.Values.istio.destinationRule.trafficPolicy }} + trafficPolicy: +{{ toYaml $.Values.istio.destinationRule.trafficPolicy | indent 4 }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-gateway.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-gateway.yaml new file mode 100644 index 0000000000..425cc48c12 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-gateway.yaml @@ -0,0 +1,73 @@ +{{- if and .Values.istio.enable .Values.istio.gateway.enabled -}} +{{ if semverCompare ">=1.22-0" $.Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.istio.io/v1 +{{ else }} +apiVersion: networking.istio.io/v1beta1 +{{- end }} +kind: Gateway +metadata: + {{- if .Values.istio.gateway.name }} + name: {{ .Values.istio.gateway.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-istio-gateway + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if $.Values.istio.gateway.labels }} +{{ toYaml $.Values.istio.gateway.labels | indent 4 }} + {{- end }} +{{- if $.Values.istio.gateway.annotations }} + annotations: +{{ toYaml $.Values.istio.gateway.annotations | indent 4 }} +{{- end }} +spec: +{{- if .Values.istio.gateway.gatewayExtraSpec }} +{{ toYaml $.Values.istio.gateway.gatewayExtraSpec | indent 2}} +{{- else}} +{{- if .Values.istio.gateway.selector }} + selector: +{{ toYaml $.Values.istio.gateway.selector | indent 4}} +{{- end }} + servers: + - port: + number: 80 + name: http + protocol: HTTP + hosts: +{{- if .Values.istio.gateway.host }} + - {{ .Values.istio.gateway.host | quote -}} +{{- else if .Values.istio.gateway.hosts }} +{{- range .Values.istio.gateway.hosts }} + - {{ . | quote }} +{{- end }} +{{- end }} +{{ with .Values.istio.gateway }} +{{- if .tls.enabled }} + tls: + httpsRedirect: true + - port: + number: 443 + name: https + protocol: HTTPS + hosts: +{{- if .host }} + - {{ .host | quote }} +{{- else if .hosts }} +{{- range .hosts }} + - {{ . | quote }} +{{- end }} +{{- end }} + tls: + mode: SIMPLE + credentialName: {{ .tls.secretName }} +{{ end }} +{{ end }} +{{ end }} +{{ end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-peerauthentication.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-peerauthentication.yaml new file mode 100644 index 0000000000..5e143c8530 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-peerauthentication.yaml @@ -0,0 +1,44 @@ +{{- with .Values.istio }} +{{- if and .enable .peerAuthentication.enabled }} +{{ if semverCompare ">=1.22-0" $.Capabilities.KubeVersion.GitVersion -}} +apiVersion: security.istio.io/v1 +{{- else -}} +apiVersion: security.istio.io/v1beta1 +{{- end }} +kind: PeerAuthentication +metadata: + {{- if .peerAuthentication.name }} + name: {{ .peerAuthentication.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }} + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .peerAuthentication.labels }} +{{ toYaml .peerAuthentication.labels | indent 4 }} + {{- end }} +{{- if .peerAuthentication.annotations }} + annotations: +{{ toYaml .peerAuthentication.annotations | indent 4 }} +{{- end }} +spec: +{{- if .peerAuthentication.selector.enabled }} + selector: + matchLabels: + app.kubernetes.io/name: {{ template ".Chart.Name .fullname" $ }} +{{- end }} + mtls: + mode: {{ .peerAuthentication.mtls.mode }} +{{- if $.Values.istio.peerAuthentication.portLevelMtls }} + portLevelMtls: +{{ toYaml $.Values.istio.peerAuthentication.portLevelMtls | indent 4 }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-requestauthentication.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-requestauthentication.yaml new file mode 100644 index 0000000000..d8082bd34d --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-requestauthentication.yaml @@ -0,0 +1,42 @@ +{{- with .Values.istio }} +{{- if and .enable .requestAuthentication.enabled }} +{{ if semverCompare ">=1.22-0" $.Capabilities.KubeVersion.GitVersion -}} +apiVersion: security.istio.io/v1 +{{- else -}} +apiVersion: security.istio.io/v1beta1 +{{- end }} +kind: RequestAuthentication +metadata: + {{- if .requestAuthentication.name }} + name: {{ .requestAuthentication.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }} + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .requestAuthentication.labels }} +{{ toYaml .requestAuthentication.labels | indent 4 }} + {{- end }} +{{- if .requestAuthentication.annotations }} + annotations: +{{ toYaml .requestAuthentication.annotations | indent 4 }} +{{- end }} +spec: +{{- if .requestAuthentication.selector.enabled }} + selector: + matchLabels: + app.kubernetes.io/name: {{ template ".Chart.Name .fullname" $ }} +{{- end }} +{{- if $.Values.istio.requestAuthentication.jwtRules }} + jwtRules: +{{ toYaml $.Values.istio.requestAuthentication.jwtRules | indent 2 }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-virtualservice.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-virtualservice.yaml new file mode 100644 index 0000000000..dae81522cb --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/istio-virtualservice.yaml @@ -0,0 +1,68 @@ +{{- with .Values.istio }} +{{- if and .enable .virtualService.enabled }} +{{ if semverCompare ">=1.22-0" $.Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.istio.io/v1 +{{ else }} +apiVersion: networking.istio.io/v1beta1 +{{- end }} +kind: VirtualService +metadata: + {{- if .virtualService.name }} + name: {{ .virtualService.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-virtualservice + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .virtualService.labels }} +{{ toYaml .virtualService.labels | indent 4 }} + {{- end }} +{{- if .virtualService.annotations }} + annotations: +{{ toYaml .virtualService.annotations | indent 4 }} +{{- end }} +spec: +{{- if or .gateway.enabled .virtualService.gateways }} +{{- if .virtualService.virtualServiceExtraSpec }} +{{ toYaml .virtualService.virtualServiceExtraSpec | indent 2}} +{{- else }} + gateways: + {{- if .gateway.enabled }} + - {{ template ".Chart.Name .fullname" $ }}-istio-gateway + {{- end }} + {{- range .virtualService.gateways }} + - {{ . | quote }} + {{- end }} +{{- end }} +{{- if or .gateway.enabled .virtualService.hosts }} + hosts: + {{- if .gateway.enabled }} + {{- if .gateway.host }} + - {{ .gateway.host | quote }} + {{- else if .gateway.hosts }} +{{- range .gateway.hosts }} + - {{ . | quote }} +{{- end }} + {{- end }} + {{- end }} + {{- range .virtualService.hosts }} + - {{ . | quote }} + {{- end }} +{{- else }} + hosts: + - "{{ include ".servicename" $ }}.{{ $.Release.Namespace }}.svc.cluster.local" +{{- end }} +{{- if $.Values.istio.virtualService.http }} + http: +{{ toYaml $.Values.istio.virtualService.http | indent 4 }} +{{- end }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/keda-autoscaling.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/keda-autoscaling.yaml new file mode 100644 index 0000000000..850312e16d --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/keda-autoscaling.yaml @@ -0,0 +1,78 @@ +{{- if $.Values.kedaAutoscaling.enabled }} +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + {{- if $.Values.kedaAutoscaling.name }} + name: {{ $.Values.kedaAutoscaling.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-keda + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ .Release.Name }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} + {{- if .Values.kedaAutoscaling.labels }} +{{ toYaml .Values.kedaAutoscaling.labels | indent 4 }} + {{- end }} + {{- if .Values.kedaAutoscaling.annotations }} + annotations: +{{ toYaml .Values.kedaAutoscaling.annotations | indent 4 }} + {{- end }} +spec: + scaleTargetRef: + apiVersion: argoproj.io/v1alpha1 + kind: Rollout + name: {{ include ".Chart.Name .fullname" $ }} +{{- if $.Values.kedaAutoscaling.envSourceContainerName }} + envSourceContainerName: {{ $.Values.kedaAutoscaling.envSourceContainerName }} +{{- end }} +{{- if $.Values.kedaAutoscaling.pollingInterval }} + pollingInterval: {{ $.Values.kedaAutoscaling.pollingInterval }} +{{- end }} +{{- if $.Values.kedaAutoscaling.cooldownPeriod }} + cooldownPeriod: {{ $.Values.kedaAutoscaling.cooldownPeriod }} +{{- end }} +{{- if $.Values.kedaAutoscaling.idleReplicaCount }} + idleReplicaCount: {{ $.Values.kedaAutoscaling.idleReplicaCount }} +{{- end }} + minReplicaCount: {{ $.Values.kedaAutoscaling.minReplicaCount }} + maxReplicaCount: {{ $.Values.kedaAutoscaling.maxReplicaCount }} +{{- if $.Values.kedaAutoscaling.fallback }} + fallback: +{{ toYaml $.Values.kedaAutoscaling.fallback | indent 4 }} +{{- end }} +{{- if $.Values.kedaAutoscaling.advanced }} + advanced: +{{ toYaml $.Values.kedaAutoscaling.advanced | indent 4 }} +{{- end }} + triggers: +{{ toYaml .Values.kedaAutoscaling.triggers | indent 2}} +{{- if $.Values.kedaAutoscaling.authenticationRef }} + authenticationRef: +{{ toYaml $.Values.kedaAutoscaling.authenticationRef | indent 6 }} +{{- end }} +--- +{{- if $.Values.kedaAutoscaling.triggerAuthentication.enabled }} +apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: {{ $.Values.kedaAutoscaling.triggerAuthentication.name }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} +spec: +{{ toYaml $.Values.kedaAutoscaling.triggerAuthentication.spec | indent 2 }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/metrics-service-monitor.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/metrics-service-monitor.yaml new file mode 100644 index 0000000000..4e9e544f50 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/metrics-service-monitor.yaml @@ -0,0 +1,35 @@ +{{- if $.Values.appMetrics -}} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template ".Chart.Name .fullname" $ }} + labels: + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Values.prometheus.release }} +spec: + jobLabel: {{ template ".Chart.Name .name" $ }} + endpoints: + - port: envoy-admin + interval: 30s + path: /stats/prometheus + relabelings: + - action: replace + sourceLabels: + - __meta_kubernetes_pod_label_rollouts_pod_template_hash + targetLabel: devtron_app_hash + selector: + matchLabels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + namespaceSelector: + matchNames: + - {{.Release.Namespace}} + podTargetLabels: + - appId + - envId + - devtron_app_hash +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/networkpolicy.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/networkpolicy.yaml new file mode 100644 index 0000000000..ee8bdaf8be --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/networkpolicy.yaml @@ -0,0 +1,52 @@ +{{- if .Values.networkPolicy.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + {{- if .Values.networkPolicy.name }} + name: {{ .Values.networkPolicy.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-networkpolicy + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if $.Values.networkPolicy.labels }} +{{ toYaml $.Values.networkPolicy.labels | indent 4 }} + {{- end }} +{{- if $.Values.networkPolicy.annotations }} + annotations: +{{ toYaml $.Values.networkPolicy.annotations | indent 4 }} +{{- end }} +spec: + podSelector: +{{- if .podSelector.matchExpressions }} + matchExpressions: +{{ toYaml $.Values.networkPolicy.podSelector.matchExpressions | indent 6 }} +{{- end }} +{{- if .podSelector.matchLabels }} + matchLabels: +{{ toYaml $.Values.networkPolicy.podSelector.matchLabels | indent 6 }} +{{- else }} + matchLabels: + app: {{ template ".Chart.Name .name" $ }} + release: {{ $.Release.Name }} +{{- end }} +{{- if .policyTypes }} + policyTypes: +{{ toYaml $.Values.networkPolicy.policyTypes | indent 4 }} +{{- end }} +{{- if .ingress }} + ingress: +{{ toYaml $.Values.networkPolicy.ingress | indent 4 }} +{{- end }} +{{- if .egress }} + egress: +{{ toYaml $.Values.networkPolicy.ingress | indent 4}} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/persistent-volume-claim.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/persistent-volume-claim.yaml new file mode 100644 index 0000000000..cee0fb2fde --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/persistent-volume-claim.yaml @@ -0,0 +1,27 @@ +{{- if .Values.persistentVolumeClaim.name }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{.Values.persistentVolumeClaim.name }} + labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} +{{- with .Values.persistentVolumeClaim }} +spec: + accessModes: +{{- range .accessMode }} + - {{ . }} +{{- end }} + resources: + requests: + storage: {{ .storage | default "5Gi" }} + storageClassName: {{ .storageClassName | default "default" }} + volumeMode: {{ .volumeMode | default "Filesystem" }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/poddisruptionbudget.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/poddisruptionbudget.yaml new file mode 100644 index 0000000000..869d380d40 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/poddisruptionbudget.yaml @@ -0,0 +1,38 @@ +{{- if .Values.podDisruptionBudget }} +{{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: policy/v1 +{{- else -}} +apiVersion: policy/v1beta1 +{{- end }} +kind: PodDisruptionBudget +metadata: + {{- if .Values.podDisruptionBudget.name }} + name: {{ .Values.podDisruptionBudget.name }} + {{- else }} + name: {{ include ".Chart.Name .fullname" $ }} + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 6 }} + {{- else }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + {{- end }} + {{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/pre-sync-job.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/pre-sync-job.yaml new file mode 100644 index 0000000000..cd733d4857 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/pre-sync-job.yaml @@ -0,0 +1,23 @@ +{{- if $.Values.dbMigrationConfig.enabled }} +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ template ".Chart.Name .fullname" $ }}-migrator + annotations: + argocd.argoproj.io/hook: PreSync +# argocd.argoproj.io/hook-delete-policy: HookSucceeded +spec: + template: + spec: + containers: + - name: migrator + image: 686244538589.dkr.ecr.us-east-2.amazonaws.com/migrator:0.0.1-rc14 + env: + {{- range $.Values.dbMigrationConfig.envValues }} + - name: {{ .key}} + value: {{ .value | quote }} + {{- end}} + restartPolicy: Never + backoffLimit: 0 +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/prometheusrules.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/prometheusrules.yaml new file mode 100644 index 0000000000..90f398bff4 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/prometheusrules.yaml @@ -0,0 +1,22 @@ +{{- if .Values.prometheusRule.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ template ".Chart.Name .fullname" . }} + {{- if .Values.prometheusRule.namespace }} + namespace: {{ .Values.prometheusRule.namespace }} + {{- end }} + labels: + kind: Prometheus + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Values.prometheus.release }} + {{- if .Values.prometheusRule.additionalLabels }} +{{ toYaml .Values.prometheusRule.additionalLabels | indent 4 }} + {{- end }} +spec: + {{- with .Values.prometheusRule.rules }} + groups: + - name: {{ template ".Chart.Name .fullname" $ }} + rules: {{- toYaml . | nindent 6 }} + {{- end }} + {{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/secret.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/secret.yaml new file mode 100644 index 0000000000..26a17b968c --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/secret.yaml @@ -0,0 +1,69 @@ +{{- if $.Values.secret.enabled }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: app-secret +{{- if $.Values.appLabels }} + labels: +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +type: Opaque +data: +{{ toYaml $.Values.secret.data | indent 2 }} +{{- end }} + + +{{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{if eq .external false}} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ .name}}-{{ $.Values.app }} +{{- if $.Values.appLabels }} + labels: +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +type: Opaque +data: +{{ toYaml .data | trim | indent 2 }} +{{- end}} + {{if eq .external true }} + {{if (or (eq .externalType "AWSSecretsManager") (eq .externalType "AWSSystemManager") (eq .externalType "HashiCorpVault"))}} +--- +apiVersion: kubernetes-client.io/v1 +kind: ExternalSecret +metadata: + name: {{ .name}} +{{- if $.Values.appLabels }} + labels: +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + {{- if .roleARN }} + roleArn: .roleARN + {{- end}} + {{- if eq .externalType "AWSSecretsManager"}} + backendType: secretsManager + {{- end}} + {{- if eq .externalType "AWSSystemManager"}} + backendType: systemManager + {{- end}} + {{- if eq .externalType "HashiCorpVault"}} + backendType: vault + {{- end}} + data: + {{- range .secretData }} + - key: {{.key}} + name: {{.name}} + {{- if .property }} + property: {{.property}} + {{- end}} + isBinary: {{.isBinary}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/service.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/service.yaml new file mode 100644 index 0000000000..6853027e9a --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/service.yaml @@ -0,0 +1,106 @@ +{{- if .Values.service.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template ".servicename" . }} + labels: + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Release.Name }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} +{{- if .Values.service.annotations }} + annotations: +{{ toYaml .Values.service.annotations | indent 4 }} +{{- end}} +spec: + type: {{ .Values.service.type | default "ClusterIP" }} +{{- if (and (eq .Values.service.type "LoadBalancer") .Values.service.loadBalancerSourceRanges )}} + loadBalancerSourceRanges: + {{- range .Values.service.loadBalancerSourceRanges }} + - {{ . }} + {{- end }} +{{- end }} + ports: + {{- range .Values.ContainerPort }} + {{- if .servicePort }} + - port: {{ .servicePort }} + {{- else }} + - port: {{ .port }} + {{- end }} + {{- if .targetPort }} + targetPort: {{ .targetPort }} + {{- else if $.Values.appMetrics }} + targetPort: envoy-{{ .name }} + {{- else }} + targetPort: {{ .name }} + {{- end }} + {{- if (and (eq $.Values.service.type "NodePort") .nodePort )}} + nodePort: {{ .nodePort }} + {{- end }} + protocol: {{ .protocol | default "TCP"}} + name: {{ .name }} + {{- end }} + {{- if $.Values.appMetrics }} + - port: 9901 + name: envoy-admin + {{- end }} + selector: + {{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 4 }} + {{- else }} + app: {{ template ".Chart.Name .name" . }} + {{- end }} +{{- if .Values.service.sessionAffinity.enabled }} + sessionAffinity: ClientIP +{{- end }} +{{- if .Values.service.sessionAffinityConfig }} + sessionAffinityConfig: +{{ toYaml .Values.service.sessionAffinityConfig | indent 4 }} +{{- end }} +{{- if or (eq .Values.deploymentType "BLUE-GREEN") (eq .Values.deploymentType "CANARY") }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ template ".previewservicename" . }} + labels: + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Release.Name }} +spec: + type: ClusterIP + ports: + {{- range .Values.ContainerPort }} + {{- if .servicePort }} + - port: {{ .servicePort }} + {{- else }} + - port: {{ .port }} + {{- end }} + {{- if .targetPort }} + targetPort: {{ .targetPort }} + {{- else if $.Values.appMetrics }} + targetPort: envoy-{{ .name }} + {{- else }} + targetPort: {{ .name }} + {{- end }} + protocol: {{ .protocol | default "TCP"}} + name: {{ .name }} + {{- end }} + {{- if $.Values.appMetrics }} + - port: 9901 + name: envoy-admin + {{- end }} + selector: + {{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 4 }} + {{- else }} + app: {{ template ".Chart.Name .name" . }} + {{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/serviceaccount.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/serviceaccount.yaml new file mode 100644 index 0000000000..ac258610fa --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/serviceaccount.yaml @@ -0,0 +1,16 @@ +{{- if $.Values.serviceAccount }} +{{- if $.Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "serviceAccountName" . }} + {{- if .Values.podLabels }} + labels: +{{ toYaml .Values.podLabels | indent 4 }} + {{- end }} + {{- if .Values.serviceAccount.annotations }} + annotations: +{{ toYaml .Values.serviceAccount.annotations | indent 4 }} + {{- end }} +{{- end -}} +{{- end -}} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/servicemonitor.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/servicemonitor.yaml new file mode 100644 index 0000000000..8600f9d65b --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/servicemonitor.yaml @@ -0,0 +1,117 @@ +{{ $serviceMonitorEnabled := include "serviceMonitorEnabled" . }} +{{- if eq "true" $serviceMonitorEnabled -}} +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + {{- if .Values.servicemonitor.name }} + name: {{ .Values.servicemonitor.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" . }}-sm + {{- end }} + labels: + kind: Prometheus + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Values.prometheus.release }} + {{- if .Values.servicemonitor.additionalLabels }} +{{ toYaml .Values.servicemonitor.additionalLabels | indent 4 }} + {{- end }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} +spec: + endpoints: + {{- range .Values.ContainerPort }} + {{- if .servicemonitor }} + {{- if .servicemonitor.enabled}} + {{- if .servicemonitor.targetPort }} + - targetPort: {{ .servicemonitor.targetPort }} + {{- else if .servicePort }} + - port: {{ .name }} + {{- end }} + {{- if .servicemonitor.path }} + path: {{ .servicemonitor.path}} + {{- end }} + {{- if .servicemonitor.scheme }} + scheme: {{ .servicemonitor.scheme}} + {{- end }} + {{- if .servicemonitor.interval }} + interval: {{ .servicemonitor.interval}} + {{- end }} + {{- if .servicemonitor.scrapeTimeout }} + scrapeTimeout: {{ .servicemonitor.scrapeTimeout | quote }} + {{- end }} + {{- if .servicemonitor.basicAuth }} + basicAuth: + {{- toYaml .servicemonitor.basicAuth | nindent 8 }} + {{- end }} + {{- if .servicemonitor.insecureTLS }} + tlsConfig: + insecureSkipVerify: true + {{- else if .servicemonitor.tlsConfig }} + tlsConfig: + {{- toYaml .servicemonitor.tlsConfig | nindent 8 }} + {{- end }} + {{- if .servicemonitor.metricRelabelings}} + metricRelabelings: +{{toYaml .servicemonitor.metricRelabelings | indent 8 }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- range .Values.containers }} + {{- range .ports }} + {{- if .servicemonitor }} + {{- if .servicemonitor.enabled}} + {{- if .servicemonitor.targetPort }} + - targetPort: {{ .servicemonitor.targetPort }} + {{- else if .servicePort }} + - port: {{ .name }} + {{- end }} + {{- if .servicemonitor.path }} + path: {{ .servicemonitor.path}} + {{- end }} + {{- if .servicemonitor.scheme }} + scheme: {{ .servicemonitor.scheme}} + {{- end }} + {{- if .servicemonitor.interval }} + interval: {{ .servicemonitor.interval}} + {{- end }} + {{- if .servicemonitor.scrapeTimeout }} + scrapeTimeout: {{ .servicemonitor.scrapeTimeout}} + {{- end }} + {{- if .servicemonitor.basicAuth }} + basicAuth: + {{- toYaml .servicemonitor.basicAuth | nindent 8 }} + {{- end }} + {{- if .servicemonitor.insecureTLS }} + tlsConfig: + insecureSkipVerify: true + {{- else if .servicemonitor.tlsConfig }} + tlsConfig: + {{- toYaml .servicemonitor.tlsConfig | nindent 8 }} + {{- end }} + {{- if .servicemonitor.metricRelabelings}} + metricRelabelings: +{{toYaml .servicemonitor.metricRelabelings | indent 8 }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.servicemonitor.namespaceSelector }} + namespaceSelector: + matchNames: + {{- toYaml .Values.servicemonitor.namespaceSelector | nindent 6 }} + {{- end }} + selector: + matchLabels: + {{- if .Values.servicemonitor.matchLabels }} + {{- toYaml .Values.servicemonitor.matchLabels | nindent 6 }} + {{- else }} + app: {{ template ".Chart.Name .name" $ }} + {{- end }} +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/sidecar-configmap.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/sidecar-configmap.yaml new file mode 100644 index 0000000000..cf32679409 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/sidecar-configmap.yaml @@ -0,0 +1,169 @@ +{{- if .Values.appMetrics }} +apiVersion: v1 +kind: ConfigMap +metadata: + creationTimestamp: 2019-08-12T18:38:34Z + name: sidecar-config-{{ template ".Chart.Name .name" $ }} +data: + envoy-config.json: | + { + "stats_config": { + "use_all_default_tags": false, + "stats_tags": [ + { + "tag_name": "cluster_name", + "regex": "^cluster\\.((.+?(\\..+?\\.svc\\.cluster\\.local)?)\\.)" + }, + { + "tag_name": "tcp_prefix", + "regex": "^tcp\\.((.*?)\\.)\\w+?$" + }, + { + "tag_name": "response_code", + "regex": "_rq(_(\\d{3}))$" + }, + { + "tag_name": "response_code_class", + "regex": ".*_rq(_(\\dxx))$" + }, + { + "tag_name": "http_conn_manager_listener_prefix", + "regex": "^listener(?=\\.).*?\\.http\\.(((?:[_.[:digit:]]*|[_\\[\\]aAbBcCdDeEfF[:digit:]]*))\\.)" + }, + { + "tag_name": "http_conn_manager_prefix", + "regex": "^http\\.(((?:[_.[:digit:]]*|[_\\[\\]aAbBcCdDeEfF[:digit:]]*))\\.)" + }, + { + "tag_name": "listener_address", + "regex": "^listener\\.(((?:[_.[:digit:]]*|[_\\[\\]aAbBcCdDeEfF[:digit:]]*))\\.)" + }, + { + "tag_name": "mongo_prefix", + "regex": "^mongo\\.(.+?)\\.(collection|cmd|cx_|op_|delays_|decoding_)(.*?)$" + } + ], + "stats_matcher": { + "inclusion_list": { + "patterns": [ + { + "regex": ".*_rq_\\dxx$" + }, + { + "regex": ".*_rq_time$" + }, + { + "regex": "cluster.*" + }, + ] + } + } + }, + "admin": { + "access_log_path": "/dev/null", + "address": { + "socket_address": { + "address": "0.0.0.0", + "port_value": 9901 + } + } + }, + "static_resources": { + "clusters": [ + {{- range $index, $element := .Values.ContainerPort }} + { + "name": "{{ $.Values.app }}-{{ $index }}", + "type": "STATIC", + "connect_timeout": "0.250s", + "lb_policy": "ROUND_ROBIN", +{{- if $element.idleTimeout }} + "common_http_protocol_options": { + "idle_timeout": {{ $element.idleTimeout | quote }} + }, +{{- end }} +{{- if or $element.useHTTP2 $element.useGRPC }} + "http2_protocol_options": {}, +{{- end }} +{{- if and (not $element.useGRPC) (not $element.supportStreaming) }} + "max_requests_per_connection": "1", +{{- end }} + "load_assignment": { + "cluster_name": "9", + "endpoints": { + "lb_endpoints": [ + { + "endpoint": { + "address": { + "socket_address": { + "protocol": "TCP", + "address": "127.0.0.1", + "port_value": {{ $element.port }} + } + } + } + } + ] + } + } + }, + {{- end }} + ], + "listeners":[ + {{- range $index, $element := .Values.ContainerPort }} + { + "address": { + "socket_address": { + "protocol": "TCP", + "address": "0.0.0.0", + "port_value": {{ $element.envoyPort | default (add 8790 $index) }} + } + }, + "filter_chains": [ + { + "filters": [ + { + "name": "envoy.filters.network.http_connection_manager", + "config": { + "codec_type": "AUTO", + "stat_prefix": "stats", + "route_config": { + "virtual_hosts": [ + { + "name": "backend", + "domains": [ + "*" + ], + "routes": [ + { + "match": { + "prefix": "/" + }, + "route": { +{{- if $element.supportStreaming }} + "timeout": "0s", +{{- end }} +{{- if and ($element.envoyTimeout) (not $element.supportStreaming) }} + "timeout": "{{ $element.envoyTimeout }}", +{{- end }} + "cluster": "{{ $.Values.app }}-{{ $index }}" + } + } + ] + } + ] + }, + "http_filters": { + "name": "envoy.filters.http.router" + } + } + } + ] + } + ] + }, + {{- end }} + ] + } + } +--- +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/vertical-pod-autoscaler.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/vertical-pod-autoscaler.yaml new file mode 100644 index 0000000000..7d1d1db475 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/vertical-pod-autoscaler.yaml @@ -0,0 +1,41 @@ +{{ $VerticalPodAutoScalingEnabled := include "VerticalPodAutoScalingEnabled" . }} +{{- if eq "true" $VerticalPodAutoScalingEnabled -}} +apiVersion: autoscaling.k8s.io/v1 +kind: VerticalPodAutoscaler +metadata: + {{- if .Values.verticalPodScaling.name }} + name: {{ .Values.verticalPodScaling.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" . }}-vpa + {{- end }} + labels: + kind: Prometheus + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Values.prometheus.release }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} + {{- if $.Values.verticalPodScaling.labels }} +{{ toYaml $.Values.verticalPodScaling.labels | indent 4 }} + {{- end }} + {{- if $.Values.verticalPodScaling.annotations }} + annotations: +{{ toYaml $.Values.verticalPodScaling.annotations | indent 4 }} + {{- end }} +spec: +{{- if .Values.verticalPodScaling.resourcePolicy }} + resourcePolicy: +{{ toYaml .Values.verticalPodScaling.resourcePolicy}} +{{- end }} +{{- if .Values.verticalPodScaling.updatePolicy }} + updatePolicy: +{{ toYaml .Values.verticalPodScaling.updatePolicy}} +{{- end }} + targetRef: + apiVersion: argoproj.io/v1alpha1 + kind: Rollout + name: {{ include ".Chart.Name .fullname" $ }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/winter-soldier.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/winter-soldier.yaml new file mode 100644 index 0000000000..5ac2fd8443 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/templates/winter-soldier.yaml @@ -0,0 +1,45 @@ +{{- if .Values.winterSoldier.enabled }} +apiVersion: {{ $.Values.winterSoldier.apiVersion }} +kind: Hibernator +metadata: + {{- if .Values.winterSoldier.name }} + name: {{ .Values.winterSoldier.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-hibernator + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} + {{- if .Values.winterSoldier.labels }} +{{ toYaml .Values.winterSoldier.labels | indent 4 }} + {{- end }} +{{- if .Values.winterSoldier.annotations }} + annotations: +{{ toYaml .Values.winterSoldier.annotations | indent 4 }} +{{- end }} +spec: + timeRangesWithZone: +{{ toYaml $.Values.winterSoldier.timeRangesWithZone | indent 4}} + selectors: + - inclusions: + - objectSelector: + name: {{ include ".Chart.Name .fullname" $ }} + type: {{ .Values.winterSoldier.type | quote }} + fieldSelector: +{{toYaml $.Values.winterSoldier.fieldSelector | indent 14}} + namespaceSelector: + name: {{ $.Release.Namespace }} + exclusions: [] + action: {{ $.Values.winterSoldier.action }} + {{- if eq .Values.winterSoldier.action "scale" }} + {{- if .Values.winterSoldier.targetReplicas }} + targetReplicas: {{ $.Values.winterSoldier.targetReplicas }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/test_values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/test_values.yaml new file mode 100644 index 0000000000..97e72df42e --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/test_values.yaml @@ -0,0 +1,716 @@ +# Default values for myapp. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +rolloutLabels: + name: devops-team + Company: Devtron + Job: DevOps + +rolloutAnnotations: + name: devops-team + Company: Devtron + Job: DevOps + +containerSpec: + lifecycle: + enabled: true + preStop: + exec: + command: ["sleep","10"] + postStart: + httpGet: + host: example.com + path: /example + port: 90 + +imagePullSecrets: + - test1 + - test2 +replicaCount: 1 +MinReadySeconds: 5 +MaxSurge: 1 +MaxUnavailable: 0 +GracePeriod: 30 +ContainerPort: + - name: app + port: 8080 + servicePort: 8000 + envoyTimeout: 15 + targetPort: 8080 + envoyPort: 8799 + useHTTP2: false + protocol: UDP + supportStreaming: false + idleTimeout: 1800s + servicemonitor: + enabled: true + path: /abc + scheme: 'http' + interval: 30s + scrapeTimeout: 20s + metricRelabelings: + - sourceLabels: [namespace] + regex: '(.*)' + replacement: myapp + targetLabel: target_namespace + + - name: app1 + port: 8090 + targetPort: 1234 + servicePort: 8080 + useGRPC: true + servicemonitor: + enabled: true + - name: app2 + port: 8091 + servicePort: 8081 + useGRPC: true + +pauseForSecondsBeforeSwitchActive: 30 +waitForSecondsBeforeScalingDown: 30 +autoPromotionSeconds: 30 + +Spec: + Affinity: + Key: + # Key: kops.k8s.io/instancegroup + Values: + + +image: + pullPolicy: IfNotPresent + +autoscaling: + enabled: true + MinReplicas: 1 + MaxReplicas: 2 + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 + behavior: {} + containerResource: + enable: false + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 +# scaleDown: +# stabilizationWindowSeconds: 300 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# scaleUp: +# stabilizationWindowSeconds: 0 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# - type: Pods +# value: 4 +# periodSeconds: 15 +# selectPolicy: Max + + extraMetrics: [] +# - external: +# metricName: pubsub.googleapis.com|subscription|num_undelivered_messages +# metricSelector: +# matchLabels: +# resource.labels.subscription_id: echo-read +# targetAverageValue: "2" +# type: External +# + +secret: + enabled: false + +service: + type: ClusterIP + # name: "1234567890123456789012345678901234567890123456789012345678901234567890" + annotations: {} + # test1: test2 + # test3: test4 + sessionAffinity: + enabled: false + sessionAffinityConfig: {} + +server: + deployment: + image_tag: 1-95af053 + image: "" +deploymentType: "CANARY" + +topologySpreadConstraints: + - maxSkew: 1 + topologyKey: zone + whenUnsatisfiable: DoNotSchedule + autoLabelSelector: true + customLabelSelector: + foo: bar + +EnvVariables: + - name: FLASK_ENV + value: qa + +deployment: + strategy: + blueGreen: + autoPromotionSeconds: 30 + scaleDownDelaySeconds: 30 + previewReplicaCount: 1 + autoPromotionEnabled: false + rolling: + maxSurge: "25%" + maxUnavailable: 1 + canary: + maxSurge: 30% + maxUnavailable: 0 + stableService: api-svc + canaryService: canary-api-svc + steps: + - setCanaryScale: + weight: 25 + - setHeaderRoute: + name: api-canary + match: + - headerName: X-Version + headerValue: + prefix: v2 + - pause: + duration: 2m + - analysis: + templates: + - templateName: success-rate + args: + - name: service-name + value: canary-api-svc.api.svc.cluster.local + - setWeight: 50 + - pause: + duration: 2m + - analysis: + templates: + - templateName: success-rate + args: + - name: service-name + value: canary-api-svc.api.svc.cluster.local + - setWeight: 100 + - pause: {} # final manual approval (optional) + + trafficRouting: + # managedRoutes: + # - name: api-canary + istio: + virtualService: + name: api-vs + routes: + - api-svc + recreate: {} + +pipelineName: ci-axhbc + +analysis: + successfulRunHistoryLimit: 4 + unsuccessfulRunHistoryLimit: 3 + +appLabels: + hello: hii + hey: hello + +analysisTemplate: + enabled: true + templates: + - name: success-rate + annotations: {} + labels: {} + args: + - name: service-name + value: example-svc.default.svc.cluster.local + measurementRetention: + - limit: 34 + metricName: test + metrics: + - name: success-rate + interval: 5m + # NOTE: prometheus queries return results in the form of a vector. + # So it is common to access the index 0 of the returned array to obtain the value + successCondition: result[0] >= 0.95 + failureLimit: 3 + provider: + prometheus: + address: http://prometheus.example.com:9090 + query: | + sum(irate( + istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}",response_code!~"5.*"}[5m] + )) / + sum(irate( + istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}"}[5m] + )) + +LivenessProbe: + Path: / + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: + - name: Custom-Header + value: abc + - name: Custom-Header2 + value: xyz + +ReadinessProbe: + Path: / + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: + - name: Custom-Header + value: abc + +prometheus: + release: monitoring + +servicemonitor: + additionalLabels: {} + + +prometheusRule: + enabled: true + additionalLabels: {} + namespace: "" + rules: + # These are just examples rules, please adapt them to your needs + - alert: TooMany500s + expr: 100 * ( sum( nginx_ingress_controller_requests{status=~"5.+"} ) / sum(nginx_ingress_controller_requests) ) > 5 + for: 1m + labels: + severity: critical + annotations: + description: Too many 5XXs + summary: More than 5% of the all requests did return 5XX, this require your attention + - alert: TooMany400s + expr: 100 * ( sum( nginx_ingress_controller_requests{status=~"4.+"} ) / sum(nginx_ingress_controller_requests) ) > 5 + for: 1m + labels: + severity: critical + annotations: + description: Too many 4XXs + summary: More than 5% of the all requests did return 4XX, this require your attention + + +ingress: + enabled: true + className: nginx + annotations: {} +# nginx.ingress.kubernetes.io/rewrite-target: / +# nginx.ingress.kubernetes.io/ssl-redirect: "false" +# kubernetes.io/ingress.class: nginx +# kubernetes.io/tls-acme: "true" +# nginx.ingress.kubernetes.io/canary: "true" +# nginx.ingress.kubernetes.io/canary-weight: "10" +# Old Ingress Format +# host: "ingress-example.com" +# path: "/app" + +# New Ingress Format + hosts: + - host: chart-example1.local + pathType: "ImplementationSpecific" + paths: + - /example1 + - host: chart-example2.local + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + additionalBackends: + - path: /ingress + pathType: "ImplementationSpecific" + backend: + service: + name: test-service-ingress + port: + number: 80 + tls: [] +### Legacy Ingress Format ## +# host: abc.com +# path: "/" +# pathType: "ImplementationSpecific" + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +ingressInternal: + enabled: false + className: nginx-internal + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + # nginx.ingress.kubernetes.io/canary: "true" + # nginx.ingress.kubernetes.io/canary-weight: "10" + hosts: + - host: chart-example1.internal + pathType: "ImplementationSpecific" + paths: + - /example1 + - host: chart-example2.internal + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + additionalBackends: + - path: /ingress-internal + pathType: "ImplementationSpecific" + backend: + service: + name: test-service-internal + port: + number: 80 + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +dbMigrationConfig: + enabled: false + +command: + workingDir: /app + enabled: false + value: ["ls"] + +args: + enabled: false + value: [] + +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: + cpu: 1 + memory: 200Mi + requests: + cpu: 0.10 + memory: 100Mi + +volumeMounts: [] +# - name: log-volume +# mountPath: /var/log + +volumes: [] +# - name: log-volume +# emptyDir: {} + + +nodeSelector: {} + + +#used for deployment algo selection +orchestrator.deploymant.algo: 1 + +ConfigMaps: + enabled: false + maps: [] +# - name: config-map-1 +# type: environment +# external: false +# data: +# key1: key1value-1 +# key2: key2value-1 +# key3: key3value-1 +# - name: config-map-2 +# type: volume +# external: false +# mountPath: /etc/config/2 +# data: +# key1: | +# club : manchester utd +# nation : england +# key2: abc-2 +# key3: abc-2 +# - name: config-map-3 +# type: environment +# external: true +# mountPath: /etc/config/3 +# data: [] +# - name: config-map-4 +# type: volume +# external: true +# mountPath: /etc/config/4 +# data: [] + + +ConfigSecrets: + enabled: false + secrets: + - name: config-secret-1 + type: environment + external: false + externalType: AWSSecretsManager + esoSecretData: + secretStore: + aws: + service: SecretsManager + region: us-east-1 + auth: + secretRef: + accessKeyIDSecretRef: + name: awssm-secret + key: access-key + secretAccessKeySecretRef: + name: awssm-secret + key: secret-access-key + esoData: + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + data: + key1: key1value-1 + key2: key2value-1 + key3: key3value-1 + - name: config-secret-2 + type: environment + external: false + externalType: ESO_HashiCorpVault + esoSecretData: + secretStore: + vault: + server: "http://my.vault.server:8200" + path: "secret" + version: "v2" + auth: + tokenSecretRef: + name: vault-token + key: token + esoData: + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + date: + key1: key1value-1 + key2: key2value-1 + key3: key3value-1 + +# - name: config-secret-2 +# type: volume +# external: false +# mountPath: /etc/config/2 +# data: +# key1: | +# club : manchester utd +# nation : england +# key2: abc-2 + + +initContainers: + ## Additional init containers to run before the Scheduler pods. + ## for example, be used to run a sidecar that chown Logs storage . + - command: ["sh", "-c", "chown -R 1000:1000 logs"] + reuseContainerImage: true + volumeMounts: + - mountPath: /usr/local/airflow/logs + name: logs-data + securityContext: + privileged: true + runAsUser: 1000 + runAsGroup: 3000 + fsGroup: 2000 + - name: init-migrate + image: busybox:latest + command: ["sh", "-c", "chown -R 1000:1000 logs"] + volumeMounts: + - mountPath: /usr/local/airflow/logs + name: logs-data + securityContext: + capabilities: + drop: + - ALL + +containers: [] + ## Additional init containers to run before the Scheduler pods. + ## for example, be used to run a sidecar that chown Logs storage . + #- name: volume-mount-hack + # image: busybox + # command: ["sh", "-c", "chown -R 1000:1000 logs"] + # volumeMounts: + # - mountPath: /usr/local/airflow/logs +# name: logs-data + + +rawYaml: [] +# - apiVersion: v1 +# kind: Service +# metadata: +# annotations: +# labels: +# app: sample-metrics-app +# name: sample-metrics-app +# namespace: default +# spec: +# ports: +# - name: web +# port: 80 +# protocol: TCP +# targetPort: 8080 +# selector: +# app: sample-metrics-app +# sessionAffinity: None +# type: ClusterIP +# - apiVersion: v1 +# kind: Service +# metadata: +# annotations: +# labels: +# app: sample-metrics-app +# name: sample-metrics-app +# namespace: default +# spec: +# ports: +# - name: web +# port: 80 +# protocol: TCP +# targetPort: 8080 +# selector: +# app: sample-metrics-app +# sessionAffinity: None +# type: ClusterIP + +# If you need to provide some extra specs for main container which are not included by default in deployment template +# then provide them here +containerExtraSpecs: {} + +# If you need to provide some extra specs for pod which are not included by default in deployment template +# then provide them here +podExtraSpecs: {} + +envoyproxy: + image: envoyproxy/envoy:v1.14.1 + configMapName: "" + lifecycle: {} + resources: + limits: + cpu: 50m + memory: 50Mi + requests: + cpu: 50m + memory: 50Mi + readinessProbe: + path: / + livenessProbe: + path: / + +podDisruptionBudget: {} + # minAvailable: 1 + # maxUnavailable: 1 + + ## Node tolerations for server scheduling to nodes with taints + ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ +## + +tolerations: [] + # - key: "key" + # operator: "Equal|Exists" + # value: "value" +# effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" + +appMetrics: true +serviceAccount: + ## @param serviceAccount.create Enable creation of ServiceAccount for pods + ## + create: false + ## @param serviceAccount.name The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the `.Chart.Name .fullname` template + name: "test1" + ## @param serviceAccount.annotations Annotations for service account. Evaluated as a template. + ## Only used if `create` is `true`. + ## + annotations: + kubernetes.io/service-account.name: build-robot +containerSecurityContext: + allowPrivilegeEscalation: false +privileged: true +hostAliases: [] +# - ip: "127.0.0.1" +# hostnames: +# - "foo.local" + + + +verticalPodScaling: + enabled: false + +rollbackWindow: {} +schedulingGates: {} +deploymentType: CANARY + + +topologySpreadConstraints: {} + +istio: + enable: true + gateway: + enabled: true + labels: {} + annotations: {} + selector: + istiokj: sdkj + host: "istio.example.com" + tls: + enabled: true + secretName: "asjkj" + gatewayExtraSpec: {} + # selector: + # istio: "istio-1" + # servers: + # - port: + # number: 8080 + # name: http + # protocol: HTTP + # hosts: + # - "istio.example.com" + virtualService: + enabled: true + labels: {} + annotations: {} + gateways: + - sdkk + hosts: + - istio-2.exmap.com + - ksdj.sdkj.ckj + http: + - match: + - uri: + prefix: /v1 + - uri: + prefix: /v2 + timeout: 12 + headers: + request: + add: + x-some-header: "value" + retries: + attempts: 2 + perTryTimeout: 3s + virtualServiceExtraSpec: + tcp: + skldjlkjds: kdjjk diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/values.yaml new file mode 100644 index 0000000000..59220b01ad --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-1-0/values.yaml @@ -0,0 +1,668 @@ +# Default values for myapp. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 +MinReadySeconds: 5 +MaxSurge: 1 +MaxUnavailable: 0 +GracePeriod: 30 +ContainerPort: + - name: app + port: 8080 + servicePort: 80 + envoyPort: 8799 + envoyTimeout: 15s + useHTTP2: false + supportStreaming: false + idleTimeout: 1800s +# servicemonitor: +# enabled: true +# path: /abc +# scheme: 'http' +# interval: 30s +# scrapeTimeout: 20s +# metricRelabelings: +# - sourceLabels: [namespace] +# regex: '(.*)' +# replacement: myapp +# targetLabel: target_namespace + + - name: app1 + port: 8090 + servicePort: 8080 + useGRPC: true + +pauseForSecondsBeforeSwitchActive: 30 +waitForSecondsBeforeScalingDown: 30 +autoPromotionSeconds: 30 + +Spec: + Affinity: + Key: +# Key: kops.k8s.io/instancegroup + Values: + + +image: + pullPolicy: IfNotPresent + +restartPolicy: Always + +analysisTemplate: + enabled: false + templates: [] + # - name: success-rate + # annotations: {} + # labels: {} + # args: + # - name: service-name + # value: example-svc.default.svc.cluster.local + # measurementRetention: + # - limit: 34 + # metricName: test + # metrics: + # - name: success-rate + # interval: 5m + # # NOTE: prometheus queries return results in the form of a vector. + # # So it is common to access the index 0 of the returned array to obtain the value + # successCondition: result[0] >= 0.95 + # failureLimit: 3 + # provider: + # prometheus: + # address: http://prometheus.example.com:9090 + # query: | + # sum(irate( + # istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}",response_code!~"5.*"}[5m] + # )) / + # sum(irate( + # istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}"}[5m] + # )) + +autoscaling: + enabled: false + MinReplicas: 1 + MaxReplicas: 2 + # TargetCPUUtilizationPercentage: 90 + # TargetMemoryUtilizationPercentage: 80 + annotations: {} + labels: {} + behavior: {} + containerResource: + enable: false + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 +# scaleDown: +# stabilizationWindowSeconds: 300 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# scaleUp: +# stabilizationWindowSeconds: 0 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# - type: Pods +# value: 4 +# periodSeconds: 15 +# selectPolicy: Max + extraMetrics: [] +# - external: +# metricName: pubsub.googleapis.com|subscription|num_undelivered_messages +# metricSelector: +# matchLabels: +# resource.labels.subscription_id: echo-read +# targetAverageValue: "2" +# type: External +# + +kedaAutoscaling: + enabled: false + envSourceContainerName: "" # Optional. Default: .spec.template.spec.containers[0] + cooldownPeriod: 300 # Optional. Default: 300 seconds + minReplicaCount: 1 + maxReplicaCount: 2 + idleReplicaCount: 0 # Optional. Must be less than minReplicaCount + pollingInterval: 30 # Optional. Default: 30 seconds + # The fallback section is optional. It defines a number of replicas to fallback to if a scaler is in an error state. + fallback: {} # Optional. Section to specify fallback options + # failureThreshold: 3 # Mandatory if fallback section is included + # replicas: 6 + advanced: {} + # horizontalPodAutoscalerConfig: # Optional. Section to specify HPA related options + # behavior: # Optional. Use to modify HPA's scaling behavior + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Percent + # value: 100 + # periodSeconds: 15 + triggers: [] + triggerAuthentication: + enabled: false + name: "" + spec: {} + authenticationRef: {} + +secret: + enabled: false + +service: + enabled: true + type: ClusterIP +# name: "1234567890123456789012345678901234567890123456789012345678901234567890" + annotations: {} + # test1: test2 + # test3: test4 + sessionAffinity: + enabled: false + sessionAffinityConfig: {} + + +server: + deployment: + image_tag: 1-95af053 + image: "" + +EnvVariablesFromFieldPath: [] +# - name: POD_NAME +# fieldPath: metadata.name + +EnvVariables: [] + # - name: FLASK_ENV + # value: qa + +EnvVariablesFromSecretKeys: [] + # - name: ENV_NAME + # secretName: SECRET_NAME + # keyName: SECRET_KEY + +EnvVariablesFromConfigMapKeys: [] + # - name: ENV_NAME + # configMapName: CONFIG_MAP_NAME + # keyName: CONFIG_MAP_KEY + +LivenessProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + scheme: "" + httpHeaders: [] +# - name: Custom-Header +# value: abc + +ReadinessProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + scheme: "" + httpHeaders: [] +# - name: Custom-Header +# value: abc + +StartupProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: [] + command: [] + tcp: false + +prometheus: + release: monitoring + +servicemonitor: + additionalLabels: {} + + +prometheusRule: + enabled: false + additionalLabels: {} + namespace: "" +# rules: +# # These are just examples rules, please adapt them to your needs +# - alert: TooMany500s +# expr: 100 * ( sum( nginx_ingress_controller_requests{status=~"5.+"} ) / sum(nginx_ingress_controller_requests) ) > 5 +# for: 1m +# labels: +# severity: critical +# annotations: +# description: Too many 5XXs +# summary: More than 5% of the all requests did return 5XX, this require your attention +# - alert: TooMany400s +# expr: 100 * ( sum( nginx_ingress_controller_requests{status=~"4.+"} ) / sum(nginx_ingress_controller_requests) ) > 5 +# for: 1m +# labels: +# severity: critical +# annotations: +# description: Too many 4XXs +# summary: More than 5% of the all requests did return 4XX, this require your attention +# + +ingress: + enabled: false + className: "" + labels: {} + annotations: {} +# nginx.ingress.kubernetes.io/rewrite-target: / +# nginx.ingress.kubernetes.io/ssl-redirect: "false" +# kubernetes.io/ingress.class: nginx +# kubernetes.io/tls-acme: "true" +# nginx.ingress.kubernetes.io/canary: "true" +# nginx.ingress.kubernetes.io/canary-weight: "10" + + hosts: + - host: chart-example1.local + pathType: "ImplementationSpecific" + paths: + - /example1 + - host: chart-example2.local + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +ingressInternal: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + # nginx.ingress.kubernetes.io/canary: "true" + # nginx.ingress.kubernetes.io/canary-weight: "10" + + hosts: + - host: chart-example1.internal + pathType: "ImplementationSpecific" + paths: + - /example1 + - host: chart-example2.internal + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +istio: + enable: false + gateway: + enabled: false + labels: {} + annotations: {} + selector: {} + host: "" + tls: + enabled: false + secretName: "" + gatewayExtraSpec: {} + virtualService: + enabled: false + labels: {} + virtualServiceExtraSpec: {} + annotations: {} + gateways: [] + hosts: [] + http: [] + # - match: + # - uri: + # prefix: /v1 + # - uri: + # prefix: /v2 + # timeout: 12 + # headers: + # request: + # add: + # x-some-header: "value" + # retries: + # attempts: 2 + # perTryTimeout: 3s + destinationRule: + enabled: false + labels: {} + annotations: {} + subsets: [] + trafficPolicy: {} + peerAuthentication: + enabled: false + labels: {} + annotations: {} + selector: + enabled: false + mtls: + mode: "" + portLevelMtls: {} + requestAuthentication: + enabled: false + labels: {} + annotations: {} + selector: + enabled: false + jwtRules: [] + authorizationPolicy: + enabled: false + labels: {} + annotations: {} + action: + provider: {} + rules: [] + +networkPolicy: + enabled: false + annotations: {} + labels: {} + podSelector: + matchExpressions: [] + matchLabels: {} + policyTypes: [] + ingress: [] + egress: [] + +hibernator: + enable: false + +dbMigrationConfig: + enabled: false + +command: + enabled: false + value: [] + +args: + enabled: false + value: [] + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + +volumeMounts: [] +# - name: log-volume +# mountPath: /var/log + +volumes: [] +# - name: log-volume +# emptyDir: {} + + +nodeSelector: {} + +# If you need to provide some extra specs for pod which are not included by default in deployment template +# then provide them here +podExtraSpecs: {} + +# If you need to provide some extra specs for main container which are not included by default in deployment template +# then provide them here +containerExtraSpecs: {} + +#used for deployment algo selection +orchestrator.deploymant.algo: 1 + +ConfigMaps: + enabled: false + maps: [] +# - name: config-map-1 +# type: environment +# external: false +# data: +# key1: key1value-1 +# key2: key2value-1 +# key3: key3value-1 +# - name: config-map-2 +# type: volume +# external: false +# mountPath: /etc/config/2 +# data: +# key1: | +# club : manchester utd +# nation : england +# key2: abc-2 +# key3: abc-2 +# - name: config-map-3 +# type: environment +# external: true +# mountPath: /etc/config/3 +# data: [] +# - name: config-map-4 +# type: volume +# external: true +# mountPath: /etc/config/4 +# data: [] + + +ConfigSecrets: + enabled: false + secrets: [] +# - name: config-secret-1 +# type: environment +# external: false +# data: +# key1: key1value-1 +# key2: key2value-1 +# key3: key3value-1 +# - name: config-secret-2 +# type: volume +# external: false +# mountPath: /etc/config/2 +# data: +# key1: | +# club : manchester utd +# nation : england +# key2: abc-2 + + +initContainers: [] + ## Additional init containers to run before the Scheduler pods. + ## for example, be used to run a sidecar that chown Logs storage . + # - name: volume-mount-hack + # image: busybox + # command: ["sh", "-c", "chown -R 1000:1000 logs"] + # volumeMounts: + # - mountPath: /usr/local/airflow/logs + # name: logs-data + # # Uncomment below line ONLY IF you want to reuse the container image. + # # This will assign your application's docker image to init container. + # reuseContainerImage: true + +containers: [] + ## Additional init containers to run before the Scheduler pods. + ## for example, be used to run a sidecar that chown Logs storage . + #- name: volume-mount-hack + # image: busybox + # command: ["sh", "-c", "chown -R 1000:1000 logs"] + # volumeMounts: + # - mountPath: /usr/local/airflow/logs + # name: logs-data + + +rawYaml: [] +# - apiVersion: v1 +# kind: Service +# metadata: +# annotations: +# labels: +# app: sample-metrics-app +# name: sample-metrics-app +# namespace: default +# spec: +# ports: +# - name: web +# port: 80 +# protocol: TCP +# targetPort: 8080 +# selector: +# app: sample-metrics-app +# sessionAffinity: None +# type: ClusterIP +# - apiVersion: v1 +# kind: Service +# metadata: +# annotations: +# labels: +# app: sample-metrics-app +# name: sample-metrics-app +# namespace: default +# spec: +# ports: +# - name: web +# port: 80 +# protocol: TCP +# targetPort: 8080 +# selector: +# app: sample-metrics-app +# sessionAffinity: None +# type: ClusterIP + +winterSoldier: + enabled: false + apiVersion: pincher.devtron.ai/v1alpha1 + labels: {} + annotations: {} + timeRangesWithZone: {} + # timeZone: "Asia/Kolkata" + # timeRanges: [] + action: sleep + targetReplicas: [] + fieldSelector: [] + type: Rollout + # - AfterTime(AddTime(ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '5m'), Now()) + +topologySpreadConstraints: [] + +schedulerName: "" + +envoyproxy: + image: docker.io/envoyproxy/envoy:v1.16.0 + lifecycle: {} + configMapName: "" + resources: + limits: + cpu: 50m + memory: 50Mi + requests: + cpu: 50m + memory: 50Mi + +ambassadorMapping: + enabled: false + # labels: + # key1: value1 + # prefix: / + # ambassadorId: 1234 + # hostname: devtron.example.com + # rewrite: /foo/ + # retryPolicy: + # retry_on: "5xx" + # num_retries: 10 + # cors: + # origins: http://foo.example,http://bar.example + # methods: POST, GET, OPTIONS + # headers: Content-Type + # credentials: true + # exposed_headers: X-Custom-Header + # max_age: "86400" + # weight: 10 + # method: GET + # extraSpec: + # method_regex: true + # headers: + # x-quote-mode: backend + # x-random-header: devtron + # tls: + # context: httpd-context + # create: true + # secretName: httpd-secret + # hosts: + # - anything.example.info + # - devtron.example.com + # extraSpec: + # min_tls_version: v1.2 + +containerSpec: + lifecycle: + enabled: false + preStop: {} +# exec: +# command: ["sleep","10"] + postStart: {} +# httpGet: +# host: example.com +# path: /example +# port: 90 + +podDisruptionBudget: {} +# minAvailable: 1 +# maxUnavailable: 1 + + ## Node tolerations for server scheduling to nodes with taints + ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + ## + +podSecurityContext: {} + # runAsUser: 1000 + # runAsGroup: 3000 + # fsGroup: 2000 + +containerSecurityContext: {} + # allowPrivilegeEscalation: false +## Pods Service Account +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ +## +serviceAccount: + ## @param serviceAccount.create Enable creation of ServiceAccount for pods + ## + create: false + ## @param serviceAccount.name The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the `.Chart.Name .fullname` template + name: "" + ## @param serviceAccount.annotations Annotations for service account. Evaluated as a template. + ## Only used if `create` is `true`. + ## + annotations: {} + +tolerations: [] + # - key: "key" + # operator: "Equal|Exists" + # value: "value" + # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" + +imagePullSecrets: [] + # - test1 + # - test2 + +persistentVolumeClaim: {} + + +affinity: + enabled: false + values: {} + +verticalPodScaling: + enabled: false + +rollbackWindow: {} +schedulingGates: {} + +customPodLabels: {} \ No newline at end of file diff --git a/scripts/sql/32603301_reference-5-1-0.down.sql b/scripts/sql/32603301_reference-5-1-0.down.sql new file mode 100644 index 0000000000..71555059ee --- /dev/null +++ b/scripts/sql/32603301_reference-5-1-0.down.sql @@ -0,0 +1,5 @@ +DELETE FROM global_strategy_metadata_chart_ref_mapping WHERE chart_ref_id=(select id from chart_ref where version='5.1.0' and name is null); + +DELETE FROM "public"."chart_ref" WHERE ("location" = 'reference-chart_5-1-0' AND "version" = '5.1.0'); + +UPDATE "public"."chart_ref" SET "is_default" = 't' WHERE "location" = 'reference-chart_5-1-0' AND "version" = '5.1.0'; \ No newline at end of file diff --git a/scripts/sql/32603301_reference-5-1-0.up.sql b/scripts/sql/32603301_reference-5-1-0.up.sql new file mode 100644 index 0000000000..3b8b01530f --- /dev/null +++ b/scripts/sql/32603301_reference-5-1-0.up.sql @@ -0,0 +1,9 @@ +INSERT INTO "public"."chart_ref" ("location", "version","deployment_strategy_path", "is_default", "active", "created_on", "created_by", "updated_on", "updated_by") VALUES + ('reference-chart_5-1-0', '5.1.0','pipeline-values.yaml', 'f', 't', 'now()', 1, 'now()', 1); + + +INSERT INTO global_strategy_metadata_chart_ref_mapping ("global_strategy_metadata_id", "chart_ref_id", "active", "created_on", "created_by", "updated_on", "updated_by","default") +VALUES (1,(select id from chart_ref where version='5.1.0' and name is null), true, now(), 1, now(), 1,true), +(2,(select id from chart_ref where version='5.1.0' and name is null), true, now(), 1, now(), 1,false), +(3,(select id from chart_ref where version='5.1.0' and name is null), true, now(), 1, now(), 1,false), +(4,(select id from chart_ref where version='5.1.0' and name is null), true, now(), 1, now(), 1,false); \ No newline at end of file From c6022e78192715e684746a68e5b15215346bdd7d Mon Sep 17 00:00:00 2001 From: Rupin Solanki Date: Thu, 15 May 2025 14:29:15 +0530 Subject: [PATCH 08/16] updated down script --- scripts/sql/32603301_reference-5-1-0.down.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sql/32603301_reference-5-1-0.down.sql b/scripts/sql/32603301_reference-5-1-0.down.sql index 71555059ee..726234b13e 100644 --- a/scripts/sql/32603301_reference-5-1-0.down.sql +++ b/scripts/sql/32603301_reference-5-1-0.down.sql @@ -2,4 +2,4 @@ DELETE FROM global_strategy_metadata_chart_ref_mapping WHERE chart_ref_id=(selec DELETE FROM "public"."chart_ref" WHERE ("location" = 'reference-chart_5-1-0' AND "version" = '5.1.0'); -UPDATE "public"."chart_ref" SET "is_default" = 't' WHERE "location" = 'reference-chart_5-1-0' AND "version" = '5.1.0'; \ No newline at end of file +UPDATE "public"."chart_ref" SET "is_default" = 't' WHERE "location" = 'deployment-chart_4-20-0' AND "version" = '4.20.0'; \ No newline at end of file From bcf51254b7ba40683c698e9a42c676ed3416fcb8 Mon Sep 17 00:00:00 2001 From: Rupin Solanki Date: Thu, 15 May 2025 15:18:32 +0530 Subject: [PATCH 09/16] updated sql script --- scripts/sql/32603301_reference-5-1-0.down.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/sql/32603301_reference-5-1-0.down.sql b/scripts/sql/32603301_reference-5-1-0.down.sql index 726234b13e..7b540d7768 100644 --- a/scripts/sql/32603301_reference-5-1-0.down.sql +++ b/scripts/sql/32603301_reference-5-1-0.down.sql @@ -1,5 +1,3 @@ DELETE FROM global_strategy_metadata_chart_ref_mapping WHERE chart_ref_id=(select id from chart_ref where version='5.1.0' and name is null); -DELETE FROM "public"."chart_ref" WHERE ("location" = 'reference-chart_5-1-0' AND "version" = '5.1.0'); - -UPDATE "public"."chart_ref" SET "is_default" = 't' WHERE "location" = 'deployment-chart_4-20-0' AND "version" = '4.20.0'; \ No newline at end of file +DELETE FROM "public"."chart_ref" WHERE ("location" = 'reference-chart_5-1-0' AND "version" = '5.1.0'); \ No newline at end of file From ccae0023d2d79b81cfa4e4634be2f0021de0b058 Mon Sep 17 00:00:00 2001 From: Shivam Nagar <124123645+Shivam-nagar23@users.noreply.github.com> Date: Fri, 16 May 2025 11:24:39 +0530 Subject: [PATCH 10/16] stack manager break fix (#6577) --- pkg/server/ServerCacheService.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/server/ServerCacheService.go b/pkg/server/ServerCacheService.go index b70d18a4b2..9a5c2384d7 100644 --- a/pkg/server/ServerCacheService.go +++ b/pkg/server/ServerCacheService.go @@ -77,6 +77,8 @@ func (impl *ServerCacheServiceImpl) UpdateServerEnvAndDataStore() error { impl.serverEnvConfig.ErrorEncounteredOnGettingDevtronHelmRelease = err // return nil, err // not returning the error as it will bring down orchestrator + } else { + impl.serverEnvConfig.ErrorEncounteredOnGettingDevtronHelmRelease = nil } // if not installed, treat it as OSS kubectl user From a92dcd58f93cd102553a423e4b9a3ce0cabf996e Mon Sep 17 00:00:00 2001 From: dheeth Date: Fri, 16 May 2025 11:52:03 +0530 Subject: [PATCH 11/16] Sync ref charts --- .../deployment-chart_4-21-0/.helmignore | 22 + .../.image_descriptor_template.json | 1 + .../deployment-chart_4-21-0/Chart.yaml | 5 + .../deployment-chart_4-21-0/README.md | 991 ++++++++++++ .../deployment-chart_4-21-0/app-values.yaml | 530 +++++++ .../deployment-chart_4-21-0/env-values.yaml | 66 + .../pipeline-values.yaml | 6 + .../release-values.yaml | 14 + .../deployment-chart_4-21-0/schema.json | 1368 +++++++++++++++++ .../secrets-test-values.yaml | 1 + .../templates/NOTES.txt | 19 + .../templates/_helpers.tpl | 167 ++ .../templates/ambassador.yaml | 94 ++ .../templates/configmap.yaml | 22 + .../templates/deployment.yaml | 1262 +++++++++++++++ .../templates/externalsecrets.yaml | 76 + .../templates/flagger.yaml | 164 ++ .../templates/generic.yaml | 4 + .../templates/hpa.yaml | 177 +++ .../templates/ingress.yaml | 188 +++ .../templates/istio-authorizationpolicy.yaml | 41 + .../templates/istio-destinationrule.yaml | 38 + .../templates/istio-gateway.yaml | 71 + .../templates/istio-peerauthentication.yaml | 40 + .../istio-requestauthentication.yaml | 38 + .../templates/istio-virtualservice.yaml | 68 + .../templates/keda-autoscaling.yaml | 78 + .../templates/metrics-service-monitor.yaml | 35 + .../templates/networkpolicy.yaml | 52 + .../templates/persistent-volume-claim.yaml | 24 + .../templates/poddisruptionbudget.yaml | 38 + .../templates/pre-sync-job.yaml | 29 + .../templates/prometheusrules.yaml | 33 + .../templates/secret.yaml | 84 + .../templates/service.yaml | 106 ++ .../templates/serviceaccount.yaml | 21 + .../templates/servicemonitor.yaml | 117 ++ .../templates/sidecar-configmap.yaml | 169 ++ .../templates/vertical-pod-autoscaler.yaml | 34 + .../templates/winter-soldier.yaml | 45 + .../deployment-chart_4-21-0/test-values.json | 292 ++++ .../deployment-chart_4-21-0/test_values.yaml | 782 ++++++++++ .../deployment-chart_4-21-0/values.yaml | 718 +++++++++ .../templates/statefulset.yaml | 72 +- 44 files changed, 8143 insertions(+), 59 deletions(-) create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/.helmignore create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/.image_descriptor_template.json create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/Chart.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/README.md create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/app-values.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/env-values.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/pipeline-values.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/release-values.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/schema.json create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/secrets-test-values.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/NOTES.txt create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/_helpers.tpl create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/ambassador.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/configmap.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/deployment.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/externalsecrets.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/flagger.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/generic.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/hpa.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/ingress.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-authorizationpolicy.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-destinationrule.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-gateway.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-peerauthentication.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-requestauthentication.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-virtualservice.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/keda-autoscaling.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/metrics-service-monitor.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/networkpolicy.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/persistent-volume-claim.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/poddisruptionbudget.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/pre-sync-job.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/prometheusrules.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/secret.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/service.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/serviceaccount.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/servicemonitor.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/sidecar-configmap.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/vertical-pod-autoscaler.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/winter-soldier.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/test-values.json create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/test_values.yaml create mode 100644 scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/values.yaml diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/.helmignore b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/.helmignore new file mode 100644 index 0000000000..50af031725 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/.image_descriptor_template.json b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/.image_descriptor_template.json new file mode 100644 index 0000000000..8a99a95664 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/.image_descriptor_template.json @@ -0,0 +1 @@ +{"server":{"deployment":{"image_tag":"{{.Tag}}","image":"{{.Name}}"}},"pipelineName": "{{.PipelineName}}","releaseVersion":"{{.ReleaseVersion}}","deploymentType": "{{.DeploymentType}}", "app": "{{.App}}", "env": "{{.Env}}", "appMetrics": {{.AppMetrics}}} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/Chart.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/Chart.yaml new file mode 100644 index 0000000000..f4464a7e5b --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: A Helm chart for Kubernetes +name: deployment-chart_4-21-0 +version: 4.21.0 diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/README.md b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/README.md new file mode 100644 index 0000000000..07f18f2885 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/README.md @@ -0,0 +1,991 @@ + +# Deployment Chart - v4.21.0 + +## 1. Yaml File - + +### Container Ports + +This defines ports on which application services will be exposed to other services + +```yaml +ContainerPort: + - envoyPort: 8799 + idleTimeout: + name: app + port: 8080 + servicePort: 80 + nodePort: 32056 + supportStreaming: true + useHTTP2: true + protocol: TCP +``` + +| Key | Description | +| :--- | :--- | +| `envoyPort` | envoy port for the container. | +| `idleTimeout` | the duration of time that a connection is idle before the connection is terminated. | +| `name` | name of the port. | +| `port` | port for the container. | +| `servicePort` | port of the corresponding kubernetes service. | +| `nodePort` | nodeport of the corresponding kubernetes service. | +| `supportStreaming` | Used for high performance protocols like grpc where timeout needs to be disabled. | +| `useHTTP2` | Envoy container can accept HTTP2 requests. | +| `protocol` | Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP"| + +### EnvVariables +```yaml +EnvVariables: [] +``` +To set environment variables for the containers that run in the Pod. +### EnvVariablesFromSecretKeys +```yaml +EnvVariablesFromSecretKeys: + - name: ENV_NAME + secretName: SECRET_NAME + keyName: SECRET_KEY + +``` + It is use to get the name of Environment Variable name, Secret name and the Key name from which we are using the value in that corresponding Environment Variable. + + ### EnvVariablesFromConfigMapKeys +```yaml +EnvVariablesFromConfigMapKeys: + - name: ENV_NAME + configMapName: CONFIG_MAP_NAME + keyName: CONFIG_MAP_KEY + +``` + It is use to get the name of Environment Variable name, Config Map name and the Key name from which we are using the value in that corresponding Environment Variable. + +### Liveness Probe + +If this check fails, kubernetes restarts the pod. This should return error code in case of non-recoverable error. + +```yaml +LivenessProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: + - name: Custom-Header + value: abc + scheme: "" + tcp: true + grpc: + port: 8080 + service: "" +``` + +| Key | Description | +| :--- | :--- | +| `Path` | It define the path where the liveness needs to be checked. | +| `initialDelaySeconds` | It defines the time to wait before a given container is checked for liveliness. | +| `periodSeconds` | It defines the time to check a given container for liveness. | +| `successThreshold` | It defines the number of successes required before a given container is said to fulfil the liveness probe. | +| `timeoutSeconds` | It defines the time for checking timeout. | +| `failureThreshold` | It defines the maximum number of failures that are acceptable before a given container is not considered as live. | +| `httpHeaders` | Custom headers to set in the request. HTTP allows repeated headers,You can override the default headers by defining .httpHeaders for the probe. | +| `scheme` | Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP. +| `tcp` | The kubelet will attempt to open a socket to your container on the specified port. If it can establish a connection, the container is considered healthy. | +| `grpc` | GRPC specifies an action involving a GRPC port. Port is a required field if using gRPC service for health probes. Number must be in the range 1 to 65535. Service (optional) is the name of the service to place in the gRPC HealthCheckRequest. | + + + +### MaxUnavailable + +```yaml + MaxUnavailable: 0 +``` +The maximum number of pods that can be unavailable during the update process. The value of "MaxUnavailable: " can be an absolute number or percentage of the replicas count. The default value of "MaxUnavailable: " is 25%. + +### MaxSurge + +```yaml +MaxSurge: 1 +``` +The maximum number of pods that can be created over the desired number of pods. For "MaxSurge: " also, the value can be an absolute number or percentage of the replicas count. +The default value of "MaxSurge: " is 25%. + +### Min Ready Seconds + +```yaml +MinReadySeconds: 60 +``` +This specifies the minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available. This defaults to 0 (the Pod will be considered available as soon as it is ready). + +### Readiness Probe + +If this check fails, kubernetes stops sending traffic to the application. This should return error code in case of errors which can be recovered from if traffic is stopped. + +```yaml +ReadinessProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: + - name: Custom-Header + value: abc + scheme: "" + tcp: true + grpc: + port: 8080 + service: "" +``` + +| Key | Description | +| :--- | :--- | +| `Path` | It define the path where the readiness needs to be checked. | +| `initialDelaySeconds` | It defines the time to wait before a given container is checked for readiness. | +| `periodSeconds` | It defines the time to check a given container for readiness. | +| `successThreshold` | It defines the number of successes required before a given container is said to fulfill the readiness probe. | +| `timeoutSeconds` | It defines the time for checking timeout. | +| `failureThreshold` | It defines the maximum number of failures that are acceptable before a given container is not considered as ready. | +| `httpHeaders` | Custom headers to set in the request. HTTP allows repeated headers,You can override the default headers by defining .httpHeaders for the probe. | +| `scheme` | Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP. +| `tcp` | The kubelet will attempt to open a socket to your container on the specified port. If it can establish a connection, the container is considered healthy. | +| `grpc` | GRPC specifies an action involving a GRPC port. Port is a required field if using gRPC service for health probes. Number must be in the range 1 to 65535. Service (optional) is the name of the service to place in the gRPC HealthCheckRequest. | + + +### Pod Disruption Budget + +You can create `PodDisruptionBudget` for each application. A PDB limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, an application would like to ensure the number of replicas running is never brought below the certain number. + +```yaml +podDisruptionBudget: + minAvailable: 1 +``` + +or + +```yaml +podDisruptionBudget: + maxUnavailable: 50% +``` + +You can specify either `maxUnavailable` or `minAvailable` in a PodDisruptionBudget and it can be expressed as integers or as a percentage + +| Key | Description | +| :--- | :--- | +| `minAvailable` | Evictions are allowed as long as they leave behind 1 or more healthy pods of the total number of desired replicas. | +| `maxUnavailable` | Evictions are allowed as long as at most 1 unhealthy replica among the total number of desired replicas. | + +### Ambassador Mappings + +You can create ambassador mappings to access your applications from outside the cluster. At its core a Mapping resource maps a resource to a service. + +```yaml +ambassadorMapping: + ambassadorId: "prod-emissary" + cors: {} + enabled: true + hostname: devtron.example.com + labels: {} + prefix: / + retryPolicy: {} + rewrite: "" + tls: + context: "devtron-tls-context" + create: false + hosts: [] + secretName: "" +``` + +| Key | Description | +| :--- | :--- | +| `enabled` | Set true to enable ambassador mapping else set false.| +| `ambassadorId` | used to specify id for specific ambassador mappings controller. | +| `cors` | used to specify cors policy to access host for this mapping. | +| `weight` | used to specify weight for canary ambassador mappings. | +| `hostname` | used to specify hostname for ambassador mapping. | +| `prefix` | used to specify path for ambassador mapping. | +| `labels` | used to provide custom labels for ambassador mapping. | +| `retryPolicy` | used to specify retry policy for ambassador mapping. | +| `corsPolicy` | Provide cors headers on flagger resource. | +| `rewrite` | used to specify whether to redirect the path of this mapping and where. | +| `tls` | used to create or define ambassador TLSContext resource. | +| `extraSpec` | used to provide extra spec values which not present in deployment template for ambassador resource. | + +### Autoscaling + +This is connected to HPA and controls scaling up and down in response to request load. + +```yaml +autoscaling: + enabled: false + MinReplicas: 1 + MaxReplicas: 2 + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 + containerResource: + enabled: true + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 + + extraMetrics: [] +``` + +| Key | Description | +| :--- | :--- | +| `enabled` | Set true to enable autoscaling else set false.| +| `MinReplicas` | Minimum number of replicas allowed for scaling. | +| `MaxReplicas` | Maximum number of replicas allowed for scaling. | +| `TargetCPUUtilizationPercentage` | The target CPU utilization that is expected for a container. | +| `TargetMemoryUtilizationPercentage` | The target memory utilization that is expected for a container. | +| `extraMetrics` | Used to give external metrics for autoscaling. | +| `containerResource` | Used to scale resource as per container resource. | + +### Flagger + +You can use flagger for canary releases with deployment objects. It supports flexible traffic routing with istio service mesh as well. + +```yaml +flaggerCanary: + addOtherGateways: [] + addOtherHosts: [] + analysis: + interval: 15s + maxWeight: 50 + stepWeight: 5 + threshold: 5 + annotations: {} + appProtocol: http + corsPolicy: + allowCredentials: false + allowHeaders: + - x-some-header + allowMethods: + - GET + allowOrigin: + - example.com + maxAge: 24h + createIstioGateway: + annotations: {} + enabled: false + host: example.com + labels: {} + tls: + enabled: false + secretName: example-tls-secret + enabled: false + gatewayRefs: null + headers: + request: + add: + x-some-header: value + labels: {} + loadtest: + enabled: true + url: http://flagger-loadtester.istio-system/ + match: + - uri: + prefix: / + port: 8080 + portDiscovery: true + retries: null + rewriteUri: / + targetPort: 8080 + thresholds: + latency: 500 + successRate: 90 + timeout: null +``` + +| Key | Description | +| :--- | :--- | +| `enabled` | Set true to enable canary releases using flagger else set false.| +| `addOtherGateways` | To provide multiple istio gateways for flagger. | +| `addOtherHosts` | Add multiple hosts for istio service mesh with flagger. | +| `analysis` | Define how the canary release should progresss and at what interval. | +| `annotations` | Annotation to add on flagger resource. | +| `labels` | Labels to add on flagger resource. | +| `appProtocol` | Protocol to use for canary. | +| `corsPolicy` | Provide cors headers on flagger resource. | +| `createIstioGateway` | Set to true if you want to create istio gateway as well with flagger. | +| `headers` | Add headers if any. | +| `loadtest` | Enable load testing for your canary release. | + + + +### Fullname Override + +```yaml +fullnameOverride: app-name +``` +`fullnameOverride` replaces the release fullname created by default by devtron, which is used to construct Kubernetes object names. By default, devtron uses {app-name}-{environment-name} as release fullname. + +### Image + +```yaml +image: + pullPolicy: IfNotPresent +``` + +Image is used to access images in kubernetes, pullpolicy is used to define the instances calling the image, here the image is pulled when the image is not present,it can also be set as "Always". + +### imagePullSecrets + +`imagePullSecrets` contains the docker credentials that are used for accessing a registry. + +```yaml +imagePullSecrets: + - regcred +``` +regcred is the secret that contains the docker credentials that are used for accessing a registry. Devtron will not create this secret automatically, you'll have to create this secret using dt-secrets helm chart in the App store or create one using kubectl. You can follow this documentation Pull an Image from a Private Registry [https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) . + +### Ingress + +This allows public access to the url, please ensure you are using right nginx annotation for nginx class, its default value is nginx + +```yaml +ingress: + enabled: false + # For K8s 1.19 and above use ingressClassName instead of annotation kubernetes.io/ingress.class: + className: nginx + annotations: {} + hosts: + - host: example1.com + paths: + - /example + - host: example2.com + paths: + - /example2 + - /example2/healthz + tls: [] +``` +Legacy deployment-template ingress format + +```yaml +ingress: + enabled: false + # For K8s 1.19 and above use ingressClassName instead of annotation kubernetes.io/ingress.class: + ingressClassName: nginx-internal + annotations: {} + path: "" + host: "" + tls: [] +``` + +| Key | Description | +| :--- | :--- | +| `enabled` | Enable or disable ingress | +| `annotations` | To configure some options depending on the Ingress controller | +| `path` | Path name | +| `host` | Host name | +| `tls` | It contains security details | + +### Ingress Internal + +This allows private access to the url, please ensure you are using right nginx annotation for nginx class, its default value is nginx + +```yaml +ingressInternal: + enabled: false + # For K8s 1.19 and above use ingressClassName instead of annotation kubernetes.io/ingress.class: + ingressClassName: nginx-internal + annotations: {} + hosts: + - host: example1.com + paths: + - /example + - host: example2.com + paths: + - /example2 + - /example2/healthz + tls: [] +``` + +| Key | Description | +| :--- | :--- | +| `enabled` | Enable or disable ingress | +| `annotations` | To configure some options depending on the Ingress controller | +| `path` | Path name | +| `host` | Host name | +| `tls` | It contains security details | + +### additionalBackends + +This defines additional backend path in the ingress . + +```yaml + hosts: + - host: chart-example2.local + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + additionalBackends: + - path: /example1 + pathType: "ImplementationSpecific" + backend: + service: + name: test-service + port: + number: 80 +``` + +### Init Containers +```yaml +initContainers: + - reuseContainerImage: true + securityContext: + runAsUser: 1000 + runAsGroup: 3000 + fsGroup: 2000 + volumeMounts: + - mountPath: /etc/ls-oms + name: ls-oms-cm-vol + args: + - sleep 300 + command: + - flyway + - -configFiles=/etc/ls-oms/flyway.conf + - migrate + + - name: nginx + image: nginx:1.14.2 + securityContext: + privileged: true + ports: + - containerPort: 80 + command: ["/usr/local/bin/nginx"] + args: ["-g", "daemon off;"] +``` +Specialized containers that run before app containers in a Pod. Init containers can contain utilities or setup scripts not present in an app image. One can use base image inside initContainer by setting the reuseContainerImage flag to `true`. + +### Istio + +Istio is a service mesh which simplifies observability, traffic management, security and much more with it's virtual services and gateways. + +```yaml +istio: + enable: true + gateway: + annotations: {} + enabled: false + host: example.com + labels: {} + tls: + enabled: false + secretName: example-tls-secret + virtualService: + annotations: {} + enabled: false + gateways: [] + hosts: [] + http: + - corsPolicy: + allowCredentials: false + allowHeaders: + - x-some-header + allowMethods: + - GET + allowOrigin: + - example.com + maxAge: 24h + headers: + request: + add: + x-some-header: value + match: + - uri: + prefix: /v1 + - uri: + prefix: /v2 + retries: + attempts: 2 + perTryTimeout: 3s + rewriteUri: / + route: + - destination: + host: service1 + port: 80 + timeout: 12s + - route: + - destination: + host: service2 + labels: {} +``` + +### Pause For Seconds Before Switch Active +```yaml +pauseForSecondsBeforeSwitchActive: 30 +``` +To wait for given period of time before switch active the container. + +### Resources + +These define minimum and maximum RAM and CPU available to the application. + +```yaml +resources: + limits: + cpu: "1" + memory: "200Mi" + requests: + cpu: "0.10" + memory: "100Mi" +``` + +Resources are required to set CPU and memory usage. + +#### Limits + +Limits make sure a container never goes above a certain value. The container is only allowed to go up to the limit, and then it is restricted. + +#### Requests + +Requests are what the container is guaranteed to get. + +### Service + +This defines annotations and the type of service, optionally can define name also. + +Supports "ClientIP" and "None". Used to maintain session affinity. Enable + client IP based session affinity. + +```yaml + service: + type: ClusterIP + annotations: {} + sessionAffinity: + enabled: true + sessionAffinityConfig: {} +``` + +### Volumes + +```yaml +volumes: + - name: log-volume + emptyDir: {} + - name: logpv + persistentVolumeClaim: + claimName: logpvc +``` + +It is required when some values need to be read from or written to an external disk. + +### Volume Mounts + +```yaml +volumeMounts: + - mountPath: /var/log/nginx/ + name: log-volume + - mountPath: /mnt/logs + name: logpvc + subPath: employee +``` + +It is used to provide mounts to the volume. + +### Affinity and anti-affinity + +```yaml +Spec: + Affinity: + Key: + Values: +``` + +Spec is used to define the desire state of the given container. + +Node Affinity allows you to constrain which nodes your pod is eligible to schedule on, based on labels of the node. + +Inter-pod affinity allow you to constrain which nodes your pod is eligible to be scheduled based on labels on pods. + +#### Key + +Key part of the label for node selection, this should be same as that on node. Please confirm with devops team. + +#### Values + +Value part of the label for node selection, this should be same as that on node. Please confirm with devops team. + +### Tolerations + +```yaml +tolerations: + - key: "key" + operator: "Equal" + value: "value" + effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" +``` + +Taints are the opposite, they allow a node to repel a set of pods. + +A given pod can access the given node and avoid the given taint only if the given pod satisfies a given taint. + +Taints and tolerations are a mechanism which work together that allows you to ensure that pods are not placed on inappropriate nodes. Taints are added to nodes, while tolerations are defined in the pod specification. When you taint a node, it will repel all the pods except those that have a toleration for that taint. A node can have one or many taints associated with it. + +### Arguments + +```yaml +args: + enabled: false + value: [] +``` + +This is used to give arguments to command. + +### Command + +```yaml +command: + enabled: false + value: [] +``` + +It contains the commands for the server. + +| Key | Description | +| :--- | :--- | +| `enabled` | To enable or disable the command. | +| `value` | It contains the commands. | + + +### Containers +Containers section can be used to run side-car containers along with your main container within same pod. Containers running within same pod can share volumes and IP Address and can address each other @localhost. We can use base image inside container by setting the reuseContainerImage flag to `true`. + +```yaml + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 + command: ["/usr/local/bin/nginx"] + args: ["-g", "daemon off;"] + - reuseContainerImage: true + securityContext: + runAsUser: 1000 + runAsGroup: 3000 + fsGroup: 2000 + volumeMounts: + - mountPath: /etc/ls-oms + name: ls-oms-cm-vol + command: + - flyway + - -configFiles=/etc/ls-oms/flyway.conf + - migrate +``` + +### Prometheus + +```yaml + prometheus: + release: monitoring +``` + +It is a kubernetes monitoring tool and the name of the file to be monitored as monitoring in the given case.It describes the state of the prometheus. + +### rawYaml + +```yaml +rawYaml: + - apiVersion: v1 + kind: Service + metadata: + name: my-service + spec: + selector: + app: MyApp + ports: + - protocol: TCP + port: 80 + targetPort: 9376 + type: ClusterIP +``` +Accepts an array of Kubernetes objects. You can specify any kubernetes yaml here and it will be applied when your app gets deployed. + +### Grace Period + +```yaml +GracePeriod: 30 +``` +Kubernetes waits for the specified time called the termination grace period before terminating the pods. By default, this is 30 seconds. If your pod usually takes longer than 30 seconds to shut down gracefully, make sure you increase the `GracePeriod`. + +A Graceful termination in practice means that your application needs to handle the SIGTERM message and begin shutting down when it receives it. This means saving all data that needs to be saved, closing down network connections, finishing any work that is left, and other similar tasks. + +There are many reasons why Kubernetes might terminate a perfectly healthy container. If you update your deployment with a rolling update, Kubernetes slowly terminates old pods while spinning up new ones. If you drain a node, Kubernetes terminates all pods on that node. If a node runs out of resources, Kubernetes terminates pods to free those resources. It’s important that your application handle termination gracefully so that there is minimal impact on the end user and the time-to-recovery is as fast as possible. + + +### Server + +```yaml +server: + deployment: + image_tag: 1-95a53 + image: "" +``` + +It is used for providing server configurations. + +#### Deployment + +It gives the details for deployment. + +| Key | Description | +| :--- | :--- | +| `image_tag` | It is the image tag | +| `image` | It is the URL of the image | + +### Service Monitor + +```yaml +servicemonitor: + enabled: true + path: /abc + scheme: 'http' + interval: 30s + scrapeTimeout: 20s + metricRelabelings: + - sourceLabels: [namespace] + regex: '(.*)' + replacement: myapp + targetLabel: target_namespace +``` + +It gives the set of targets to be monitored. + +### Db Migration Config + +```yaml +dbMigrationConfig: + enabled: false +``` + +It is used to configure database migration. + + +### KEDA Autoscaling +[KEDA](https://keda.sh) is a Kubernetes-based Event Driven Autoscaler. With KEDA, you can drive the scaling of any container in Kubernetes based on the number of events needing to be processed. KEDA can be installed into any Kubernetes cluster and can work alongside standard Kubernetes components like the Horizontal Pod Autoscaler(HPA). + +Example for autosccaling with KEDA using Prometheus metrics is given below: +```yaml +kedaAutoscaling: + enabled: true + minReplicaCount: 1 + maxReplicaCount: 2 + idleReplicaCount: 0 + pollingInterval: 30 + advanced: + restoreToOriginalReplicaCount: true + horizontalPodAutoscalerConfig: + behavior: + scaleDown: + stabilizationWindowSeconds: 300 + policies: + - type: Percent + value: 100 + periodSeconds: 15 + triggers: + - type: prometheus + metadata: + serverAddress: http://:9090 + metricName: http_request_total + query: envoy_cluster_upstream_rq{appId="300", cluster_name="300-0", container="envoy",} + threshold: "50" + triggerAuthentication: + enabled: false + name: + spec: {} + authenticationRef: {} +``` +Example for autosccaling with KEDA based on kafka is given below : +```yaml +kedaAutoscaling: + enabled: true + minReplicaCount: 1 + maxReplicaCount: 2 + idleReplicaCount: 0 + pollingInterval: 30 + advanced: {} + triggers: + - type: kafka + metadata: + bootstrapServers: b-2.kafka-msk-dev.example.c2.kafka.ap-southeast-1.amazonaws.com:9092,b-3.kafka-msk-dev.example.c2.kafka.ap-southeast-1.amazonaws.com:9092,b-1.kafka-msk-dev.example.c2.kafka.ap-southeast-1.amazonaws.com:9092 + topic: Orders-Service-ESP.info + lagThreshold: "100" + consumerGroup: oders-remove-delivered-packages + allowIdleConsumers: "true" + triggerAuthentication: + enabled: true + name: keda-trigger-auth-kafka-credential + spec: + secretTargetRef: + - parameter: sasl + name: keda-kafka-secrets + key: sasl + - parameter: username + name: keda-kafka-secrets + key: username + authenticationRef: + name: keda-trigger-auth-kafka-credential +``` + +### Winter-Soldier +Winter Soldier can be used to +- cleans up (delete) Kubernetes resources +- reduce workload pods to 0 + +**_NOTE:_** After deploying this we can create the Hibernator object and provide the custom configuration by which workloads going to delete, sleep and many more. for more information check [the main repo](https://github.com/devtron-labs/winter-soldier) + +Given below is template values you can give in winter-soldier: +```yaml +winterSoldier: + enabled: false + apiVersion: pincher.devtron.ai/v1alpha1 + action: sleep + timeRangesWithZone: + timeZone: "Asia/Kolkata" + timeRanges: [] + targetReplicas: [] + fieldSelector: [] +``` +Here, +| Key | values | Description | +| :--- | :--- | :--- | +| `enabled` | `fasle`,`true` | decide the enabling factor | +| `apiVersion` | `pincher.devtron.ai/v1beta1`, `pincher.devtron.ai/v1alpha1` | specific api version | +| `action` | `sleep`,`delete`, `scale` | This specify the action need to perform. | +| `timeRangesWithZone`:`timeZone` | eg:- `"Asia/Kolkata"`,`"US/Pacific"` | It use to specify the timeZone used. (It uses standard format. please refer [this](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) | +| `timeRangesWithZone`:`timeRanges` | array of [ `timeFrom`, `timeTo`, `weekdayFrom`, `weekdayTo`] | It use to define time period/range on which the user need to perform the specified action. you can have multiple timeRanges.
These settings will take `action` on Sat and Sun from 00:00 to 23:59:59, | +| `targetReplicas` | `[n]` : n - number of replicas to scale. | These is mandatory field when the `action` is `scale`
Defalut value is `[]`. | +| `fieldSelector` | `- AfterTime(AddTime( ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '5m'), Now()) ` | These value will take a list of methods to select the resources on which we perform specified `action` . | + + +here is an example, +```yaml +winterSoldier: + apiVersion: pincher.devtron.ai/v1alpha1 + enabled: true + annotations: {} + labels: {} + timeRangesWithZone: + timeZone: "Asia/Kolkata" + timeRanges: + - timeFrom: 00:00 + timeTo: 23:59:59 + weekdayFrom: Sat + weekdayTo: Sun + - timeFrom: 00:00 + timeTo: 08:00 + weekdayFrom: Mon + weekdayTo: Fri + - timeFrom: 20:00 + timeTo: 23:59:59 + weekdayFrom: Mon + weekdayTo: Fri + action: scale + targetReplicas: [1,1,1] + fieldSelector: + - AfterTime(AddTime( ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '10h'), Now()) +``` +Above settings will take action on `Sat` and `Sun` from 00:00 to 23:59:59, and on `Mon`-`Fri` from 00:00 to 08:00 and 20:00 to 23:59:59. If `action:sleep` then runs hibernate at timeFrom and unhibernate at `timeTo`. If `action: delete` then it will delete workloads at `timeFrom` and `timeTo`. Here the `action:scale` thus it scale the number of resource replicas to `targetReplicas: [1,1,1]`. Here each element of `targetReplicas` array is mapped with the corresponding elments of array `timeRangesWithZone/timeRanges`. Thus make sure the length of both array is equal, otherwise the cnages cannot be observed. + +The above example will select the application objects which have been created 10 hours ago across all namespaces excluding application's namespace. Winter soldier exposes following functions to handle time, cpu and memory. + +- ParseTime - This function can be used to parse time. For eg to parse creationTimestamp use ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z') +- AddTime - This can be used to add time. For eg AddTime(ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '-10h') ll add 10h to the time. Use d for day, h for hour, m for minutes and s for seconds. Use negative number to get earlier time. +- Now - This can be used to get current time. +- CpuToNumber - This can be used to compare CPU. For eg any({{spec.containers.#.resources.requests}}, { MemoryToNumber(.memory) < MemoryToNumber('60Mi')}) will check if any resource.requests is less than 60Mi. + + +### Security Context +A security context defines privilege and access control settings for a Pod or Container. + +To add a security context for main container: +```yaml +containerSecurityContext: + allowPrivilegeEscalation: false +``` + +To add a security context on pod level: +```yaml +podSecurityContext: + runAsUser: 1000 + runAsGroup: 3000 + fsGroup: 2000 +``` + +### Topology Spread Constraints +You can use topology spread constraints to control how Pods are spread across your cluster among failure-domains such as regions, zones, nodes, and other user-defined topology domains. This can help to achieve high availability as well as efficient resource utilization. + +```yaml +topologySpreadConstraints: + - maxSkew: 1 + topologyKey: zone + whenUnsatisfiable: DoNotSchedule + autoLabelSelector: true + customLabelSelector: {} + minDomains: 1 + nodeAffinityPolicy: Ignore +``` + +### Persistent Volume Claim +You can use persistent volume claim to mount volume as per your usecase. + +```yaml +persistentVolumeClaim: + name: my-pvc + storageClassName: default + accessMode: + - ReadWriteOnce + mountPath: /tmp +``` + +### Vertical Pod Autoscaling +This is connected to VPA and controls scaling up and down in response to request load. +```yaml +verticalPodScaling: + enabled: true + resourcePolicy: {} + updatePolicy: {} + ``` + +### Scheduler Name + +You can provide you own custom scheduler to schedule your application + +```yaml +schedulerName: "" +``` + +### Deployment Metrics + +It gives the realtime metrics of the deployed applications + +| Key | Description | +| :--- | :--- | +| `Deployment Frequency` | It shows how often this app is deployed to production | +| `Change Failure Rate` | It shows how often the respective pipeline fails. | +| `Mean Lead Time` | It shows the average time taken to deliver a change to production. | +| `Mean Time to Recovery` | It shows the average time taken to fix a failed pipeline. | + +## 2. Show application metrics + +If you want to see application metrics like different HTTP status codes metrics, application throughput, latency, response time. Enable the Application metrics from below the deployment template Save button. After enabling it, you should be able to see all metrics on App detail page. By default it remains disabled. +![](../../../.gitbook/assets/deployment_application_metrics%20%282%29.png) + +Once all the Deployment template configurations are done, click on `Save` to save your deployment configuration. Now you are ready to create [Workflow](workflow/) to do CI/CD. + +### Helm Chart Json Schema + +Helm Chart [json schema](../../../scripts/devtron-reference-helm-charts/reference-chart_4-11-0/schema.json) is used to validate the deployment template values. + +### Other Validations in Json Schema + +The values of CPU and Memory in limits must be greater than or equal to in requests respectively. Similarly, In case of envoyproxy, the values of limits are greater than or equal to requests as mentioned below. +``` +resources.limits.cpu >= resources.requests.cpu +resources.limits.memory >= resources.requests.memory +envoyproxy.resources.limits.cpu >= envoyproxy.resources.requests.cpu +envoyproxy.resources.limits.memory >= envoyproxy.resources.requests.memory +``` diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/app-values.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/app-values.yaml new file mode 100644 index 0000000000..5f8216c0a7 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/app-values.yaml @@ -0,0 +1,530 @@ +# Mandatory configs + +podDisruptionBudget: {} +deploymentLabels: {} +deploymentAnnotations: {} + +containerSpec: + lifecycle: + enabled: false + preStop: + exec: + command: ["sleep","10"] + postStart: + httpGet: + host: example.com + path: /example + port: 90 + +replicaCount: 1 +MinReadySeconds: 60 +GracePeriod: 30 +image: + pullPolicy: IfNotPresent +restartPolicy: Always +service: + type: ClusterIP + # enabled: true + #name: "service-1234567890" + loadBalancerSourceRanges: [] + # loadBalancerSourceRanges: + # - 1.2.3.4/32 + # - 1.2.5.6/23 + annotations: {} + # test1: test2 + # test3: test4 +ContainerPort: + - name: app + port: 8080 + servicePort: 80 + envoyPort: 8799 + useHTTP2: false + supportStreaming: false + idleTimeout: 1800s + protocol: TCP +# servicemonitor: +# enabled: true +# path: /abc +# scheme: 'http' +# interval: 30s +# scrapeTimeout: 20s +# metricRelabelings: +# - sourceLabels: [namespace] +# regex: '(.*)' +# replacement: myapp +# targetLabel: target_namespace +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: + cpu: 1 + memory: 200Mi + requests: + cpu: 0.10 + memory: 100Mi + +# Optional configs +LivenessProbe: + Path: "" + port: 8080 + scheme: "" + httpHeaders: [] +# - name: Custom-Header +# value: abc + tcp: false + command: [] + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + grpc: {} + + +ReadinessProbe: + Path: "" + port: 8080 + scheme: "" + httpHeaders: [] +# - name: Custom-Header +# value: abc + tcp: false + command: [] + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + grpc: {} + + +StartupProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: [] + command: [] + tcp: false + grpc: {} + + +ingress: + enabled: false + className: "" + labels: {} + annotations: {} +# nginx.ingress.kubernetes.io/force-ssl-redirect: 'false' +# nginx.ingress.kubernetes.io/ssl-redirect: 'false' +# kubernetes.io/ingress.class: nginx +# nginx.ingress.kubernetes.io/rewrite-target: /$2 +# nginx.ingress.kubernetes.io/canary: "true" +# nginx.ingress.kubernetes.io/canary-weight: "10" + + hosts: + - host: chart-example1.local + pathType: "ImplementationSpecific" + paths: + - /example1 + - host: chart-example2.local + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +istio: + enable: false + gateway: + enabled: false + labels: {} + annotations: {} + host: example.com + tls: + enabled: false + secretName: example-secret + virtualService: + enabled: false + labels: {} + annotations: {} + gateways: [] + hosts: [] + http: [] + # - match: + # - uri: + # prefix: /v1 + # - uri: + # prefix: /v2 + # timeout: 12 + # headers: + # request: + # add: + # x-some-header: "value" + # retries: + # attempts: 2 + # perTryTimeout: 3s + destinationRule: + enabled: false + labels: {} + annotations: {} + subsets: [] + trafficPolicy: {} + peerAuthentication: + enabled: false + labels: {} + annotations: {} + selector: + enabled: false + mtls: + mode: "" + portLevelMtls: {} + requestAuthentication: + enabled: false + labels: {} + annotations: {} + selector: + enabled: false + jwtRules: [] + authorizationPolicy: + enabled: false + labels: {} + annotations: {} + action: + provider: {} + rules: [] + +winterSoldier: + enabled: false + apiVersion: pincher.devtron.ai/v1alpha1 + annotation: {} + labels: {} + type: Deployment + timeRangesWithZone: + timeZone: "Asia/Kolkata" + timeRanges: [] + action: sleep + targetReplicas: [] + fieldSelector: + - AfterTime(AddTime(ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '5m'), Now()) + +networkPolicy: + enabled: false + annotations: {} + labels: {} + podSelector: + matchExpressions: [] + matchLabels: {} + policyTypes: [] + ingress: [] + egress: [] + +flaggerCanary: + enabled: false + labels: {} + annotations: {} + createIstioGateway: + enabled: false + labels: {} + annotations: {} + host: + tls: + enabled: false + secretName: + # Istio gateways (optional) + addOtherGateways: [] + # Istio virtual service host names (optional) + addOtherHosts: [] + # Istio gateway refs (optional) + gatewayRefs: + # - name: istio-gateway + # namespace: istio-system + #service port + serviceport: 8080 + #containerPort + targetPort: 8080 + # discover all port open in container + portDiscovery: true + # application protocol (optional) + appProtocol: http + # Istio retry policy (optional) + retries: + # attempts: 3 + # perTryTimeout: 1s + # retryOn: "gateway-error,connect-failure,refused-stream" + # HTTP match conditions (optional) + match: + - uri: + prefix: / + # HTTP rewrite (optional) + rewriteUri: / + # timeout (optional) + timeout: + # Add headers (optional) + headers: + # request: + # add: + # x-some-header: "value" + # cross-origin resource sharing policy (optional) + corsPolicy: + # allowOrigin: + # - example.com + # allowMethods: + # - GET + # allowCredentials: false + # allowHeaders: + # - x-some-header + # maxAge: 24h + analysis: + # schedule interval (default 60s) + interval: 15s + # max number of failed metric checks before rollback + threshold: 5 + # max traffic percentage routed to canary + # percentage (0-100) + maxWeight: 50 + # canary increment step + # percentage (0-100) + stepWeight: 5 + thresholds: + # minimum req success rate (non 5xx responses) + # percentage (0-100) + successRate: 90 + # maximum req duration P99 + # milliseconds + latency: 500 + loadtest: + enabled: true + # load tester address + url: http://flagger-loadtester.istio-system/ + +ingressInternal: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + # nginx.ingress.kubernetes.io/canary: "true" + # nginx.ingress.kubernetes.io/canary-weight: "10" + + hosts: + - host: chart-example1.internal + pathType: "ImplementationSpecific" + paths: + - /example1 + - host: chart-example2.internal + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +command: + workingDir: {} + enabled: false + value: [] + +args: + enabled: false + value: + - /bin/sh + - -c + - touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600 + +#For adding custom labels to pods + +podLabels: {} +# customKey: customValue +podAnnotations: {} +# customKey: customValue + +rawYaml: [] + +topologySpreadConstraints: [] + +initContainers: [] + ## Additional init containers to run before the Scheduler pods. + ## for example, be used to run a sidecar that chown Logs storage . + #- name: volume-mount-hack + # image: busybox + # command: ["sh", "-c", "chown -R 1000:1000 logs"] + # volumeMounts: + # - mountPath: /usr/local/airflow/logs + # name: logs-data + +containers: [] + ## Additional containers to run along with application pods. + ## for example, be used to run a sidecar that chown Logs storage . + #- name: volume-mount-hack + # image: busybox + # command: ["sh", "-c", "chown -R 1000:1000 logs"] + # volumeMounts: + # - mountPath: /usr/local/airflow/logs + # name: logs-data + +volumeMounts: [] +# - name: log-volume +# mountPath: /var/log + +volumes: [] +# - name: log-volume +# emptyDir: {} + +dbMigrationConfig: + enabled: false + +tolerations: [] + +podSecurityContext: {} + +containerSecurityContext: {} + +Spec: + Affinity: + Key: "" + # Key: kops.k8s.io/instancegroup + Values: "" + +affinity: + enabled: false + values: {} + +ambassadorMapping: + enabled: false + labels: {} + prefix: / + ambassadorId: "" + hostname: devtron.example.com + rewrite: "" + retryPolicy: {} + cors: {} + tls: + context: "" + create: false + secretName: "" + hosts: [] + +autoscaling: + enabled: false + MinReplicas: 1 + MaxReplicas: 2 + TargetCPUUtilizationPercentage: 70 + TargetMemoryUtilizationPercentage: 80 + annotations: {} + labels: {} + behavior: {} + containerResource: + enabled: false + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 +# scaleDown: +# stabilizationWindowSeconds: 300 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# scaleUp: +# stabilizationWindowSeconds: 0 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# - type: Pods +# value: 4 +# periodSeconds: 15 +# selectPolicy: Max + + extraMetrics: [] +# - external: +# metricName: pubsub.googleapis.com|subscription|num_undelivered_messages +# metricSelector: +# matchLabels: +# resource.labels.subscription_id: echo-read +# targetAverageValue: "2" +# type: External +# + +kedaAutoscaling: + enabled: false + envSourceContainerName: "" # Optional. Default: .spec.template.spec.containers[0] + minReplicaCount: 1 + maxReplicaCount: 2 + advanced: {} + triggers: [] + triggerAuthentication: + enabled: false + name: "" + spec: {} + authenticationRef: {} + +# kedaHttpScaledObject: +# enabled: false +# minReplicaCount: 1 +# maxReplicaCount: 2 +# targetPendingRequests: +# scaledownPeriod: +# servicePort: 80 # port of the service (required) + +prometheus: + release: monitoring + +server: + deployment: + image_tag: 1-95af053 + image: "" + +servicemonitor: + additionalLabels: {} + +envoyproxy: + image: quay.io/devtron/envoy:v1.16.0 + configMapName: "" + lifecycle: {} + resources: + limits: + cpu: 50m + memory: 50Mi + requests: + cpu: 50m + memory: 50Mi + +## Pods Service Account +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ +## +serviceAccount: + ## @param serviceAccount.create Enable creation of ServiceAccount for pods + ## + create: false + ## @param serviceAccount.name The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the `.Chart.Name .fullname` template + name: "" + ## @param serviceAccount.annotations Annotations for service account. Evaluated as a template. + ## Only used if `create` is `true`. + ## + annotations: {} + +imagePullSecrets: [] + # - test1 + # - test2 +hostAliases: [] +# - ip: "127.0.0.1" +# hostnames: +# - "foo.local" +# - "bar.local" +# - ip: "10.1.2.3" +# hostnames: +# - "foo.remote" +# - "bar.remote" + +verticalPodScaling: + enabled: false \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/env-values.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/env-values.yaml new file mode 100644 index 0000000000..48b794e8f2 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/env-values.yaml @@ -0,0 +1,66 @@ +replicaCount: 1 +MaxSurge: 1 +MaxUnavailable: 0 +GracePeriod: 30 +pauseForSecondsBeforeSwitchActive: 30 +waitForSecondsBeforeScalingDown: 30 + +Spec: + Affinity: + Key: "" + Values: "" + +autoscaling: + enabled: false + MinReplicas: 1 + MaxReplicas: 2 + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 + behavior: {} +# scaleDown: +# stabilizationWindowSeconds: 300 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# scaleUp: +# stabilizationWindowSeconds: 0 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# - type: Pods +# value: 4 +# periodSeconds: 15 +# selectPolicy: Max + extraMetrics: [] +# - external: +# metricName: pubsub.googleapis.com|subscription|num_undelivered_messages +# metricSelector: +# matchLabels: +# resource.labels.subscription_id: echo-read +# targetAverageValue: "2" +# type: External +# +secret: + enabled: false + data: {} +# my_own_secret: S3ViZXJuZXRlcyBXb3Jrcw== + +EnvVariables: [] +# - name: FLASK_ENV +# value: qa + +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: + cpu: "0.05" + memory: 50Mi + requests: + cpu: "0.01" + memory: 10Mi + + diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/pipeline-values.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/pipeline-values.yaml new file mode 100644 index 0000000000..dbe4db3e8e --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/pipeline-values.yaml @@ -0,0 +1,6 @@ +deployment: + strategy: + recreate: {} + rolling: + maxSurge: "25%" + maxUnavailable: 1 diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/release-values.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/release-values.yaml new file mode 100644 index 0000000000..48eb3f482c --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/release-values.yaml @@ -0,0 +1,14 @@ +server: + deployment: + image_tag: IMAGE_TAG + image: IMAGE_REPO + enabled: false +dbMigrationConfig: + enabled: false + +pauseForSecondsBeforeSwitchActive: 0 +waitForSecondsBeforeScalingDown: 0 +autoPromotionSeconds: 30 + +#used for deployment algo selection +orchestrator.deploymant.algo: 1 diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/schema.json b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/schema.json new file mode 100644 index 0000000000..6a332631a9 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/schema.json @@ -0,0 +1,1368 @@ + +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "containerExtraSpecs":{ + "type": "object", + "title": "containerExtraSpecs", + "description": "Define container extra specs here" + }, + "ContainerPort": { + "type": "array", + "description": "defines ports on which application services will be exposed to other services", + "title": "Container Port", + "items": { + "type": "object", + "properties": { + "envoyPort": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "envoy port for the container", + "title": "Envoy Port" + }, + "idleTimeout": { + "type": "string", + "description": "duration of time for which a connection is idle before the connection is terminated", + "title": "Idle Timeout" + }, + "name": { + "type": "string", + "description": "name of the port", + "title": "Name" + }, + "port": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "Port", + "title": "port for the container" + }, + "servicePort": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "port of the corresponding kubernetes service", + "title": "Service Port" + }, + "nodePort": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "nodeport of the corresponding kubernetes service", + "title": "Node Port" + }, + "supportStreaming": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "field to enable/disable timeout for high performance protocols like grpc", + "title": "Support Streaming" + }, + "useHTTP2": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": " field for setting if envoy container can accept(or not) HTTP2 requests", + "title": "Use HTTP2" + } + } + } + }, + "EnvVariables": { + "type": "array", + "items": {}, + "description": "contains environment variables needed by the containers", + "title": "Environment Variables" + }, + "EnvVariablesFromFieldPath":{ + "type": "array", + "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs", + "title": "EnvVariablesFromFieldPath", + "items": [ + { + "type": "object", + "properties": { + "name":{ + "type": "string", + "title": "name", + "description": "Env variable name to be" + }, + "fieldPath":{ + "type": "string", + "title": "fieldPath", + "description": "Path of the field to select in the specified API version" + } + } + } + ] + }, + "EnvVariablesFromSecretKeys": { + "type": "array", + "description": "Selects a field of the deployment: It is use to get the name of Environment Variable name, Secret name and the Key name from which we are using the value in that corresponding Environment Variable.", + "title": "EnvVariablesFromSecretKeys", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "name", + "description": "Env variable name to be used." + }, + "secretName": { + "type": "string", + "title": "secretName", + "description": "Name of Secret from which we are taking the value." + }, + "keyName": { + "type": "string", + "title": "keyName", + "description": "Name of The Key Where the value is mapped with." + } + } + } + ] + }, + "EnvVariablesFromConfigMapKeys": { + "type": "array", + "description": "Selects a field of the deployment: It is use to get the name of Environment Variable name, Config Map name and the Key name from which we are using the value in that corresponding Environment Variable.", + "title": "EnvVariablesFromConfigMapKeys", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "name", + "description": "Env variable name to be used." + }, + "configMapName": { + "type": "string", + "title": "configMapName", + "description": "Name of configMap from which we are taking the value." + }, + "keyName": { + "type": "string", + "title": "keyName", + "description": "Name of The Key Where the value is mapped with." + } + } + } + ] + }, + "GracePeriod": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "time for which Kubernetes waits before terminating the pods", + "title": "Grace Period" + }, + "LivenessProbe": { + "type": "object", + "description": "used by the kubelet to know when to restart a container", + "title": "Liveness Probe", + "properties": { + "Path": { + "type": "string", + "description": "defines the path where the liveness needs to be checked", + "title": "Path" + }, + "command": { + "type": "array", + "items": {}, + "description": "commands executed to perform a probe", + "title": "Command" + }, + "failureThreshold": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the maximum number of failures that are acceptable before a given container is not considered as live", + "title": "Failure Threshold" + }, + "httpHeaders": { + "type": "array", + "items": {}, + "description": "used to override the default headers by defining .httpHeaders for the probe", + "title": "HTTP headers" + }, + "initialDelaySeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time to wait before a given container is checked for liveness", + "title": "Initial Delay Seconds" + }, + "periodSeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time to check a given container for liveness", + "title": "Period Seconds" + }, + "port": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "port to access on the container", + "title": "Port" + }, + "scheme": { + "type": "string", + "description": "Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP.", + "title": "Scheme" + }, + "successThreshold": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the number of successes required before a given container is said to fulfil the liveness probe", + "title": "Success Threshold" + }, + "tcp": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "If enabled, the kubelet will attempt to open a socket to container. If connection is established, the container is considered healthy", + "title": "TCP" + }, + "timeoutSeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time for checking timeout", + "title": "Timeout Seconds" + } + } + }, + "MaxSurge": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "maximum number of pods that can be created over the desired number of pods", + "title": "Maximum Surge" + }, + "MaxUnavailable": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "maximum number of pods that can be unavailable during the update process", + "title": "Maximum Unavailable" + }, + "MinReadySeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available", + "title": "Minimum Ready Seconds" + }, + "ReadinessProbe": { + "type": "object", + "description": "kubelet uses readiness probes to know when a container is ready to start accepting traffic", + "title": "Readiness Probe", + "properties": { + "Path": { + "type": "string", + "description": "defines the path where the readiness needs to be checked", + "title": "Path" + }, + "command": { + "type": "array", + "items": {}, + "description": "commands executed to perform a probe", + "title": "Command" + }, + "failureThreshold": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the maximum number of failures that are acceptable before a given container is not considered as ready", + "title": "Failure Threshold" + }, + "httpHeader": { + "type": "array", + "items": {}, + "description": "used to override the default headers by defining .httpHeaders for the probe", + "title": "HTTP headers" + }, + "initialDelaySeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time to wait before a given container is checked for readiness", + "title": "Initial Delay Seconds" + }, + "periodSeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time to check a given container for readiness", + "title": "Period Seconds" + }, + "port": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "port to access on the container", + "title": "Port" + }, + "scheme": { + "type": "string", + "description": "Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP.", + "title": "Scheme" + }, + "successThreshold": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the number of successes required before a given container is said to fulfil the readiness probe", + "title": "Success Threshold" + }, + "tcp": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "If enabled, the kubelet will attempt to open a socket to container. If connection is established, the container is considered healthy", + "title": "TCP" + }, + "timeoutSeconds": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "defines the time for checking timeout", + "title": "Timeout Seconds" + } + } + }, + "networkPolicy": { + "type": "object", + "description": "NetworkPolicy describes what network traffic is allowed for a set of Pods", + "title": "Network Policy", + "properties": { + "enabled":{ + "type":"boolean", + "description": "used to enable or disable NetworkPolicy" + }, + "annotations":{ + "type": "object", + "description": "Annotations for NetworkPolicy" + }, + "labels":{ + "type":"object", + "description": "Labels for NetworkPolicy" + }, + "podSelector":{ + "type": "object", + "description": "Selects the pods to which this NetworkPolicy object applies", + "properties": { + "matchExpressions":{ + "type":"array", + "description": "list of label selector" + }, + "matchLabels":{ + "type":"object", + "description": "map of {key,value} pairs" + } + } + }, + "policyTypes":{ + "type":"array", + "description": "List of rule types that the NetworkPolicy relates to. Valid options are Ingress,Egress." + }, + "ingress":{ + "type":"array", + "description": "List of ingress rules to be applied to the selected pods" + }, + "egress":{ + "type":"array", + "description": "List of egress rules to be applied to the selected pods" + } + } + }, + "istio": { + "type": "object", + "description": "Istio Service mesh", + "title": "Istio" + }, + "flaggerCanary":{ + "type": "object", + "description": "Flagger for canary release with istio service mesh", + "title": "Flagger Canary Release" + }, + "Spec": { + "type": "object", + "description": "used to define the desire state of the given container", + "title": "Spec", + "properties": { + "Affinity": { + "type": "object", + "description": "Node/Inter-pod Affinity allows you to constrain which nodes your pod is eligible to schedule on, based on labels of the node/pods", + "title": "Affinity", + "properties": { + "Key": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "string", + "description": "Key part of the label for node/pod selection", + "title": "Key" + } + ] + }, + "Values": { + "type": "string", + "description": "Value part of the label for node/pod selection", + "title": "Values" + }, + "key": { + "type": "string" + } + } + } + } + }, + "ambassadorMapping": { + "type": "object", + "description": "used to create ambassador mapping resource", + "title": "Mapping", + "properties": { + "ambassadorId": { + "type": "string", + "description": "used to specify id for specific ambassador mappings controller", + "title": "Ambassador ID" + }, + "cors": { + "type": "object", + "description": "used to specify cors policy to access host for this mapping", + "title": "CORS" + }, + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used to specify whether to create an ambassador mapping or not", + "title": "Enabled" + }, + "weight": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used to specify weight for canary ambassador mappings" + }, + "hostname": { + "type": "string", + "description": "used to specify hostname for ambassador mapping", + "title": "Hostname" + }, + "labels": { + "type": "object", + "description": "used to provide custom labels for ambassador mapping", + "title": "Labels" + }, + "prefix": { + "type": "string", + "description": "used to specify path for ambassador mapping", + "title": "Prefix" + }, + "retryPolicy": { + "type": "object", + "description": "used to specify retry policy for ambassador mapping", + "title": "Retry Policy" + }, + "rewrite": { + "type": "string", + "description": "used to specify whether to redirect the path of this mapping and where", + "title": "Rewrite" + }, + "tls": { + "type": "object", + "description": "used to create or define ambassador TLSContext resource", + "title": "TLS Context" + }, + "extraSpec": { + "type": "object", + "description": "used to provide extra spec values which not present in deployment template for ambassador resource", + "title": "Extra Spec" + } + } + }, + "args": { + "type": "object", + "description": " used to give arguments to command", + "title": "Arguments", + "properties": { + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used for enabling/disabling aruguments", + "title": "Enabled" + }, + "value": { + "type": "array", + "description": "values of the arguments", + "title": "Value", + "items": [ + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ] + } + } + }, + "autoscaling": { + "type": "object", + "description": "connected to HPA and controls scaling up and down in response to request load", + "title": "Autoscaling", + "properties": { + "MaxReplicas": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "Maximum number of replicas allowed for scaling", + "title": "Maximum Replicas" + }, + "MinReplicas": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "Minimum number of replicas allowed for scaling", + "title": "Minimum Replicas" + }, + "TargetCPUUtilizationPercentage": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "The target CPU utilization that is expected for a container", + "title": "TargetCPUUtilizationPercentage" + }, + "TargetMemoryUtilizationPercentage": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "The target memory utilization that is expected for a container", + "title": "TargetMemoryUtilizationPercentage" + }, + "behavior": { + "type": "object", + "description": "describes behavior and scaling policies for that behavior", + "title": "Behavior" + }, + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used for enabling/disabling autoscaling", + "title": "Enabled" + }, + "labels": { + "type": "object", + "description": "labels for HPA", + "title": "labels" + }, + "annotations": { + "type": "object", + "description": "used to configure some options for HPA", + "title": "annotations" + }, + "extraMetrics": { + "type": "array", + "items": {}, + "description": "used to give external metrics for autoscaling", + "title": "Extra Metrics" + } + } + }, + "command": { + "type": "object", + "description": "contains the commands for the server", + "title": "Command", + "properties": { + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used for enabling/disabling commands" + }, + "value": { + "type": "array", + "items": {}, + "description": "contains the commands", + "title": "Value" + }, + "workingDir": { + "type": "object", + "items": {}, + "description": "contains the working directory", + "title": "Working directory" + } + } + }, + "containerSecurityContext": { + "type": "object", + "description": " defines privilege and access control settings for a Container", + "title": "Container Security Context" + }, + "containers": { + "type": "array", + "items": {}, + "description": " used to run side-car containers along with the main container within same pod" + }, + "dbMigrationConfig": { + "type": "object", + "description": "used to configure database migration", + "title": "Db Migration Config", + "properties": { + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used for enabling/disabling the config", + "title": "Enabled" + } + } + }, + "envoyproxy": { + "type": "object", + "description": "envoy is attached as a sidecar to the application container to collect metrics like 4XX, 5XX, throughput and latency", + "title": "Envoy Proxy", + "properties": { + "configMapName": { + "type": "string", + "description": "configMap containing configuration for Envoy", + "title": "ConfigMap" + }, + "lifecycle":{ + "type": "object", + "description": "Actions that the management system should take in response to container lifecycle events", + "title": "lifecycle", + "properties": { + "enabled":{ + "type": "boolean" + }, + "postStart":{ + "type": "object", + "title": "postStart", + "description": "PostStart is called immediately after a container is created" + }, + "preStop":{ + "type": "object", + "title": "preStop", + "description": "PreStop is called immediately before a container is terminated" + } + } + }, + "image": { + "type": "string", + "description": "image of envoy to be used" + }, + "resources": { + "type": "object", + "description": "minimum and maximum RAM and CPU available to the application", + "title": "Resources", + "properties": { + "limits": { + "type": "object", + "description": "the maximum values a container can reach", + "title": "Limits", + "properties": { + "cpu": { + "type": "string", + "format": "cpu", + "description": "limit of CPU", + "title": "CPU" + }, + "memory": { + "type": "string", + "format": "memory", + "description": "limit of memory", + "title": "Memory" + } + } + }, + "requests": { + "type": "object", + "description": "request is what the container is guaranteed to get", + "title": "Requests", + "properties": { + "cpu": { + "type": "string", + "format": "cpu", + "description": "request value of CPU", + "title": "CPU" + }, + "memory": { + "type": "string", + "format": "memory", + "description": "request value of memory", + "title": "Memory" + } + } + } + } + } + } + }, + "hostAliases":{ + "type": "array", + "title": "hostAliases", + "description": "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file", + "items": [ + { + "type": "object", + "properties": { + "ip":{ + "type": "string", + "title": "IP", + "description": "IP address of the host file entry" + }, + "hostnames":{ + "type": "array", + "description": "Hostnames for the above IP address", + "items": [ + { + "type": "string" + } + ] + } + } + } + ] + }, + "image": { + "type": "object", + "description": "used to access images in kubernetes", + "title": "Image", + "properties": { + "pullPolicy": { + "type": "string", + "description": "used to define the instances calling the image", + "title": "Pull Policy", + "enum": ["IfNotPresent", "Always"] + } + } + }, + "restartPolicy": { + "type": "string", + "description": "It restarts the docker container based on defined conditions.", + "title": "Restart Policy", + "enum": [ + "Always", + "OnFailure", + "Never" + ] + }, + "imagePullSecrets": { + "type": "array", + "items": {}, + "description": "contains the docker credentials that are used for accessing a registry", + "title": "Image PullSecrets" + }, + "winterSoldier": { + "type": "object", + "description": "allows to scale, sleep or delete the resource based on time.", + "title": "winterSoldier", + "properties": { + "annotations": { + "type": "object", + "description": "used to configure some options depending on the winterSoldier controller", + "title": "Annotations" + }, + "labels": { + "type": "object", + "description": "labels for winterSoldier", + "title": "winterSoldier labels", + "default": "" + }, + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used to enable or disable ingress", + "title": "Enabled" + }, + "apiVersion": { + "type": "string", + "description": "Api version for winterSoldier", + "title": "winterSoldier apiVersion", + "default": "pincher.devtron.ai/v1alpha1" + }, + "timeRangesWithZone": { + "type": "object", + "description": "describe time zone and time ranges to input in the winterSoldier", + "title": "Time Ranges With Zone", + "timeZone": { + "type": "string", + "description": "describe time zone, and follow standard format", + "title": "Time Zone" + }, + "timeRanges": { + "type": "array", + "items": {}, + "description": "used to take array of time ranges in which each element contains timeFrom, timeTo, weekdayFrom and weekdayTo.", + "title": "Time Ranges" + } + }, + "type": { + "type": "string", + "description": "describe the type of application Rollout/deployment.", + "title": "Type" + }, + "action": { + "type": "string", + "description": "describe the action to be performed by winterSoldier.", + "title": "Action" + }, + "targetReplicas": { + "type": "array", + "description": "describe the number of replicas to which the resource should scale up or down.", + "title": "Target Replicas" + }, + "fieldSelector": { + "type": "array", + "description": "it takes arrays of methods to select specific fields.", + "title": "Field Selector" + } + } + }, + "ingress": { + "type": "object", + "description": "allows public access to URLs", + "title": "Ingress", + "properties": { + "annotations": { + "type": "object", + "description": "used to configure some options depending on the Ingress controller", + "title": "Annotations" + }, + "className": { + "type": "string", + "description": "name of ingress class, a reference to an IngressClass resource that contains additional configuration including the name of the controller", + "title": "Ingress class name", + "default": "nginx" + }, + "labels": { + "type": "object", + "description": "labels for ingress", + "title": "Ingress labels", + "default": "" + }, + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used to enable or disable ingress", + "title": "Enabled" + }, + "hosts": { + "type": "array", + "description": "list of hosts in ingress", + "title": "Hosts", + "items": [ + { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "host URL", + "title": "Host" + }, + "pathType": { + "type": "string", + "description": "type of path", + "title": "PathType" + }, + "paths": { + "type": "array", + "description": "list of paths for a given host", + "title": "Paths", + "items": [ + { + "type": "string" + } + ] + } + } + } + ] + }, + "tls": { + "type": "array", + "items": {}, + "description": "contains security details - private key and certificate", + "title": "TLS" + } + } + }, + "ingressInternal": { + "type": "object", + "description": "allows private access to the URLs", + "properties": { + "annotations": { + "type": "object", + "description": "used to configure some options depending on the Ingress controller", + "title": "Annotations" + }, + "className": { + "type": "string", + "description": "name of ingress class, a reference to an IngressClass resource that contains additional configuration including the name of the controller", + "title": "Ingress class name", + "default": "nginx-internal" + }, + "enabled": { + "type": [ + "boolean", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "used to enable or disable ingress", + "title": "Enabled" + }, + "hosts": { + "type": "array", + "description": "list of hosts in ingress", + "title": "Hosts", + "items": [ + { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "host URL", + "title": "Host" + }, + "pathType": { + "type": "string", + "description": "type of path", + "title": "PathType" + }, + "paths": { + "type": "array", + "description": "list of paths for a given host", + "title": "Paths", + "items": [ + { + "type": "string" + } + ] + } + } + } + ] + }, + "tls": { + "type": "array", + "items": {}, + "description": "contains security details - private key and certificate", + "title": "TLS" + } + } + }, + "initContainers": { + "type": "array", + "items": {}, + "description": "specialized containers that run before app containers in a Pod, can contain utilities or setup scripts not present in an app image", + "title": "Init Containers" + }, + "kedaAutoscaling": { + "type": "object", + "description": "Kubernetes-based event driven autoscaler. With KEDA, one can drive the scaling of any container in Kubernetes based on the no. of events needing to be processed", + "title": "KEDA Autoscaling", + "properties": { + "advanced": { + "type": "object" + }, + "authenticationRef": { + "type": "object" + }, + "enabled": { + "type": "boolean" + }, + "envSourceContainerName": { + "type": "string" + }, + "maxReplicaCount": { + "type": "integer" + }, + "minReplicaCount": { + "type": "integer" + }, + "triggerAuthentication": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "spec": { + "type": "object" + } + } + }, + "triggers": { + "type": "array", + "items": {} + } + } + }, + "containerSpec": { + "type":"object", + "description": "define the container specic configuration", + "title": "containerSpec", + "properties": { + "lifecycle": { + "type": "object", + "description": "Actions that the management system should take in response to container lifecycle events", + "title": "lifecycle", + "properties": { + "enabled":{ + "type": "boolean" + }, + "postStart":{ + "type": "object", + "title": "postStart", + "description": "PostStart is called immediately after a container is created.You could use this event to check that a required API is available before the container’s main work begins" + }, + "preStop":{ + "type": "object", + "title": "preStop", + "description": "PreStop is called immediately before a container is terminated" + } + } + } + } + }, + "pauseForSecondsBeforeSwitchActive": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "tell how much to wait for given period of time before switch active the container", + "title": "Pause For Seconds Before SwitchActive" + }, + "podAnnotations": { + "type":"object", + "description": "used to attach metadata and configs in Kubernetes", + "title": "Pod Annotations" + }, + "podDisruptionBudget": { + "type": "object", + "description": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods", + "properties": { + "minAvailable":{ + "type": "string", + "title": "minAvailable", + "description": "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod" + }, + "maxUnavailable":{ + "type": "string", + "title": "maxUnavailable", + "description": "An eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod." + } + } + }, + "deploymentLabels": { + "type": "object", + "description": "deploymentLabels is an object to define the label on deployment.", + "title": "DeploymentLabels" + }, + "deploymentAnnotations": { + "type": "object", + "description": "deploymentAnnotations is an object to define the annotations on deployment.", + "title": "DeploymentAnnotations" + }, + "podExtraSpecs":{ + "type": "object", + "description": "ExtraSpec for the pods to be configured", + "title": "podExtraSpecs" + }, + "podLabels": { + "type":"object", + "description": "key/value pairs that are attached to pods, are intended to be used to specify identifying attributes of objects that are meaningful and relevant to users, but do not directly imply semantics to the core system", + "title": "Pod Labels" + }, + "podSecurityContext": { + "type":"object", + "description": "defines privilege and access control settings for a Pod or Container", + "title": "Pod Security Context" + }, + "prometheus": { + "type": "object", + "description": "a kubernetes monitoring tool", + "title": "Prometheus", + "properties": { + "release": { + "type": "string", + "description": "name of the file to be monitored, describes the state of prometheus" + } + } + }, + "rawYaml": { + "type": "array", + "items": {}, + "description": "Accepts an array of Kubernetes objects. One can specify any kubernetes yaml here & it will be applied when a app gets deployed.", + "title": "Raw YAML" + }, + "replicaCount": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "count of Replicas of pod", + "title": "REplica Count" + }, + "resources": { + "type": "object", + "description": "minimum and maximum RAM and CPU available to the application", + "title": "Resources", + "properties": { + "limits": { + "type": "object", + "description": "the maximum values a container can reach", + "title": "Limits", + "properties": { + "cpu": { + "type": "string", + "format": "cpu", + "description": "limit of CPU", + "title": "CPU" + }, + "memory": { + "type": "string", + "format": "memory", + "description": "limit of memory", + "title": "Memory" + } + } + }, + "requests": { + "type": "object", + "description": "request is what the container is guaranteed to get", + "title": "Requests", + "properties": { + "cpu": { + "type": "string", + "format": "cpu", + "description": "request value of CPU", + "title": "CPU" + }, + "memory": { + "type": "string", + "format": "memory", + "description": "request value of memory", + "title": "Memory" + } + } + } + } + }, + "secret": { + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "enabled": { + "type": "boolean" + } + } + }, + "server": { + "type": "object", + "description": "used for providing server configurations.", + "title": "Server", + "properties": { + "deployment": { + "type": "object", + "description": "gives the details for deployment", + "title": "Deployment", + "properties": { + "image": { + "type": "string", + "description": "URL of the image", + "title": "Image" + }, + "image_tag": { + "type": "string", + "description": "tag of the image", + "title": "Image Tag" + } + } + } + } + }, + "service": { + "type": "object", + "description": "defines annotations and the type of service", + "title": "Service", + "properties": { + "annotations": { + "type": "object", + "title": "Annotations", + "description": "annotations of service" + }, + "type": { + "type": "string", + "description": "type of service", + "title": "Type", + "enum": [ + "ClusterIP", + "LoadBalancer", + "NodePort", + "ExternalName" + ] + } + } + }, + "serviceAccount": { + "type": "object", + "description": "defines service account for pods", + "title": "Service Account", + "properties": { + "annotations": { + "type": "object", + "title": "Annotations", + "description": "annotations of service account" + }, + "name": { + "type": "string", + "description": "name of service account", + "title": "Name" + }, + "create": { + "type": "boolean" + } + } + }, + "servicemonitor": { + "type": "object", + "description": "gives the set of targets to be monitored", + "title": "Service Monitor", + "properties": { + "additionalLabels": { + "type": "object" + } + } + }, + "tolerations": { + "type": "array", + "items": {}, + "description": "a mechanism which work together with Taints which ensures that pods are not placed on inappropriate nodes", + "title": "Tolerations" + }, + "topologySpreadConstraints": { + "type": "array", + "items": {}, + "description": "used to control how Pods are spread across a cluster among failure-domains such as regions, zones, nodes, and other user-defined topology domains", + "title": "Topology Spread Constraints" + }, + "volumeMounts": { + "type": "array", + "items": {}, + "description": "used to provide mounts to the volume", + "title": "Volume Mounts" + }, + "volumes": { + "type": "array", + "items": {}, + "description": "required when some values need to be read from or written to an external disk", + "title": "Volumes" + }, + "waitForSecondsBeforeScalingDown": { + "type": [ + "integer", + "string" + ], + "pattern": "^@{{[a-zA-Z0-9-+/*%_\\s]+}}$", + "description": "Wait for given period of time before scaling down the container", + "title": "Wait For Seconds Before Scaling Down" + } + } +} + diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/secrets-test-values.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/secrets-test-values.yaml new file mode 100644 index 0000000000..4a20404db8 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/secrets-test-values.yaml @@ -0,0 +1 @@ +{"ConfigSecrets":{"enabled":true,"secrets":[{"data":{"standard_key":"c3RhbmRhcmQtdmFsdWU="},"external":false,"externalType":"","mountPath":"/test","name":"normal-secret","type":"volume"},{"data":{"secret_key":"U0VDUkVUIERBVEE="},"external":true,"externalType":"AWSSecretsManager","mountPath":"","name":"external-secret-3","type":"environment"}]}} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/NOTES.txt b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/NOTES.txt new file mode 100644 index 0000000000..2b14478168 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range $.Values.ingress.paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include ".Chart.Name .fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include ".Chart.Name .fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include ".Chart.Name .fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include ".Chart.Name .name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/_helpers.tpl b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/_helpers.tpl new file mode 100644 index 0000000000..10de322e2a --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/_helpers.tpl @@ -0,0 +1,167 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define ".Chart.Name .name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create service name +*/}} +{{- define ".servicename" -}} +{{- if .Values.service.name -}} +{{- .Values.service.name | trunc 63 | trimSuffix "-" -}} +{{- else if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 55 | trimSuffix "-" -}}-service +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 55 | trimSuffix "-" -}}-service +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 55 | trimSuffix "-" -}}-service +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create preview service name +*/}} +{{- define ".previewservicename" -}} +{{- if .Values.service.name -}} +{{- .Values.service.name | trunc 55 | trimSuffix "-" -}}-preview +{{- else if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 47 | trimSuffix "-" -}}-preview-service +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 47 | trimSuffix "-" -}}-preview-service +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 47 | trimSuffix "-" -}}-preview-service +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define ".Chart.Name .fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define ".Chart.Name .chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define ".Chart.Name .color" -}} +{{- $active0 := (index .Values.server.deployment 0).enabled -}} +{{/* +{{- $active1 := (index .Values.server.deployment 1).enabled -}} +*/}} +{{- $active1 := include "safeenabledcheck" . -}} +{{- $active := and $active0 $active1 -}} +{{- $active -}} +{{- end -}} + +{{- define "safeenabledcheck" -}} +{{- if (eq (len .Values.server.deployment) 2) -}} + {{- if (index .Values.server.deployment 1).enabled -}} + {{- $active := true -}} + {{- $active -}} + {{- else -}} + {{- $active := false -}} + {{- $active -}} + {{- end -}} +{{- else -}} + {{- $active := false -}} + {{- $active -}} +{{- end -}} +{{- end -}} + + +{{- define "isCMVolumeExists" -}} + {{- $isCMVolumeExists := false -}} + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "volume"}} + {{- $isCMVolumeExists = true}} + {{- end }} + {{- end }} + {{- end }} + {{- $isCMVolumeExists -}} +{{- end -}} + +{{- define "isSecretVolumeExists" -}} + {{- $isSecretVolumeExists := false -}} + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "volume"}} + {{- $isSecretVolumeExists = true}} + {{- end }} + {{- end }} + {{- end }} + {{- $isSecretVolumeExists -}} +{{- end -}} + + + + +{{- define "serviceMonitorEnabled" -}} + {{- $SMenabled := false -}} + {{- range .Values.ContainerPort }} + {{- if .servicemonitor }} + {{- if and .servicemonitor.enabled }} + {{- $SMenabled = true -}} + {{- end }} + {{- end }} + {{- end }} + {{- $SMenabled -}} +{{- end -}} + +{{- define "VerticalPodAutoScalingEnabled" -}} + {{- $SMenabled := false -}} + {{- if and .Values.verticalPodScaling.enabled }} + {{- $SMenabled = true -}} + {{- end }} + {{- $SMenabled -}} +{{- end -}} + +{{/* Create the name of the service account to use */}} +{{- define "serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include ".Chart.Name .fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* Check for app/release labels in customPodLabels and replace accordingly */}} +{{- define "customPodLabelsContainsApp" -}} + {{- $LabelsContain := false -}} + {{- if hasKey .Values.customPodLabels "app" }} + {{- $LabelsContain = true -}} + {{- end }} + {{- $LabelsContain -}} +{{- end -}} + +{{- define "customPodLabelsContainsRelease" -}} + {{- $LabelsContain := false -}} + {{- if hasKey .Values.customPodLabels "release" }} + {{- $LabelsContain = true -}} + {{- end }} + {{- $LabelsContain -}} +{{- end -}} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/ambassador.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/ambassador.yaml new file mode 100644 index 0000000000..9d4a431c26 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/ambassador.yaml @@ -0,0 +1,94 @@ +{{ $svcName := include ".servicename" . }} +{{ $svcPort := (index .Values.ContainerPort 0).servicePort }} +{{- if $.Values.ambassadorMapping.enabled }} +{{- with $.Values.ambassadorMapping }} +apiVersion: getambassador.io/v3alpha1 +kind: Mapping +metadata: + {{- if .name }} + name: {{ .name }} + {{- else }} + name: {{ include ".Chart.Name .fullname" $ }}-mapping + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ $.Release.Name }} + releaseVersion: {{ $.Values.releaseVersion | quote }} + pipelineName: {{ $.Values.pipelineName }} + {{- if .labels }} +{{ toYaml .labels | nindent 4 }} + {{- end }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + {{- if .ambassadorId }} + ambassador_id: {{ .ambassadorId }} + {{- end }} + {{- if .hostname }} + hostname: {{ .hostname | quote }} + {{- end }} + prefix: {{ .prefix }} + {{- if .rewrite }} + rewrite: {{ .rewrite }} + {{- end }} + service: {{ $svcName }}.{{ $.Release.Namespace }}:{{ $svcPort }} + {{- if .retryPolicy }} + retry_policy: +{{ toYaml .retryPolicy | indent 4 }} + {{- end }} + {{- if .cors }} + cors: +{{ toYaml .cors | indent 4 }} + {{- end }} + {{- if .weight }} + weight: {{ .weight }} + {{- end }} + {{- if .method }} + method: {{ .method }} + {{- end }} + {{- if .extraSpec }} +{{ toYaml .extraSpec | indent 2 }} + {{- end }} + {{- if .tls }} + {{- if .tls.context }} + tls: {{ .tls.context }} +{{- if .tls.create }} +--- +apiVersion: getambassador.io/v3alpha1 +kind: TLSContext +metadata: + name: {{ .tls.context }} + labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + releaseVersion: {{ $.Values.releaseVersion | quote }} + pipelineName: {{ $.Values.pipelineName }} + {{- if .tls.labels }} +{{ toYaml .tls.labels | nindent 4 }} + {{- end }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + {{- if .tls.secretName }} + secret: {{ .tls.secretName }} + {{- end }} + {{- if .tls.hosts }} + hosts: +{{ toYaml .tls.hosts | nindent 4 }} + {{- end }} + {{- if .tls.extraSpec }} +{{ toYaml .tls.extraSpec | indent 2 }} + {{- end }} +{{- end }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/configmap.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/configmap.yaml new file mode 100644 index 0000000000..4e7879665e --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/configmap.yaml @@ -0,0 +1,22 @@ +{{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{if eq .external false}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .name}}-{{ $.Values.app }} + labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +data: +{{ toYaml .data | trim | indent 2 }} + {{- end}} + {{- end}} +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/deployment.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/deployment.yaml new file mode 100644 index 0000000000..811ff84df5 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/deployment.yaml @@ -0,0 +1,1262 @@ + {{- $hasCMEnvExists := false -}} + {{- $hasCMVolumeExists := false -}} + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "volume"}} + {{- $hasCMVolumeExists = true}} + {{- end }} + {{- if eq .type "environment"}} + {{- $hasCMEnvExists = true}} + {{- end }} + {{- end }} + {{- end }} + + {{- $hasPVCExists := false -}} + {{- if .Values.persistentVolumeClaim.name }} + {{- $hasPVCExists = true }} + {{- end }} + + {{- $hasSecretEnvExists := false -}} + {{- $hasSecretVolumeExists := false -}} + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "volume"}} + {{- $hasSecretVolumeExists = true}} + {{- end }} + {{- if eq .type "environment"}} + {{- $hasSecretEnvExists = true}} + {{- end }} + {{- end }} + {{- end }} + {{ $CustomLabelsApp:= include "customPodLabelsContainsApp" . }} + {{ $CustomLabelsRelease:= include "customPodLabelsContainsRelease" . }} + + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include ".Chart.Name .fullname" $ }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + releaseVersion: {{ $.Values.releaseVersion | quote }} + pipelineName: {{ .Values.pipelineName }} +{{- if .Values.deploymentLabels }} +{{ toYaml .Values.deploymentLabels | indent 4 }} +{{- end }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} + +{{- if .Values.deploymentAnnotations }} + annotations: +{{ toYaml .Values.deploymentAnnotations | indent 4 }} +{{- end }} +spec: + selector: + matchLabels: +{{- if .Values.customMatchLabels }} +{{ toYaml .Values.customMatchLabels | indent 6 }} +{{- else }} + app: {{ .Values.customPodLabels.app | default (include ".Chart.Name .name" $) }} + release: {{ .Values.customPodLabels.release | default $.Release.Name }} +{{- end }} + replicas: {{ $.Values.replicaCount }} + minReadySeconds: {{ $.Values.MinReadySeconds }} + template: + metadata: + {{- if .Values.podAnnotations }} + annotations: + {{- range $key, $value := .Values.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} + labels: + {{- if not (eq "true" $CustomLabelsApp) }} + app: {{ .Values.customPodLabels.app | default (include ".Chart.Name .name" $) }} + {{- end }} + {{- if not (eq "true" $CustomLabelsRelease) }} + release: {{ .Values.customPodLabels.release |default $.Release.Name }} + {{- end }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} +{{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 8 }} +{{- end }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 8 }} +{{- end }} +{{- if .Values.podLabels }} +{{ toYaml .Values.podLabels | indent 8 }} +{{- end }} + spec: +{{- if $.Values.podExtraSpecs }} +{{ toYaml .Values.podExtraSpecs | indent 6 }} +{{- end }} + terminationGracePeriodSeconds: {{ $.Values.GracePeriod }} + restartPolicy: Always +{{- if $.Values.hostAliases }} + hostAliases: +{{ toYaml .Values.hostAliases | indent 8 }} +{{- end }} +{{- if and $.Values.Spec.Affinity.Key $.Values.Spec.Affinity.Values }} + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: {{ $.Values.Spec.Affinity.Key }} + operator: In + values: + - {{ $.Values.Spec.Affinity.Values | default "nodes" }} +{{- else if $.Values.affinity.enabled }} + affinity: +{{ toYaml .Values.affinity.values | indent 8 }} +{{- end }} +{{- if $.Values.serviceAccountName }} + serviceAccountName: {{ $.Values.serviceAccountName }} +{{- else }} + serviceAccountName: {{ template "serviceAccountName" . }} +{{- end }} +{{- if $.Values.schedulerName }} + schedulerName: {{ .Values.schedulerName }} +{{- end }} + {{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 8 }} + {{- end }} +{{- if $.Values.imagePullSecrets}} + imagePullSecrets: + {{- range .Values.imagePullSecrets }} + - name: {{ . }} + {{- end }} +{{- end}} +{{- if $.Values.topologySpreadConstraints }} + topologySpreadConstraints: +{{- range $.Values.topologySpreadConstraints }} + - maxSkew: {{ .maxSkew }} + topologyKey: {{ .topologyKey }} + whenUnsatisfiable: {{ .whenUnsatisfiable }} + {{- if semverCompare "<=1.30-0" $.Capabilities.KubeVersion.GitVersion }} + {{- if .minDomains }} + minDomains: {{ .minDomains }} + {{- end }} + {{- end }} + {{- if .nodeAffinityPolicy }} + nodeAffinityPolicy: {{ .nodeAffinityPolicy }} + {{- end }} + {{- if .nodeTaintsPolicy }} + nodeTaintsPolicy: {{ .nodeTaintsPolicy }} + {{- end }} + labelSelector: + matchLabels: + {{- if and .autoLabelSelector .customLabelSelector }} +{{ toYaml .customLabelSelector | indent 12 }} + {{- else if .autoLabelSelector }} + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ $.Release.Name }} + {{- else if .customLabelSelector }} +{{ toYaml .customLabelSelector | indent 12 }} + {{- end }} +{{- end }} +{{- end }} +{{- if $.Values.topologySpreadConstraint }} + topologySpreadConstraints: +{{ toYaml .Values.topologySpreadConstraint }} +{{- end }} +{{- if $.Values.podSecurityContext }} + securityContext: +{{ toYaml .Values.podSecurityContext | indent 8 }} +{{- end }} +{{- if $.Values.restartPolicy }} + restartPolicy: {{ $.Values.restartPolicy }} +{{- end }} +{{- if $.Values.initContainers}} + initContainers: +{{- range $i, $c := .Values.initContainers }} +{{- if .reuseContainerImage}} + - name: {{ $.Chart.Name }}-init-{{ add1 $i }} + image: "{{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} +{{- if .securityContext }} + securityContext: +{{ toYaml .securityContext | indent 12 }} +{{- end }} +{{- if .command}} + command: +{{ toYaml .command | indent 12 -}} +{{- end}} +{{- if .args}} + args: +{{ toYaml .args | indent 12 -}} +{{- end}} +{{- if .resources}} + resources: +{{ toYaml .resources | indent 12 -}} +{{- end}} +{{- if .volumeMounts}} + volumeMounts: +{{ toYaml .volumeMounts | indent 12 -}} +{{- end}} +{{- else}} + - +{{ toYaml . | indent 10 }} +{{- end}} +{{- end}} +{{- end}} + containers: + - name: {{ $.Chart.Name }} + image: "{{ .Values.server.deployment.image }}:{{ .Values.server.deployment.image_tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} + {{- if $.Values.containerSpec.lifecycle.enabled }} + lifecycle: + {{- if $.Values.containerSpec.lifecycle.preStop }} + preStop: +{{ toYaml $.Values.containerSpec.lifecycle.preStop | indent 12 -}} + {{- end }} + {{- if $.Values.containerSpec.lifecycle.postStart }} + postStart: +{{ toYaml $.Values.containerSpec.lifecycle.postStart | indent 12 -}} + {{- end }} + {{- end }} +{{- if and $.Values.containerSecurityContext $.Values.privileged }} + securityContext: + privileged: true +{{ toYaml .Values.containerSecurityContext | indent 12 }} +{{- else if $.Values.privileged }} + securityContext: + privileged: true +{{- else if $.Values.containerSecurityContext }} + securityContext: +{{ toYaml .Values.containerSecurityContext | indent 12 }} +{{- end }} +{{- if $.Values.containerExtraSpecs }} +{{ toYaml .Values.containerExtraSpecs | indent 10 }} +{{- end }} +{{- if $.Values.resizePolicy }} + resizePolicy: +{{ toYaml .Values.resizePolicy | indent 12 }} +{{- end }} + ports: + {{- range $.Values.ContainerPort }} + - name: {{ .name}} + containerPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end}} +{{- if and $.Values.command.enabled $.Values.command.workingDir }} + workingDir: {{ $.Values.command.workingDir }} +{{- end}} +{{- if and $.Values.command.value $.Values.command.enabled}} + command: +{{ toYaml $.Values.command.value | indent 12 -}} +{{- end}} +{{- if and $.Values.args.value $.Values.args.enabled}} + args: +{{ toYaml $.Values.args.value | indent 12 -}} +{{- end }} + env: + - name: CONFIG_HASH + value: {{ include (print $.Chart.Name "/templates/configmap.yaml") . | sha256sum }}{{ if and (.Values.devtronInternal) (.Values.devtronInternal.containerSpecs.ConfigHash) }}{{ .Values.devtronInternal.containerSpecs.ConfigHash }}{{ end }} + - name: SECRET_HASH + value: {{ include (print $.Chart.Name "/templates/secret.yaml") . | sha256sum }}{{ if and (.Values.devtronInternal) (.Values.devtronInternal.containerSpecs.SecretHash) }}{{ .Values.devtronInternal.containerSpecs.SecretHash }}{{ end }} + - name: DEVTRON_APP_NAME + value: {{ template ".Chart.Name .name" $ }} + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: DEVTRON_CONTAINER_REPO + value: "{{ .Values.server.deployment.image }}" + - name: DEVTRON_CONTAINER_TAG + value: "{{ .Values.server.deployment.image_tag }}" + {{- range $.Values.EnvVariablesFromFieldPath }} + - name: {{ .name }} + valueFrom: + fieldRef: + fieldPath: {{ .fieldPath }} + {{- end}} + {{- range $.Values.EnvVariables }} + {{- if and .name .value }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} + {{- end }} + {{- range $.Values.EnvVariablesFromSecretKeys }} + {{- if and .name .secretName .keyName }} + - name: {{ .name }} + valueFrom: + secretKeyRef: + name: {{ .secretName }} + key: {{ .keyName }} + {{- end }} + {{- end }} + {{- range $.Values.EnvVariablesFromConfigMapKeys }} + {{- if and .name .configMapName .keyName }} + - name: {{ .name }} + valueFrom: + configMapKeyRef: + name: {{ .configMapName }} + key: {{ .keyName }} + {{- end }} + {{- end }} + {{- if or (and ($hasCMEnvExists) (.Values.ConfigMaps.enabled)) (and ($hasSecretEnvExists) (.Values.ConfigSecrets.enabled)) }} + envFrom: + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "environment" }} + - configMapRef: + {{- if eq .external true }} + name: {{ .name }} + {{- else if eq .external false }} + name: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "environment" }} + - secretRef: + {{if eq .external true}} + name: {{ .name }} + {{else if eq .external false}} + name: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + +{{- if or $.Values.LivenessProbe.Path $.Values.LivenessProbe.command $.Values.LivenessProbe.tcp $.Values.LivenessProbe.grpc }} + livenessProbe: +{{- if $.Values.LivenessProbe.Path }} + httpGet: + path: {{ $.Values.LivenessProbe.Path }} + port: {{ $.Values.LivenessProbe.port }} + scheme: {{ $.Values.LivenessProbe.scheme }} + {{- if $.Values.LivenessProbe.httpHeaders }} + httpHeaders: + {{- range $.Values.LivenessProbe.httpHeaders}} + - name: {{.name}} + value: {{.value}} + {{- end}} + {{- end }} +{{- end }} +{{- if $.Values.LivenessProbe.command }} + exec: + command: +{{ toYaml .Values.LivenessProbe.command | indent 16 }} +{{- end}} +{{- if and $.Values.LivenessProbe.tcp }} + tcpSocket: + port: {{ $.Values.LivenessProbe.port }} +{{- end}} + initialDelaySeconds: {{ $.Values.LivenessProbe.initialDelaySeconds }} + periodSeconds: {{ $.Values.LivenessProbe.periodSeconds }} + successThreshold: {{ $.Values.LivenessProbe.successThreshold }} + timeoutSeconds: {{ $.Values.LivenessProbe.timeoutSeconds }} + failureThreshold: {{ $.Values.LivenessProbe.failureThreshold }} + {{- if $.Values.LivenessProbe.grpc }} + grpc: +{{ toYaml .Values.LivenessProbe.grpc | indent 14 }} + {{- end }} +{{- end }} +{{- if or $.Values.ReadinessProbe.Path $.Values.ReadinessProbe.command $.Values.ReadinessProbe.tcp $.Values.ReadinessProbe.grpc }} + readinessProbe: +{{- if $.Values.ReadinessProbe.Path }} + httpGet: + path: {{ $.Values.ReadinessProbe.Path }} + port: {{ $.Values.ReadinessProbe.port }} + scheme: {{ $.Values.ReadinessProbe.scheme }} + {{- if $.Values.ReadinessProbe.httpHeaders }} + httpHeaders: + {{- range $.Values.ReadinessProbe.httpHeaders}} + - name: {{.name}} + value: {{.value}} + {{- end}} + {{- end }} +{{- end }} +{{- if $.Values.ReadinessProbe.command }} + exec: + command: +{{ toYaml .Values.ReadinessProbe.command | indent 16 }} +{{- end}} +{{- if and $.Values.ReadinessProbe.tcp }} + tcpSocket: + port: {{ $.Values.ReadinessProbe.port }} +{{- end}} + initialDelaySeconds: {{ $.Values.ReadinessProbe.initialDelaySeconds }} + periodSeconds: {{ $.Values.ReadinessProbe.periodSeconds }} + successThreshold: {{ $.Values.ReadinessProbe.successThreshold }} + timeoutSeconds: {{ $.Values.ReadinessProbe.timeoutSeconds }} + failureThreshold: {{ $.Values.ReadinessProbe.failureThreshold }} + {{- if $.Values.ReadinessProbe.grpc }} + grpc: +{{ toYaml .Values.ReadinessProbe.grpc | indent 14 }} + {{- end}} +{{- end }} + resources: +{{ toYaml $.Values.resources | trim | indent 12 }} +{{- if or $.Values.StartupProbe.Path $.Values.StartupProbe.command $.Values.StartupProbe.tcp $.Values.StartupProbe.grpc }} + startupProbe: +{{- if $.Values.StartupProbe.Path }} + httpGet: + path: {{ $.Values.StartupProbe.Path }} + port: {{ $.Values.StartupProbe.port }} + {{- if $.Values.StartupProbe.httpHeaders }} + httpHeaders: + {{- range $.Values.StartupProbe.httpHeaders}} + - name: {{.name}} + value: {{.value}} + {{- end}} + {{- end }} +{{- end }} +{{- if $.Values.StartupProbe.command }} + exec: + command: +{{ toYaml .Values.StartupProbe.command | indent 16 }} +{{- end}} +{{- if and $.Values.StartupProbe.tcp }} + tcpSocket: + port: {{ $.Values.StartupProbe.port }} +{{- end}} + initialDelaySeconds: {{ $.Values.StartupProbe.initialDelaySeconds }} + periodSeconds: {{ $.Values.StartupProbe.periodSeconds }} + successThreshold: {{ $.Values.StartupProbe.successThreshold }} + timeoutSeconds: {{ $.Values.StartupProbe.timeoutSeconds }} + failureThreshold: {{ $.Values.StartupProbe.failureThreshold }} + {{- if $.Values.StartupProbe.grpc }} + grpc: +{{ toYaml .Values.StartupProbe.grpc | indent 14 }} + {{- end}} +{{- end }} + volumeMounts: +{{- with .Values.volumeMounts }} +{{ toYaml . | trim | indent 12 }} +{{- end }} +{{- if $.Values.persistentVolumeClaim.name }} + - name: {{ .Values.persistentVolumeClaim.name }}-vol + mountPath: {{ .Values.persistentVolumeClaim.mountPath | default "/tmp" }} +{{- end}} + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "volume"}} + {{- $cmName := .name -}} + {{- $cmMountPath := .mountPath -}} + {{- if eq .subPath false }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath }} + + {{- else }} + {{- range $k, $v := .data }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath }}/{{ $k}} + subPath: {{ $k}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "volume"}} + {{- $cmName := .name -}} + {{- $cmMountPath := .mountPath -}} + {{- if eq .subPath false }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath }} + + {{- else }} + {{if (or (eq .externalType "ESO_GoogleSecretsManager") (eq .externalType "ESO_AWSSecretsManager") (eq .externalType "ESO_HashiCorpVault") (eq .externalType "ESO_AzureSecretsManager"))}} + {{- if and (.esoSubPath) (ne (len .esoSubPath) 0) }} + {{- range .esoSubPath }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath}}/{{ . }} + subPath: {{ . }} + {{- end }} + {{- else }} + {{- range .esoSecretData.esoData }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath}}/{{ .secretKey }} + subPath: {{ .secretKey }} + {{- end }} + {{- end }} + {{- else }} + {{- range $k, $v := .data }} # for others secrets the mount path will be .data[i].secretKey + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath}}/{{ $k}} + subPath: {{ $k}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) }} []{{- end }} + {{- if and (eq (len .Values.volumeMounts) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) }} [] {{- end }} +{{- if $.Values.appMetrics }} + - name: envoy + image: {{ $.Values.envoyproxy.image | default "quay.io/devtron/envoy:v1.16.0"}} + {{- if $.Values.envoyproxy.lifecycle }} + lifecycle: +{{ toYaml .Values.envoyproxy.lifecycle | indent 12 -}} + {{- else if $.Values.containerSpec.lifecycle.enabled }} + lifecycle: + {{- if $.Values.containerSpec.lifecycle.preStop }} + preStop: +{{ toYaml $.Values.containerSpec.lifecycle.preStop | indent 12 -}} + {{- end }} + {{- end }} + resources: +{{ toYaml $.Values.envoyproxy.resources | trim | indent 12 }} + ports: + - containerPort: 9901 + protocol: TCP + name: envoy-admin + {{- range $index, $element := .Values.ContainerPort }} + - name: envoy-{{ $element.name}} + containerPort: {{ $element.envoyPort | default (add 8790 $index) }} + protocol: TCP + {{- end }} + command: ["/usr/local/bin/envoy"] + args: ["-c", "/etc/envoy-config/envoy-config.json", "-l", "info", "--log-format", "[METADATA][%Y-%m-%d %T.%e][%t][%l][%n] %v"] + volumeMounts: + - name: {{ $.Values.envoyproxy.configMapName | default "envoy-config-volume" }} + mountPath: /etc/envoy-config/ +{{- if $.Values.envoyproxy.readinessProbe}} + readinessProbe: +{{ toYaml $.Values.envoyproxy.readinessProbe | indent 12}} +{{- end }} +{{- if $.Values.envoyproxy.livenessProbe}} + livenessProbe: +{{ toYaml $.Values.envoyproxy.livenessProbe | indent 12}} +{{- end }} +{{- end}} +{{- if $.Values.containers }} +{{- range $i, $c := .Values.containers }} +{{- if .reuseContainerImage}} + - name: {{ $.Chart.Name }}-sidecontainer-{{ add1 $i }} + image: "{{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} +{{- if .env }} + env: +{{ toYaml .env | indent 12 }} +{{- end }} + {{- if .envFrom }} + envFrom: +{{ toYaml .env | indent 12 }} +{{- end }} +{{- if .securityContext }} + securityContext: +{{ toYaml .securityContext | indent 12 }} +{{- end }} +{{- if .command}} + command: +{{ toYaml .command | indent 12 -}} +{{- end}} +{{- if .resizePolicy }} + resizePolicy: +{{ toYaml .resziePolicy | indent 12}} +{{- end }} +{{- if .resources}} + resources: +{{ toYaml .resources | indent 12 -}} +{{- end}} +{{- if .volumeMounts}} + volumeMounts: +{{ toYaml .volumeMounts | indent 12 -}} +{{- end}} +{{- else}} + - +{{ toYaml . | indent 10 }} +{{- end}} +{{- end}} +{{- end}} + + + volumes: + {{- if $.Values.appMetrics }} + - name: envoy-config-volume + configMap: + name: sidecar-config-{{ template ".Chart.Name .name" $ }} + {{- end }} +{{- with .Values.volumes }} +{{ toYaml . | trim | indent 8 }} +{{- end }} +{{- if .Values.persistentVolumeClaim.name }} + - name: {{.Values.persistentVolumeClaim.name}}-vol + persistentVolumeClaim: + claimName: {{.Values.persistentVolumeClaim.name }} +{{- end}} + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "volume"}} + - name: {{ .name | replace "." "-"}}-vol + configMap: + {{- if eq .external true }} + name: {{ .name }} + {{- else if eq .external false }} + name: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- if eq (len .filePermission) 0 }} + {{- else }} + defaultMode: {{ .filePermission}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "volume"}} + - name: {{ .name | replace "." "-"}}-vol + secret: + {{- if eq .external true }} + secretName: {{ .name }} + {{- else if eq .external false }} + secretName: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- if eq (len .filePermission) 0 }} + {{- else }} + defaultMode: {{ .filePermission}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) (eq (.Values.appMetrics) false) }} []{{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) (eq (.Values.appMetrics) false) }} [] {{- end }} + + revisionHistoryLimit: 3 +## pauseForSecondsBeforeSwitchActive: {{ $.Values.pauseForSecondsBeforeSwitchActive }} +# waitForSecondsBeforeScalingDown: {{ $.Values.waitForSecondsBeforeScalingDown }} + strategy: + {{- if eq .Values.deploymentType "ROLLING" }} + type: "RollingUpdate" + rollingUpdate: + maxSurge: {{ $.Values.deployment.strategy.rolling.maxSurge }} + maxUnavailable: {{ $.Values.deployment.strategy.rolling.maxUnavailable }} + {{- end }} + {{- if eq .Values.deploymentType "RECREATE" }} + type: "Recreate" + {{- end }} +{{- if $.Values.secondaryWorkload.enabled }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include ".Chart.Name .fullname" $ }}-{{ $.Values.secondaryWorkload.postfix | default "sec" }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + releaseVersion: {{ $.Values.releaseVersion | quote }} + pipelineName: {{ .Values.pipelineName }} +{{- if .Values.deploymentLabels }} +{{ toYaml .Values.deploymentLabels | indent 4 }} +{{- end }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} + +{{- if .Values.deploymentAnnotations }} + annotations: +{{ toYaml .Values.deploymentAnnotations | indent 4 }} +{{- end }} +spec: + selector: + matchLabels: +{{- if .Values.customMatchLabels }} +{{ toYaml .Values.customMatchLabels | indent 6 }} +{{- else }} + app: {{ .Values.customPodLabels.app | default (include ".Chart.Name .name" $) }} + release: {{ .Values.customPodLabels.release | default $.Release.Name }} +{{- end }} + replicas: {{ $.Values.secondaryWorkload.replicaCount | default 1 }} + minReadySeconds: {{ $.Values.MinReadySeconds }} + template: + metadata: + {{- if .Values.podAnnotations }} + annotations: + {{- range $key, $value := .Values.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} + labels: + {{- if not (eq "true" $CustomLabelsApp) }} + app: {{ .Values.customPodLabels.app | default (include ".Chart.Name .name" $) }} + {{- end }} + {{- if not (eq "true" $CustomLabelsRelease) }} + release: {{ .Values.customPodLabels.release |default $.Release.Name }} + {{- end }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} +{{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 8 }} +{{- end }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 8 }} +{{- end }} +{{- if .Values.podLabels }} +{{ toYaml .Values.podLabels | indent 8 }} +{{- end }} + spec: +{{- if $.Values.podExtraSpecs }} +{{ toYaml .Values.podExtraSpecs | indent 6 }} +{{- end }} + terminationGracePeriodSeconds: {{ $.Values.GracePeriod }} + restartPolicy: Always +{{- if $.Values.hostAliases }} + hostAliases: +{{ toYaml .Values.hostAliases | indent 8 }} +{{- end }} +{{- with $.Values.secondaryWorkload }} +{{- if and .Spec.Affinity.Key .Spec.Affinity.Values }} + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: {{ .Spec.Affinity.Key }} + operator: In + values: + - {{ .Spec.Affinity.Values | default "nodes" }} +{{- else if .affinity.enabled }} + affinity: +{{ toYaml .affinity.values | indent 8 }} +{{- end }} +{{- end }} +{{- if $.Values.serviceAccountName }} + serviceAccountName: {{ $.Values.serviceAccountName }} +{{- else }} + serviceAccountName: {{ template "serviceAccountName" . }} +{{- end }} +{{- if $.Values.schedulerName }} + schedulerName: {{ .Values.schedulerName }} +{{- end }} + {{- if $.Values.secondaryWorkload.tolerations }} + tolerations: +{{ toYaml $.Values.secondaryWorkload.tolerations | indent 8 }} + {{- end }} +{{- if $.Values.imagePullSecrets}} + imagePullSecrets: + {{- range .Values.imagePullSecrets }} + - name: {{ . }} + {{- end }} +{{- end}} +{{- if $.Values.topologySpreadConstraints }} + topologySpreadConstraints: +{{- range $.Values.topologySpreadConstraints }} + - maxSkew: {{ .maxSkew }} + topologyKey: {{ .topologyKey }} + whenUnsatisfiable: {{ .whenUnsatisfiable }} + {{- if semverCompare "<=1.30-0" $.Capabilities.KubeVersion.GitVersion }} + {{- if .minDomains }} + minDomains: {{ .minDomains }} + {{- end }} + {{- end }} + {{- if .nodeAffinityPolicy }} + nodeAffinityPolicy: {{ .nodeAffinityPolicy }} + {{- end }} + {{- if .nodeTaintsPolicy }} + nodeTaintsPolicy: {{ .nodeTaintsPolicy }} + {{- end }} + labelSelector: + matchLabels: + {{- if and .autoLabelSelector .customLabelSelector }} +{{ toYaml .customLabelSelector | indent 12 }} + {{- else if .autoLabelSelector }} + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ $.Release.Name }} + {{- else if .customLabelSelector }} +{{ toYaml .customLabelSelector | indent 12 }} + {{- end }} +{{- end }} +{{- end }} +{{- if $.Values.topologySpreadConstraint }} + topologySpreadConstraints: +{{ toYaml .Values.topologySpreadConstraint }} +{{- end }} +{{- if $.Values.podSecurityContext }} + securityContext: +{{ toYaml .Values.podSecurityContext | indent 8 }} +{{- end }} +{{- if $.Values.restartPolicy }} + restartPolicy: {{ $.Values.restartPolicy }} +{{- end }} +{{- if $.Values.initContainers}} + initContainers: +{{- range $i, $c := .Values.initContainers }} +{{- if .reuseContainerImage}} + - name: {{ $.Chart.Name }}-init-{{ add1 $i }} + image: "{{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} +{{- if .securityContext }} + securityContext: +{{ toYaml .securityContext | indent 12 }} +{{- end }} +{{- if .command}} + command: +{{ toYaml .command | indent 12 -}} +{{- end}} +{{- if .args}} + args: +{{ toYaml .args | indent 12 -}} +{{- end}} +{{- if .resources}} + resources: +{{ toYaml .resources | indent 12 -}} +{{- end}} +{{- if .volumeMounts}} + volumeMounts: +{{ toYaml .volumeMounts | indent 12 -}} +{{- end}} +{{- else}} + - +{{ toYaml . | indent 10 }} +{{- end}} +{{- end}} +{{- end}} + containers: + - name: {{ $.Chart.Name }} + image: "{{ .Values.server.deployment.image }}:{{ .Values.server.deployment.image_tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} + {{- if $.Values.containerSpec.lifecycle.enabled }} + lifecycle: + {{- if $.Values.containerSpec.lifecycle.preStop }} + preStop: +{{ toYaml $.Values.containerSpec.lifecycle.preStop | indent 12 -}} + {{- end }} + {{- if $.Values.containerSpec.lifecycle.postStart }} + postStart: +{{ toYaml $.Values.containerSpec.lifecycle.postStart | indent 12 -}} + {{- end }} + {{- end }} +{{- if and $.Values.containerSecurityContext $.Values.privileged }} + securityContext: + privileged: true +{{ toYaml .Values.containerSecurityContext | indent 12 }} +{{- else if $.Values.privileged }} + securityContext: + privileged: true +{{- else if $.Values.containerSecurityContext }} + securityContext: +{{ toYaml .Values.containerSecurityContext | indent 12 }} +{{- end }} +{{- if $.Values.containerExtraSpecs }} +{{ toYaml .Values.containerExtraSpecs | indent 10 }} +{{- end }} +{{- if $.Values.resizePolicy }} + resizePolicy: +{{ toYaml .Values.resizePolicy | indent 12 }} +{{- end }} + ports: + {{- range $.Values.ContainerPort }} + - name: {{ .name}} + containerPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end}} +{{- if and $.Values.command.enabled $.Values.command.workingDir }} + workingDir: {{ $.Values.command.workingDir }} +{{- end}} +{{- if and $.Values.command.value $.Values.command.enabled}} + command: +{{ toYaml $.Values.command.value | indent 12 -}} +{{- end}} +{{- if and $.Values.args.value $.Values.args.enabled}} + args: +{{ toYaml $.Values.args.value | indent 12 -}} +{{- end }} + env: + - name: CONFIG_HASH + value: {{ include (print $.Chart.Name "/templates/configmap.yaml") . | sha256sum }}{{ if and (.Values.devtronInternal) (.Values.devtronInternal.containerSpecs.ConfigHash) }}{{ .Values.devtronInternal.containerSpecs.ConfigHash }}{{ end }} + - name: SECRET_HASH + value: {{ include (print $.Chart.Name "/templates/secret.yaml") . | sha256sum }}{{ if and (.Values.devtronInternal) (.Values.devtronInternal.containerSpecs.SecretHash) }}{{ .Values.devtronInternal.containerSpecs.SecretHash }}{{ end }} + - name: DEVTRON_APP_NAME + value: {{ template ".Chart.Name .name" $ }} + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: DEVTRON_CONTAINER_REPO + value: "{{ .Values.server.deployment.image }}" + - name: DEVTRON_CONTAINER_TAG + value: "{{ .Values.server.deployment.image_tag }}" + {{- range $.Values.EnvVariablesFromFieldPath }} + - name: {{ .name }} + valueFrom: + fieldRef: + fieldPath: {{ .fieldPath }} + {{- end}} + {{- range $.Values.EnvVariables }} + {{- if and .name .value }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} + {{- end }} + {{- range $.Values.EnvVariablesFromSecretKeys }} + {{- if and .name .secretName .keyName }} + - name: {{ .name }} + valueFrom: + secretKeyRef: + name: {{ .secretName }} + key: {{ .keyName }} + {{- end }} + {{- end }} + {{- range $.Values.EnvVariablesFromConfigMapKeys }} + {{- if and .name .configMapName .keyName }} + - name: {{ .name }} + valueFrom: + configMapKeyRef: + name: {{ .configMapName }} + key: {{ .keyName }} + {{- end }} + {{- end }} + {{- if or (and ($hasCMEnvExists) (.Values.ConfigMaps.enabled)) (and ($hasSecretEnvExists) (.Values.ConfigSecrets.enabled)) }} + envFrom: + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "environment" }} + - configMapRef: + {{- if eq .external true }} + name: {{ .name }} + {{- else if eq .external false }} + name: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "environment" }} + - secretRef: + {{if eq .external true}} + name: {{ .name }} + {{else if eq .external false}} + name: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + +{{- if or $.Values.LivenessProbe.Path $.Values.LivenessProbe.command $.Values.LivenessProbe.tcp $.Values.LivenessProbe.grpc }} + livenessProbe: +{{- if $.Values.LivenessProbe.Path }} + httpGet: + path: {{ $.Values.LivenessProbe.Path }} + port: {{ $.Values.LivenessProbe.port }} + scheme: {{ $.Values.LivenessProbe.scheme }} + {{- if $.Values.LivenessProbe.httpHeaders }} + httpHeaders: + {{- range $.Values.LivenessProbe.httpHeaders}} + - name: {{.name}} + value: {{.value}} + {{- end}} + {{- end }} +{{- end }} +{{- if $.Values.LivenessProbe.command }} + exec: + command: +{{ toYaml .Values.LivenessProbe.command | indent 16 }} +{{- end}} +{{- if and $.Values.LivenessProbe.tcp }} + tcpSocket: + port: {{ $.Values.LivenessProbe.port }} +{{- end}} + initialDelaySeconds: {{ $.Values.LivenessProbe.initialDelaySeconds }} + periodSeconds: {{ $.Values.LivenessProbe.periodSeconds }} + successThreshold: {{ $.Values.LivenessProbe.successThreshold }} + timeoutSeconds: {{ $.Values.LivenessProbe.timeoutSeconds }} + failureThreshold: {{ $.Values.LivenessProbe.failureThreshold }} + {{- if $.Values.LivenessProbe.grpc }} + grpc: +{{ toYaml .Values.LivenessProbe.grpc | indent 14 }} + {{- end }} +{{- end }} +{{- if or $.Values.ReadinessProbe.Path $.Values.ReadinessProbe.command $.Values.ReadinessProbe.tcp $.Values.ReadinessProbe.grpc }} + readinessProbe: +{{- if $.Values.ReadinessProbe.Path }} + httpGet: + path: {{ $.Values.ReadinessProbe.Path }} + port: {{ $.Values.ReadinessProbe.port }} + scheme: {{ $.Values.ReadinessProbe.scheme }} + {{- if $.Values.ReadinessProbe.httpHeaders }} + httpHeaders: + {{- range $.Values.ReadinessProbe.httpHeaders}} + - name: {{.name}} + value: {{.value}} + {{- end}} + {{- end }} +{{- end }} +{{- if $.Values.ReadinessProbe.command }} + exec: + command: +{{ toYaml .Values.ReadinessProbe.command | indent 16 }} +{{- end}} +{{- if and $.Values.ReadinessProbe.tcp }} + tcpSocket: + port: {{ $.Values.ReadinessProbe.port }} +{{- end}} + initialDelaySeconds: {{ $.Values.ReadinessProbe.initialDelaySeconds }} + periodSeconds: {{ $.Values.ReadinessProbe.periodSeconds }} + successThreshold: {{ $.Values.ReadinessProbe.successThreshold }} + timeoutSeconds: {{ $.Values.ReadinessProbe.timeoutSeconds }} + failureThreshold: {{ $.Values.ReadinessProbe.failureThreshold }} + {{- if $.Values.ReadinessProbe.grpc }} + grpc: +{{ toYaml .Values.ReadinessProbe.grpc | indent 14 }} + {{- end}} +{{- end }} + resources: +{{ toYaml $.Values.resources | trim | indent 12 }} +{{- if or $.Values.StartupProbe.Path $.Values.StartupProbe.command $.Values.StartupProbe.tcp $.Values.StartupProbe.grpc }} + startupProbe: +{{- if $.Values.StartupProbe.Path }} + httpGet: + path: {{ $.Values.StartupProbe.Path }} + port: {{ $.Values.StartupProbe.port }} + {{- if $.Values.StartupProbe.httpHeaders }} + httpHeaders: + {{- range $.Values.StartupProbe.httpHeaders}} + - name: {{.name}} + value: {{.value}} + {{- end}} + {{- end }} +{{- end }} +{{- if $.Values.StartupProbe.command }} + exec: + command: +{{ toYaml .Values.StartupProbe.command | indent 16 }} +{{- end}} +{{- if and $.Values.StartupProbe.tcp }} + tcpSocket: + port: {{ $.Values.StartupProbe.port }} +{{- end}} + initialDelaySeconds: {{ $.Values.StartupProbe.initialDelaySeconds }} + periodSeconds: {{ $.Values.StartupProbe.periodSeconds }} + successThreshold: {{ $.Values.StartupProbe.successThreshold }} + timeoutSeconds: {{ $.Values.StartupProbe.timeoutSeconds }} + failureThreshold: {{ $.Values.StartupProbe.failureThreshold }} + {{- if $.Values.StartupProbe.grpc }} + grpc: +{{ toYaml .Values.StartupProbe.grpc | indent 14 }} + {{- end}} +{{- end }} + volumeMounts: +{{- with .Values.volumeMounts }} +{{ toYaml . | trim | indent 12 }} +{{- end }} +{{- if $.Values.persistentVolumeClaim.name }} + - name: {{ .Values.persistentVolumeClaim.name }}-vol + mountPath: {{ .Values.persistentVolumeClaim.mountPath | default "/tmp" }} +{{- end}} + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "volume"}} + {{- $cmName := .name -}} + {{- $cmMountPath := .mountPath -}} + {{- if eq .subPath false }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath }} + + {{- else }} + {{- range $k, $v := .data }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath }}/{{ $k}} + subPath: {{ $k}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "volume"}} + {{- $cmName := .name -}} + {{- $cmMountPath := .mountPath -}} + {{- if eq .subPath false }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath }} + + {{- else }} + {{if (or (eq .externalType "ESO_GoogleSecretsManager") (eq .externalType "ESO_AWSSecretsManager") (eq .externalType "ESO_HashiCorpVault") (eq .externalType "ESO_AzureSecretsManager"))}} + {{- if and (.esoSubPath) (ne (len .esoSubPath) 0) }} + {{- range .esoSubPath }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath}}/{{ . }} + subPath: {{ . }} + {{- end }} + {{- else }} + {{- range .esoSecretData.esoData }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath}}/{{ .secretKey }} + subPath: {{ .secretKey }} + {{- end }} + {{- end }} + {{- else }} + {{- range $k, $v := .data }} # for others secrets the mount path will be .data[i].secretKey + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath}}/{{ $k}} + subPath: {{ $k}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) }} []{{- end }} + {{- if and (eq (len .Values.volumeMounts) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) }} [] {{- end }} +{{- if $.Values.appMetrics }} + - name: envoy + image: {{ $.Values.envoyproxy.image | default "quay.io/devtron/envoy:v1.16.0"}} + {{- if $.Values.envoyproxy.lifecycle }} + lifecycle: +{{ toYaml .Values.envoyproxy.lifecycle | indent 12 -}} + {{- else if $.Values.containerSpec.lifecycle.enabled }} + lifecycle: + {{- if $.Values.containerSpec.lifecycle.preStop }} + preStop: +{{ toYaml $.Values.containerSpec.lifecycle.preStop | indent 12 -}} + {{- end }} + {{- end }} + resources: +{{ toYaml $.Values.envoyproxy.resources | trim | indent 12 }} + ports: + - containerPort: 9901 + protocol: TCP + name: envoy-admin + {{- range $index, $element := .Values.ContainerPort }} + - name: envoy-{{ $element.name}} + containerPort: {{ $element.envoyPort | default (add 8790 $index) }} + protocol: TCP + {{- end }} + command: ["/usr/local/bin/envoy"] + args: ["-c", "/etc/envoy-config/envoy-config.json", "-l", "info", "--log-format", "[METADATA][%Y-%m-%d %T.%e][%t][%l][%n] %v"] + volumeMounts: + - name: {{ $.Values.envoyproxy.configMapName | default "envoy-config-volume" }} + mountPath: /etc/envoy-config/ +{{- if $.Values.envoyproxy.readinessProbe}} + readinessProbe: +{{ toYaml $.Values.envoyproxy.readinessProbe | indent 12}} +{{- end }} +{{- if $.Values.envoyproxy.livenessProbe}} + livenessProbe: +{{ toYaml $.Values.envoyproxy.livenessProbe | indent 12}} +{{- end }} +{{- end}} +{{- if $.Values.containers }} +{{- range $i, $c := .Values.containers }} +{{- if .reuseContainerImage}} + - name: {{ $.Chart.Name }}-sidecontainer-{{ add1 $i }} + image: "{{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} +{{- if .env }} + env: +{{ toYaml .env | indent 12 }} +{{- end }} + {{- if .envFrom }} + envFrom: +{{ toYaml .env | indent 12 }} +{{- end }} +{{- if .securityContext }} + securityContext: +{{ toYaml .securityContext | indent 12 }} +{{- end }} +{{- if .command}} + command: +{{ toYaml .command | indent 12 -}} +{{- end}} +{{- if .resizePolicy }} + resizePolicy: +{{ toYaml .resziePolicy | indent 12}} +{{- end }} +{{- if .resources}} + resources: +{{ toYaml .resources | indent 12 -}} +{{- end}} +{{- if .volumeMounts}} + volumeMounts: +{{ toYaml .volumeMounts | indent 12 -}} +{{- end}} +{{- else}} + - +{{ toYaml . | indent 10 }} +{{- end}} +{{- end}} +{{- end}} + + + volumes: + {{- if $.Values.appMetrics }} + - name: envoy-config-volume + configMap: + name: sidecar-config-{{ template ".Chart.Name .name" $ }} + {{- end }} +{{- with .Values.volumes }} +{{ toYaml . | trim | indent 8 }} +{{- end }} +{{- if .Values.persistentVolumeClaim.name }} + - name: {{.Values.persistentVolumeClaim.name}}-vol + persistentVolumeClaim: + claimName: {{.Values.persistentVolumeClaim.name }} +{{- end}} + {{- if .Values.ConfigMaps.enabled }} + {{- range .Values.ConfigMaps.maps }} + {{- if eq .type "volume"}} + - name: {{ .name | replace "." "-"}}-vol + configMap: + {{- if eq .external true }} + name: {{ .name }} + {{- else if eq .external false }} + name: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- if eq (len .filePermission) 0 }} + {{- else }} + defaultMode: {{ .filePermission}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + + {{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{- if eq .type "volume"}} + - name: {{ .name | replace "." "-"}}-vol + secret: + {{- if eq .external true }} + secretName: {{ .name }} + {{- else if eq .external false }} + secretName: {{ .name}}-{{ $.Values.app }} + {{- end }} + {{- if eq (len .filePermission) 0 }} + {{- else }} + defaultMode: {{ .filePermission}} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) (eq (.Values.appMetrics) false) }} []{{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) (eq (.Values.appMetrics) false) }} [] {{- end }} + + revisionHistoryLimit: 3 +## pauseForSecondsBeforeSwitchActive: {{ $.Values.pauseForSecondsBeforeSwitchActive }} +# waitForSecondsBeforeScalingDown: {{ $.Values.waitForSecondsBeforeScalingDown }} + strategy: + {{- if eq .Values.deploymentType "ROLLING" }} + type: "RollingUpdate" + rollingUpdate: + maxSurge: {{ $.Values.deployment.strategy.rolling.maxSurge }} + maxUnavailable: {{ $.Values.deployment.strategy.rolling.maxUnavailable }} + {{- end }} + {{- if eq .Values.deploymentType "RECREATE" }} + type: "Recreate" + {{- end }} +{{- end }} + diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/externalsecrets.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/externalsecrets.yaml new file mode 100644 index 0000000000..efd291af5d --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/externalsecrets.yaml @@ -0,0 +1,76 @@ +{{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{if eq .external true }} + {{if (or (eq .externalType "ESO_GoogleSecretsManager") (eq .externalType "ESO_AWSSecretsManager") (eq .externalType "ESO_HashiCorpVault") (eq .externalType "ESO_AzureSecretsManager"))}} +{{- if .esoSecretData.secretStore }} +--- +apiVersion: external-secrets.io/v1beta1 +kind: SecretStore +metadata: + name: {{ .name}} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + provider: + {{- toYaml .esoSecretData.secretStore | nindent 4 }} +{{- end }} +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: {{ .name }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + {{- if .esoSecretData.refreshInterval }} + refreshInterval: {{ .esoSecretData.refreshInterval }} + {{- else }} + refreshInterval: 1h + {{- end}} + {{- if and .esoSecretData.secretStoreRef (not .esoSecretData.secretStore) }} + secretStoreRef: +{{ toYaml .esoSecretData.secretStoreRef | indent 4 }} + {{- else }} + secretStoreRef: + name: {{ .name}} + kind: SecretStore + {{- end }} + target: + name: {{ .name}} + {{- if .esoSecretData.template }} + template: + {{- toYaml .esoSecretData.template | nindent 6 }} + {{- end }} + creationPolicy: Owner + {{- if .esoSecretData.esoDataFrom }} + dataFrom: + {{- toYaml .esoSecretData.esoDataFrom | nindent 4 }} + {{- else }} + data: + {{- range .esoSecretData.esoData }} + - secretKey: {{ .secretKey }} + remoteRef: + key: {{ .key }} + {{- if .property }} + property: {{ .property }} + {{- end }} + {{- end}} +{{- end}} +{{- end}} +{{- end}} +{{- end}} +{{- end}} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/flagger.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/flagger.yaml new file mode 100644 index 0000000000..766098fb61 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/flagger.yaml @@ -0,0 +1,164 @@ +{{- if .Values.flaggerCanary.enabled }} +{{ if .Values.flaggerCanary.createIstioGateway.enabled -}} +{{- with .Values.flaggerCanary.createIstioGateway }} +apiVersion: networking.istio.io/v1beta1 +kind: Gateway +metadata: + name: {{ template ".Chart.Name .fullname" $ }}-istio-gateway + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .labels }} +{{ toYaml .labels | indent 4 }} + {{- end }} +{{- if .annotations }} + annotations: +{{ toYaml .annotations | indent 4 }} +{{- end }} +spec: + selector: + istio: ingressgateway + servers: + - port: + number: 80 + name: http + protocol: HTTP + hosts: + - {{ .host | quote -}} +{{- if .tls.enabled }} + tls: + httpsRedirect: true + - port: + number: 443 + name: https + protocol: HTTPS + hosts: + - {{ .host | quote }} + tls: + mode: SIMPLE + credentialName: {{ .tls.secretName }} +{{ end }} +{{ end }} +{{ end }} +{{ end }} +--- +{{- if .Values.flaggerCanary.enabled }} +{{- with .Values.flaggerCanary }} +apiVersion: flagger.app/v1beta1 +kind: Canary +metadata: + name: {{ template ".Chart.Name .fullname" $ }}-canary + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .labels }} +{{ toYaml .labels | indent 4 }} + {{- end }} +{{- if .annotations }} + annotations: +{{ toYaml .annotations | indent 4 }} +{{- end }} +spec: + targetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include ".Chart.Name .fullname" $ }} +{{- if $.Values.autoscaling.enabled }} + autoscalerRef: + apiVersion: autoscaling/v1 + kind: HorizontalPodAutoscaler + name: {{ template ".Chart.Name .fullname" $ }}-hpa +{{- end }} + service: + portDiscovery: {{ .portDiscovery }} + port: {{ .serviceport }} + targetPort: {{ .targetPort }} + {{- if .appProtocol }} + appProtocol: {{ .appProtocol }} + {{- end }} +{{- if $.Values.flaggerCanary.gatewayRefs }} + gatewayRefs: +{{ toYaml $.Values.flaggerCanary.gatewayRefs | indent 6 }} +{{- end }} + {{- if or .createIstioGateway.enabled .addOtherGateways }} + gateways: + {{- if .createIstioGateway.enabled }} + - {{ template ".Chart.Name .fullname" $ }}-istio-gateway + {{- end }} + {{- if .addOtherGateways }} + {{- range .addOtherGateways }} + - {{ . }} + {{- end }} + {{- end }} + {{- end }} + {{- if or .createIstioGateway.enabled .addOtherHosts }} + hosts: + {{- if .createIstioGateway.enabled }} + - {{ .createIstioGateway.host | quote }} + {{- end }} + {{- if .addOtherHosts }} + {{- range .addOtherHosts }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- end }} + {{- if .retries }} + retries: +{{ toYaml .retries | indent 6 }} + {{- end }} + {{- if .match }} + match: + {{- range .match }} + - uri: + prefix: {{ .uri.prefix }} + {{- end }} + {{- end }} + {{- if .rewriteUri }} + rewrite: + uri: {{ .rewriteUri }} + {{- end }} + {{- if .timeout }} + timeout: {{ .timeout }} + {{- end }} +{{- if $.Values.flaggerCanary.headers }} + headers: +{{ toYaml $.Values.flaggerCanary.headers | indent 6 }} +{{- end }} +{{- if $.Values.flaggerCanary.corsPolicy }} + corsPolicy: +{{ toYaml $.Values.flaggerCanary.corsPolicy | indent 6 }} +{{- end }} + analysis: + interval: {{ .analysis.interval }} + threshold: {{ .analysis.threshold }} + maxWeight: {{ .analysis.maxWeight }} + stepWeight: {{ .analysis.stepWeight }} + metrics: + - name: request-success-rate + threshold: {{ .thresholds.successRate }} + interval: 1m + - name: request-duration + threshold: {{ .thresholds.latency }} + interval: 1m + webhooks: + {{- if .loadtest.enabled }} + - name: load-test + url: {{ .loadtest.url }} + timeout: 5s + metadata: + cmd: "hey -z 1m -q 10 -c 2 http://{{ include ".Chart.Name .fullname" $ }}-canary.{{ $.Release.Namespace }}:{{ $.Values.flaggerCanary.targetPort }}/" + {{- end }} +{{- end }} +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/generic.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/generic.yaml new file mode 100644 index 0000000000..db95e84267 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/generic.yaml @@ -0,0 +1,4 @@ +{{- range .Values.rawYaml }} +--- +{{ toYaml . }} + {{- end -}} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/hpa.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/hpa.yaml new file mode 100644 index 0000000000..fd7c7e3f60 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/hpa.yaml @@ -0,0 +1,177 @@ +{{- if $.Values.autoscaling.enabled }} +{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} +apiVersion: autoscaling/v2 +{{- else if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }} +apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} +kind: HorizontalPodAutoscaler +metadata: + {{- if $.Values.autoscaling.name }} + name: {{ $.Values.autoscaling.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-hpa + {{- end }} + {{- if .Values.autoscaling.annotations }} + annotations: +{{ toYaml .Values.autoscaling.annotations | indent 4 }} + {{- end }} + labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + {{- if .Values.autoscaling.labels }} +{{ toYaml .Values.autoscaling.labels | indent 4 }} + {{- end }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include ".Chart.Name .fullname" $ }} + minReplicas: {{ $.Values.autoscaling.MinReplicas }} + maxReplicas: {{ $.Values.autoscaling.MaxReplicas }} + metrics: + {{- if $.Values.autoscaling.containerResource.enabled }} + {{- with $.Values.autoscaling.containerResource }} + {{- if .TargetCPUUtilizationPercentage }} + - type: ContainerResource + containerResource: + name: cpu + container: {{ $.Chart.Name }} + target: + type: Utilization + averageUtilization: {{ .TargetCPUUtilizationPercentage }} + {{- end}} + {{- if .TargetMemoryUtilizationPercentage }} + - type: ContainerResource + containerResource: + name: memory + container: {{ $.Chart.Name }} + target: + type: Utilization + averageUtilization: {{ .TargetMemoryUtilizationPercentage }} + {{- end}} + {{- end }} + {{- end }} + {{- if $.Values.autoscaling.TargetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + {{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ $.Values.autoscaling.TargetMemoryUtilizationPercentage }} + {{- else }} + targetAverageUtilization: {{ $.Values.autoscaling.TargetMemoryUtilizationPercentage }} + {{- end }} + {{- end }} + {{- if $.Values.autoscaling.TargetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + {{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ $.Values.autoscaling.TargetCPUUtilizationPercentage }} + {{- else }} + targetAverageUtilization: {{ $.Values.autoscaling.TargetCPUUtilizationPercentage }} + {{- end }} + {{- end }} + {{- if and $.Values.autoscaling.extraMetrics (semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion) }} + {{- toYaml $.Values.autoscaling.extraMetrics | nindent 2 }} + {{- end}} + {{- if and $.Values.autoscaling.behavior (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + behavior: + {{- toYaml $.Values.autoscaling.behavior | nindent 4 }} + {{- end }} + {{- end }} +{{- if and $.Values.secondaryWorkload.enabled $.Values.secondaryWorkload.autoscaling.enabled }} +--- +{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} +apiVersion: autoscaling/v2 +{{- else if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }} +apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} +kind: HorizontalPodAutoscaler +metadata: + name: {{ template ".Chart.Name .fullname" $ }}-{{ $.Values.secondaryWorkload.postfix | default "sec" }}-hpa + {{- if .Values.autoscaling.annotations }} + annotations: +{{ toYaml .Values.autoscaling.annotations | indent 4 }} + {{- end }} + {{- if .Values.autoscaling.labels }} + labels: +{{ toYaml .Values.autoscaling.labels | indent 4 }} + {{- end }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include ".Chart.Name .fullname" $ }}-{{ $.Values.secondaryWorkload.postfix | default "sec" }} + {{- with $.Values.secondaryWorkload }} + minReplicas: {{ .autoscaling.MinReplicas }} + maxReplicas: {{ .autoscaling.MaxReplicas }} + metrics: + {{- if .autoscaling.containerResource.enabled }} + {{- with .autoscaling.containerResource }} + {{- if .TargetCPUUtilizationPercentage }} + - type: ContainerResource + containerResource: + name: cpu + container: {{ $.Chart.Name }} + target: + type: Utilization + averageUtilization: {{ .TargetCPUUtilizationPercentage }} + {{- end}} + {{- if .TargetMemoryUtilizationPercentage }} + - type: ContainerResource + containerResource: + name: memory + container: {{ $.Chart.Name }} + target: + type: Utilization + averageUtilization: {{ .TargetMemoryUtilizationPercentage }} + {{- end}} + {{- end }} + {{- end }} + {{- if .autoscaling.TargetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + {{- if semverCompare ">=1.16-0" $.Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ .autoscaling.TargetMemoryUtilizationPercentage }} + {{- else }} + targetAverageUtilization: {{ .autoscaling.TargetMemoryUtilizationPercentage }} + {{- end }} + {{- end }} + {{- if .autoscaling.TargetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + {{- if semverCompare ">=1.16-0" $.Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ .autoscaling.TargetCPUUtilizationPercentage }} + {{- else }} + targetAverageUtilization: {{ .autoscaling.TargetCPUUtilizationPercentage }} + {{- end }} + {{- end }} + {{- if and .autoscaling.extraMetrics (semverCompare ">=1.16-0" $.Capabilities.KubeVersion.GitVersion) }} + {{- toYaml .autoscaling.extraMetrics | nindent 2 }} + {{- end}} + {{- if and .autoscaling.behavior (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + behavior: + {{- toYaml .autoscaling.behavior | nindent 4 }} + {{- end }} + {{- end }} + {{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/ingress.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/ingress.yaml new file mode 100644 index 0000000000..d9a2543e98 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/ingress.yaml @@ -0,0 +1,188 @@ +{{ $svcName := include ".servicename" . }} +{{ $svcPort := (index .Values.ContainerPort 0).servicePort }} +{{- if $.Values.ingress.enabled -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- if and .Values.ingressInternal.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingressInternal.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingressInternal.annotations "kubernetes.io/ingress.class" .Values.ingressInternal.className}} + {{- end }} +{{- end }} +{{- end }} +--- +{{ if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + {{- if $.Values.ingress.name }} + name: {{ $.Values.ingress.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" . }}-ingress + {{- end }} + namespace: {{ $.Values.NameSpace }} + labels: + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Release.Name }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} + {{- if .Values.ingress.labels }} +{{ toYaml .Values.ingress.labels | indent 4 }} + {{- end }} +{{- if .Values.ingress.annotations }} + annotations: +{{ toYaml .Values.ingress.annotations | indent 4 }} +{{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + rules: + {{- if or .Values.ingress.host .Values.ingress.path }} + - host: {{ .Values.ingress.host }} + http: + paths: + - path: {{ .Values.ingress.path }} + {{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ $.Values.ingress.pathType | default "ImplementationSpecific" }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $svcName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $svcName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- if and ($.Values.ingress.hosts) (not ($.Values.ingress.host )) }} + {{- range .Values.ingress.hosts }} + {{ $outer := . -}} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + {{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ $outer.pathType | default "ImplementationSpecific" | quote }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $svcName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $svcName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- if .additionalBackends }} +{{ toYaml .additionalBackends | indent 10 }} + {{- end }} + + {{- end }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: +{{ toYaml .Values.ingress.tls | indent 4 }} + {{- end -}} +{{- end }} +{{- if $.Values.ingressInternal.enabled }} +--- +{{ if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{ else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{ else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + {{- if $.Values.ingressInternal.name }} + name: {{ $.Values.ingressInternal.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" . }}-ingress-internal + {{- end }} + namespace: {{ $.Values.NameSpace }} + labels: + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Release.Name }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} +{{- if .Values.ingressInternal.annotations }} + annotations: +{{ toYaml .Values.ingressInternal.annotations | indent 4 }} +{{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingressInternal.className }} + {{- end }} + rules: + {{- if or .Values.ingressInternal.host .Values.ingressInternal.path }} + - host: {{ .Values.ingressInternal.host }} + http: + paths: + - path: {{ .Values.ingressInternal.path }} + {{- if and .Values.ingressInternal.pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ $.Values.ingressInternal.pathType | default "Prefix" | quote }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $svcName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $svcName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- if and ($.Values.ingressInternal.hosts) (not ($.Values.ingressInternal.host )) }} + {{- range .Values.ingressInternal.hosts }} + {{ $outer := . -}} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + {{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ $outer.pathType | default "ImplementationSpecific" | quote }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $svcName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $svcName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- if .additionalBackends }} +{{ toYaml .additionalBackends | indent 10 }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.ingressInternal.tls }} + tls: +{{ toYaml .Values.ingressInternal.tls | indent 4 }} + {{- end -}} +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-authorizationpolicy.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-authorizationpolicy.yaml new file mode 100644 index 0000000000..8340555ff3 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-authorizationpolicy.yaml @@ -0,0 +1,41 @@ +{{- with .Values.istio }} +{{- if and .enable .authorizationPolicy.enabled }} +apiVersion: security.istio.io/v1beta1 +kind: AuthorizationPolicy +metadata: + {{- if .authorizationPolicy.name }} + name: {{ .authorizationPolicy.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }} + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .authorizationPolicy.labels }} +{{ toYaml .authorizationPolicy.labels | indent 4 }} + {{- end }} +{{- if .authorizationPolicy.annotations }} + annotations: +{{ toYaml .authorizationPolicy.annotations | indent 4 }} +{{- end }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ template ".Chart.Name .fullname" $ }} + action: {{ .authorizationPolicy.action }} +{{- if $.Values.istio.authorizationPolicy.provider }} + provider: +{{ toYaml $.Values.istio.authorizationPolicy.provider | indent 4 }} +{{- end }} +{{- if $.Values.istio.authorizationPolicy.rules }} + rules: +{{ toYaml $.Values.istio.authorizationPolicy.rules | indent 4 }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-destinationrule.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-destinationrule.yaml new file mode 100644 index 0000000000..4d06deb0b8 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-destinationrule.yaml @@ -0,0 +1,38 @@ +{{- with .Values.istio }} +{{- if and .enable .destinationRule.enabled }} +apiVersion: networking.istio.io/v1beta1 +kind: DestinationRule +metadata: + {{- if .destinationRule.name }} + name: {{ .destinationRule.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-destinationrule + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .destinationRule.labels }} +{{ toYaml .destinationRule.labels | indent 4 }} + {{- end }} +{{- if .destinationRule.annotations }} + annotations: +{{ toYaml .destinationRule.annotations | indent 4 }} +{{- end }} +spec: + host: "{{ include ".servicename" $ }}.{{ $.Release.Namespace }}.svc.cluster.local" +{{- if $.Values.istio.destinationRule.subsets }} + subsets: +{{ toYaml $.Values.istio.destinationRule.subsets | indent 4 }} +{{- end }} +{{- if $.Values.istio.destinationRule.trafficPolicy }} + trafficPolicy: +{{ toYaml $.Values.istio.destinationRule.trafficPolicy | indent 4 }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-gateway.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-gateway.yaml new file mode 100644 index 0000000000..b145d6c569 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-gateway.yaml @@ -0,0 +1,71 @@ +{{- if and .Values.istio.enable .Values.istio.gateway.enabled -}} +apiVersion: networking.istio.io/v1beta1 +kind: Gateway +metadata: + {{- if .Values.istio.gateway.name }} + name: {{ .Values.istio.gateway.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-istio-gateway + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if $.Values.istio.gateway.labels }} +{{ toYaml $.Values.istio.gateway.labels | indent 4 }} + {{- end }} +{{- if $.Values.istio.gateway.annotations }} + annotations: +{{ toYaml $.Values.istio.gateway.annotations | indent 4 }} +{{- end }} +spec: +{{ with $.Values.istio.gateway }} + selector: + {{- if .selector }} + {{- toYaml .selector | nindent 4 }} + {{- else }} + istio: ingressgateway + {{- end }} + servers: + {{- if .servers }} + {{- toYaml .servers | nindent 2 }} + {{- else }} + - port: + number: 80 + name: http + protocol: HTTP + hosts: +{{- if .host }} + - {{ .host | quote -}} +{{- else if .hosts }} +{{- range .hosts }} + - {{ . | quote }} +{{- end }} +{{- end }} +{{- if .tls.enabled }} + tls: + httpsRedirect: true + - port: + number: 443 + name: https + protocol: HTTPS + hosts: +{{- if .host }} + - {{ .host | quote }} +{{- else if .hosts }} +{{- range .hosts }} + - {{ . | quote }} +{{- end }} +{{- end }} + tls: + mode: SIMPLE + credentialName: {{ .tls.secretName }} +{{ end }} +{{ end }} +{{ end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-peerauthentication.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-peerauthentication.yaml new file mode 100644 index 0000000000..dedd971c6d --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-peerauthentication.yaml @@ -0,0 +1,40 @@ +{{- with .Values.istio }} +{{- if and .enable .peerAuthentication.enabled }} +apiVersion: security.istio.io/v1beta1 +kind: PeerAuthentication +metadata: + {{- if .peerAuthentication.name }} + name: {{ .peerAuthentication.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }} + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .peerAuthentication.labels }} +{{ toYaml .peerAuthentication.labels | indent 4 }} + {{- end }} +{{- if .peerAuthentication.annotations }} + annotations: +{{ toYaml .peerAuthentication.annotations | indent 4 }} +{{- end }} +spec: +{{- if .peerAuthentication.selector.enabled }} + selector: + matchLabels: + app.kubernetes.io/name: {{ template ".Chart.Name .fullname" $ }} +{{- end }} + mtls: + mode: {{ .peerAuthentication.mtls.mode }} +{{- if $.Values.istio.peerAuthentication.portLevelMtls }} + portLevelMtls: +{{ toYaml $.Values.istio.peerAuthentication.portLevelMtls | indent 4 }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-requestauthentication.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-requestauthentication.yaml new file mode 100644 index 0000000000..49bb89552d --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-requestauthentication.yaml @@ -0,0 +1,38 @@ +{{- with .Values.istio }} +{{- if and .enable .requestAuthentication.enabled }} +apiVersion: security.istio.io/v1beta1 +kind: RequestAuthentication +metadata: + {{- if .requestAuthentication.name }} + name: {{.requestAuthentication.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }} + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .requestAuthentication.labels }} +{{ toYaml .requestAuthentication.labels | indent 4 }} + {{- end }} +{{- if .requestAuthentication.annotations }} + annotations: +{{ toYaml .requestAuthentication.annotations | indent 4 }} +{{- end }} +spec: +{{- if .requestAuthentication.selector.enabled }} + selector: + matchLabels: + app.kubernetes.io/name: {{ template ".Chart.Name .fullname" $ }} +{{- end }} +{{- if $.Values.istio.requestAuthentication.jwtRules }} + jwtRules: +{{ toYaml $.Values.istio.requestAuthentication.jwtRules | indent 2 }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-virtualservice.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-virtualservice.yaml new file mode 100644 index 0000000000..32a3380228 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/istio-virtualservice.yaml @@ -0,0 +1,68 @@ +{{- with .Values.istio }} +{{- if and .enable .virtualService.enabled }} +apiVersion: networking.istio.io/v1beta1 +kind: VirtualService +metadata: + {{- if .virtualService.name }} + name: {{ .virtualService.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-virtualservice + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if .virtualService.labels }} +{{ toYaml .virtualService.labels | indent 4 }} + {{- end }} +{{- if .virtualService.annotations }} + annotations: +{{ toYaml .virtualService.annotations | indent 4 }} +{{- end }} +spec: +{{- if or .gateway.enabled .virtualService.gateways }} + gateways: + {{- if .gateway.enabled }} + {{- if .gateway.name }} + - {{ .gateway.name }} + {{- else }} + - {{ template ".Chart.Name .fullname" $ }}-istio-gateway + {{- end }} + {{- end }} + {{- range .virtualService.gateways }} + - {{ . | quote }} + {{- end }} +{{- end }} +{{- if or .gateway.enabled .virtualService.hosts }} + hosts: + {{- if .gateway.enabled }} + {{- if .gateway.host }} + - {{ .gateway.host | quote }} + {{- else if .gateway.hosts }} +{{- range .gateway.hosts }} + - {{ . | quote }} +{{- end }} + {{- end }} + {{- end }} + {{- range .virtualService.hosts }} + - {{ . | quote }} + {{- end }} +{{- else }} + hosts: + {{- if $.Values.service.name }} + - {{ $.Values.service.name }}.{{ $.Release.Namespace }}.svc.cluster.local + {{- else }} + - "{{ include ".servicename" $ }}.{{ $.Release.Namespace }}.svc.cluster.local" + {{- end }} +{{- end }} +{{- if $.Values.istio.virtualService.http }} + http: +{{ toYaml $.Values.istio.virtualService.http | indent 4 }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/keda-autoscaling.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/keda-autoscaling.yaml new file mode 100644 index 0000000000..780afa73b1 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/keda-autoscaling.yaml @@ -0,0 +1,78 @@ +{{- if $.Values.kedaAutoscaling.enabled }} +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + {{- if $.Values.kedaAutoscaling.name }} + name: {{ $.Values.kedaAutoscaling.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-keda + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ .Release.Name }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} + {{- if .Values.kedaAutoscaling.labels }} +{{ toYaml .Values.kedaAutoscaling.labels | indent 4 }} + {{- end }} + {{- if .Values.kedaAutoscaling.annotations }} + annotations: +{{ toYaml .Values.kedaAutoscaling.annotations | indent 4 }} + {{- end }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include ".Chart.Name .fullname" $ }} +{{- if $.Values.kedaAutoscaling.envSourceContainerName }} + envSourceContainerName: {{ $.Values.kedaAutoscaling.envSourceContainerName }} +{{- end }} +{{- if $.Values.kedaAutoscaling.pollingInterval }} + pollingInterval: {{ $.Values.kedaAutoscaling.pollingInterval }} +{{- end }} +{{- if $.Values.kedaAutoscaling.cooldownPeriod }} + cooldownPeriod: {{ $.Values.kedaAutoscaling.cooldownPeriod }} +{{- end }} +{{- if $.Values.kedaAutoscaling.idleReplicaCount }} + idleReplicaCount: {{ $.Values.kedaAutoscaling.idleReplicaCount }} +{{- end }} + minReplicaCount: {{ $.Values.kedaAutoscaling.minReplicaCount }} + maxReplicaCount: {{ $.Values.kedaAutoscaling.maxReplicaCount }} +{{- if $.Values.kedaAutoscaling.fallback }} + fallback: +{{ toYaml $.Values.kedaAutoscaling.fallback | indent 4 }} +{{- end }} +{{- if $.Values.kedaAutoscaling.advanced }} + advanced: +{{ toYaml $.Values.kedaAutoscaling.advanced | indent 4 }} +{{- end }} + triggers: +{{ toYaml .Values.kedaAutoscaling.triggers | indent 2}} +{{- if $.Values.kedaAutoscaling.authenticationRef }} + authenticationRef: +{{ toYaml $.Values.kedaAutoscaling.authenticationRef | indent 6 }} +{{- end }} +--- +{{- if $.Values.kedaAutoscaling.triggerAuthentication.enabled }} +apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: {{ $.Values.kedaAutoscaling.triggerAuthentication.name }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} +spec: +{{ toYaml $.Values.kedaAutoscaling.triggerAuthentication.spec | indent 2 }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/metrics-service-monitor.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/metrics-service-monitor.yaml new file mode 100644 index 0000000000..fa5321d303 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/metrics-service-monitor.yaml @@ -0,0 +1,35 @@ +{{- if $.Values.appMetrics -}} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template ".Chart.Name .fullname" $ }} + labels: + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Values.prometheus.release }} +spec: + jobLabel: {{ template ".Chart.Name .name" $ }} + endpoints: + - port: envoy-admin + interval: 30s + path: /stats/prometheus + relabelings: + - action: replace + sourceLabels: + - __meta_kubernetes_pod_label_pod_template_hash + targetLabel: devtron_app_hash + selector: + matchLabels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + namespaceSelector: + matchNames: + - {{.Release.Namespace}} + podTargetLabels: + - appId + - envId + - devtron_app_hash +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/networkpolicy.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/networkpolicy.yaml new file mode 100644 index 0000000000..ee8bdaf8be --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/networkpolicy.yaml @@ -0,0 +1,52 @@ +{{- if .Values.networkPolicy.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + {{- if .Values.networkPolicy.name }} + name: {{ .Values.networkPolicy.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-networkpolicy + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} + {{- if $.Values.networkPolicy.labels }} +{{ toYaml $.Values.networkPolicy.labels | indent 4 }} + {{- end }} +{{- if $.Values.networkPolicy.annotations }} + annotations: +{{ toYaml $.Values.networkPolicy.annotations | indent 4 }} +{{- end }} +spec: + podSelector: +{{- if .podSelector.matchExpressions }} + matchExpressions: +{{ toYaml $.Values.networkPolicy.podSelector.matchExpressions | indent 6 }} +{{- end }} +{{- if .podSelector.matchLabels }} + matchLabels: +{{ toYaml $.Values.networkPolicy.podSelector.matchLabels | indent 6 }} +{{- else }} + matchLabels: + app: {{ template ".Chart.Name .name" $ }} + release: {{ $.Release.Name }} +{{- end }} +{{- if .policyTypes }} + policyTypes: +{{ toYaml $.Values.networkPolicy.policyTypes | indent 4 }} +{{- end }} +{{- if .ingress }} + ingress: +{{ toYaml $.Values.networkPolicy.ingress | indent 4 }} +{{- end }} +{{- if .egress }} + egress: +{{ toYaml $.Values.networkPolicy.ingress | indent 4}} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/persistent-volume-claim.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/persistent-volume-claim.yaml new file mode 100644 index 0000000000..bf4e6dfb71 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/persistent-volume-claim.yaml @@ -0,0 +1,24 @@ +{{- if .Values.persistentVolumeClaim.name }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{.Values.persistentVolumeClaim.name }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} +{{- with .Values.persistentVolumeClaim }} +spec: + accessModes: +{{- range .accessMode }} + - {{ . }} +{{- end }} + resources: + requests: + storage: {{ .storage | default "5Gi" }} + storageClassName: {{ .storageClassName | default "default" }} + volumeMode: {{ .volumeMode | default "Filesystem" }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/poddisruptionbudget.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/poddisruptionbudget.yaml new file mode 100644 index 0000000000..9094fd82e6 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/poddisruptionbudget.yaml @@ -0,0 +1,38 @@ +{{- if .Values.podDisruptionBudget }} +{{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: policy/v1 +{{- else -}} +apiVersion: policy/v1beta1 +{{- end }} +kind: PodDisruptionBudget +metadata: + {{- if .Values.podDisruptionBudget.name }} + name: {{ .Values.podDisruptionBudget.name }} + {{- else }} + name: {{ include ".Chart.Name .fullname" $ }} + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 6 }} + {{- else }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + {{- end }} + {{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/pre-sync-job.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/pre-sync-job.yaml new file mode 100644 index 0000000000..54c9f636ee --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/pre-sync-job.yaml @@ -0,0 +1,29 @@ +{{- if $.Values.dbMigrationConfig.enabled }} +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ template ".Chart.Name .fullname" $ }}-migrator + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + annotations: + argocd.argoproj.io/hook: PreSync +# argocd.argoproj.io/hook-delete-policy: HookSucceeded +spec: + template: + spec: + containers: + - name: migrator + image: 686244538589.dkr.ecr.us-east-2.amazonaws.com/migrator:0.0.1-rc14 + env: + {{- range $.Values.dbMigrationConfig.envValues }} + - name: {{ .key}} + value: {{ .value | quote }} + {{- end}} + restartPolicy: Never + backoffLimit: 0 +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/prometheusrules.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/prometheusrules.yaml new file mode 100644 index 0000000000..c285de1388 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/prometheusrules.yaml @@ -0,0 +1,33 @@ +{{- if .Values.prometheusRule.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + {{- if .Values.prometheusRule.name }} + name: {{ .Values.prometheusRule.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" . }} + {{- end }} + {{- if .Values.prometheusRule.namespace }} + namespace: {{ .Values.prometheusRule.namespace }} + {{- end }} + labels: + kind: Prometheus + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ .Values.prometheus.release }} + {{- if .Values.prometheusRule.additionalLabels }} +{{ toYaml .Values.prometheusRule.additionalLabels | indent 4 }} + {{- end }} +spec: + {{- with .Values.prometheusRule.rules }} + groups: + {{- if $.Values.prometheusRule.name }} + - name: {{ $.Values.prometheusRule.name }} + {{- else }} + - name: {{ template ".Chart.Name .fullname" $ }} + {{- end }} + rules: {{- toYaml . | nindent 6 }} + {{- end }} + {{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/secret.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/secret.yaml new file mode 100644 index 0000000000..5ac3ae1410 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/secret.yaml @@ -0,0 +1,84 @@ +{{- if $.Values.secret.enabled }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: app-secret + labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +type: Opaque +data: +{{ toYaml $.Values.secret.data | indent 2 }} +{{- end }} + + +{{- if .Values.ConfigSecrets.enabled }} + {{- range .Values.ConfigSecrets.secrets }} + {{if eq .external false}} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ .name}}-{{ $.Values.app }} + labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + release: {{ $.Release.Name }} + chart: {{ template ".Chart.Name .chart" $ }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +type: Opaque +data: +{{ toYaml .data | trim | indent 2 }} +{{- end}} + {{if eq .external true }} + {{if (or (eq .externalType "AWSSecretsManager") (eq .externalType "AWSSystemManager") (eq .externalType "HashiCorpVault"))}} +--- +apiVersion: kubernetes-client.io/v1 +kind: ExternalSecret +metadata: + name: {{ .name}} +{{- if $.Values.appLabels }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} +spec: + {{- if .roleARN }} + roleArn: .roleARN + {{- end}} + {{- if eq .externalType "AWSSecretsManager"}} + backendType: secretsManager + {{- end}} + {{- if eq .externalType "AWSSystemManager"}} + backendType: systemManager + {{- end}} + {{- if eq .externalType "HashiCorpVault"}} + backendType: vault + {{- end}} + data: + {{- range .secretData }} + - key: {{.key}} + name: {{.name}} + {{- if .property }} + property: {{.property}} + {{- end}} + isBinary: {{.isBinary}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/service.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/service.yaml new file mode 100644 index 0000000000..14e1a7c37a --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/service.yaml @@ -0,0 +1,106 @@ +{{- if .Values.service.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template ".servicename" . }} + labels: + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Release.Name }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} +{{- if .Values.service.annotations }} + annotations: +{{ toYaml .Values.service.annotations | indent 4 }} +{{- end}} +spec: + type: {{ .Values.service.type | default "ClusterIP" }} +{{- if (and (eq .Values.service.type "LoadBalancer") .Values.service.loadBalancerSourceRanges )}} + loadBalancerSourceRanges: + {{- range .Values.service.loadBalancerSourceRanges }} + - {{ . }} + {{- end }} +{{- end }} + ports: + {{- range .Values.ContainerPort }} + {{- if .servicePort }} + - port: {{ .servicePort }} + {{- else }} + - port: {{ .port }} + {{- end }} + {{- if .targetPort }} + targetPort: {{ .targetPort }} + {{- else if $.Values.appMetrics }} + targetPort: envoy-{{ .name }} + {{- else }} + targetPort: {{ .name }} + {{- end }} + protocol: {{ .protocol | default "TCP" }} + {{- if (and (eq $.Values.service.type "NodePort") .nodePort ) }} + nodePort: {{ .nodePort }} + {{- end }} + name: {{ .name }} + {{- end }} + {{- if $.Values.appMetrics }} + - port: 9901 + name: envoy-admin + {{- end }} + selector: + {{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 4 }} + {{- else }} + app: {{ template ".Chart.Name .name" . }} + {{- end }} +{{- if .Values.service.sessionAffinity.enabled }} + sessionAffinity: ClientIP +{{- end }} +{{- if .Values.service.sessionAffinityConfig }} + sessionAffinityConfig: +{{ toYaml .Values.service.sessionAffinityConfig | indent 4 }} +{{- end }} +{{- if eq .Values.deploymentType "BLUE-GREEN" }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ template ".previewservicename" . }} + labels: + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Release.Name }} +spec: + type: ClusterIP + ports: + {{- range .Values.ContainerPort }} + {{- if .servicePort }} + - port: {{ .servicePort }} + {{- else }} + - port: {{ .port }} + {{- end }} + {{- if .targetPort }} + targetPort: {{ .targetPort }} + {{- else if $.Values.appMetrics }} + targetPort: envoy-{{ .name }} + {{- else }} + targetPort: {{ .name }} + {{- end }} + protocol: TCP + name: {{ .name }} + {{- end }} + {{- if $.Values.appMetrics }} + - port: 9901 + name: envoy-admin + {{- end }} + selector: + {{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 4 }} + {{- else }} + app: {{ template ".Chart.Name .name" . }} + {{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/serviceaccount.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/serviceaccount.yaml new file mode 100644 index 0000000000..f337548e94 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/serviceaccount.yaml @@ -0,0 +1,21 @@ +{{- if $.Values.serviceAccount }} +{{- if $.Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "serviceAccountName" . }} + labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if .Values.podLabels }} +{{ toYaml .Values.podLabels | indent 4 }} + {{- end }} + {{- if .Values.serviceAccount.annotations }} + annotations: +{{ toYaml .Values.serviceAccount.annotations | indent 4 }} + {{- end }} +{{- end -}} +{{- end -}} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/servicemonitor.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/servicemonitor.yaml new file mode 100644 index 0000000000..9b920388d2 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/servicemonitor.yaml @@ -0,0 +1,117 @@ +{{ $serviceMonitorEnabled := include "serviceMonitorEnabled" . }} +{{- if eq "true" $serviceMonitorEnabled -}} +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + {{- if .Values.servicemonitor.name }} + name: {{ .Values.servicemonitor.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" . }}-sm + {{- end }} + labels: + kind: Prometheus + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Values.prometheus.release }} + {{- if .Values.servicemonitor.additionalLabels }} +{{ toYaml .Values.servicemonitor.additionalLabels | indent 4 }} + {{- end }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} +spec: + endpoints: + {{- range .Values.ContainerPort }} + {{- if .servicemonitor }} + {{- if .servicemonitor.enabled}} + {{- if .servicemonitor.targetPort }} + - targetPort: {{ .servicemonitor.targetPort }} + {{- else if .servicePort }} + - port: {{ .name }} + {{- end }} + {{- if .servicemonitor.path }} + path: {{ .servicemonitor.path}} + {{- end }} + {{- if .servicemonitor.scheme }} + scheme: {{ .servicemonitor.scheme}} + {{- end }} + {{- if .servicemonitor.interval }} + interval: {{ .servicemonitor.interval}} + {{- end }} + {{- if .servicemonitor.scrapeTimeout }} + scrapeTimeout: {{ .servicemonitor.scrapeTimeout | quote }} + {{- end }} + {{- if .servicemonitor.basicAuth }} + basicAuth: + {{- toYaml .servicemonitor.basicAuth | nindent 8 }} + {{- end }} + {{- if .servicemonitor.insecureTLS }} + tlsConfig: + insecureSkipVerify: true + {{- else if .servicemonitor.tlsConfig }} + tlsConfig: + {{- toYaml .servicemonitor.tlsConfig | nindent 8 }} + {{- end }} + {{- if .servicemonitor.metricRelabelings}} + metricRelabelings: +{{toYaml .servicemonitor.metricRelabelings | indent 8 }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- range .Values.containers }} + {{- range .ports }} + {{- if .servicemonitor }} + {{- if .servicemonitor.enabled}} + {{- if .servicemonitor.targetPort }} + - targetPort: {{ .servicemonitor.targetPort }} + {{- else if .servicePort }} + - port: {{ .name }} + {{- end }} + {{- if .servicemonitor.path }} + path: {{ .servicemonitor.path}} + {{- end }} + {{- if .servicemonitor.scheme }} + scheme: {{ .servicemonitor.scheme}} + {{- end }} + {{- if .servicemonitor.interval }} + interval: {{ .servicemonitor.interval}} + {{- end }} + {{- if .servicemonitor.scrapeTimeout }} + scrapeTimeout: {{ .servicemonitor.scrapeTimeout}} + {{- end }} + {{- if .servicemonitor.basicAuth }} + basicAuth: + {{- toYaml .servicemonitor.basicAuth | nindent 8 }} + {{- end }} + {{- if .servicemonitor.insecureTLS }} + tlsConfig: + insecureSkipVerify: true + {{- else if .servicemonitor.tlsConfig }} + tlsConfig: + {{- toYaml .servicemonitor.tlsConfig | nindent 8 }} + {{- end }} + {{- if .servicemonitor.metricRelabelings}} + metricRelabelings: +{{toYaml .servicemonitor.metricRelabelings | indent 8 }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.servicemonitor.namespaceSelector }} + namespaceSelector: + matchNames: + {{- toYaml .Values.servicemonitor.namespaceSelector | nindent 6 }} + {{- end }} + selector: + matchLabels: + {{- if .Values.servicemonitor.matchLabels }} + {{- toYaml .Values.servicemonitor.matchLabels | nindent 6 }} + {{- else }} + app: {{ template ".Chart.Name .name" $ }} +{{- end }} +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/sidecar-configmap.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/sidecar-configmap.yaml new file mode 100644 index 0000000000..cf32679409 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/sidecar-configmap.yaml @@ -0,0 +1,169 @@ +{{- if .Values.appMetrics }} +apiVersion: v1 +kind: ConfigMap +metadata: + creationTimestamp: 2019-08-12T18:38:34Z + name: sidecar-config-{{ template ".Chart.Name .name" $ }} +data: + envoy-config.json: | + { + "stats_config": { + "use_all_default_tags": false, + "stats_tags": [ + { + "tag_name": "cluster_name", + "regex": "^cluster\\.((.+?(\\..+?\\.svc\\.cluster\\.local)?)\\.)" + }, + { + "tag_name": "tcp_prefix", + "regex": "^tcp\\.((.*?)\\.)\\w+?$" + }, + { + "tag_name": "response_code", + "regex": "_rq(_(\\d{3}))$" + }, + { + "tag_name": "response_code_class", + "regex": ".*_rq(_(\\dxx))$" + }, + { + "tag_name": "http_conn_manager_listener_prefix", + "regex": "^listener(?=\\.).*?\\.http\\.(((?:[_.[:digit:]]*|[_\\[\\]aAbBcCdDeEfF[:digit:]]*))\\.)" + }, + { + "tag_name": "http_conn_manager_prefix", + "regex": "^http\\.(((?:[_.[:digit:]]*|[_\\[\\]aAbBcCdDeEfF[:digit:]]*))\\.)" + }, + { + "tag_name": "listener_address", + "regex": "^listener\\.(((?:[_.[:digit:]]*|[_\\[\\]aAbBcCdDeEfF[:digit:]]*))\\.)" + }, + { + "tag_name": "mongo_prefix", + "regex": "^mongo\\.(.+?)\\.(collection|cmd|cx_|op_|delays_|decoding_)(.*?)$" + } + ], + "stats_matcher": { + "inclusion_list": { + "patterns": [ + { + "regex": ".*_rq_\\dxx$" + }, + { + "regex": ".*_rq_time$" + }, + { + "regex": "cluster.*" + }, + ] + } + } + }, + "admin": { + "access_log_path": "/dev/null", + "address": { + "socket_address": { + "address": "0.0.0.0", + "port_value": 9901 + } + } + }, + "static_resources": { + "clusters": [ + {{- range $index, $element := .Values.ContainerPort }} + { + "name": "{{ $.Values.app }}-{{ $index }}", + "type": "STATIC", + "connect_timeout": "0.250s", + "lb_policy": "ROUND_ROBIN", +{{- if $element.idleTimeout }} + "common_http_protocol_options": { + "idle_timeout": {{ $element.idleTimeout | quote }} + }, +{{- end }} +{{- if or $element.useHTTP2 $element.useGRPC }} + "http2_protocol_options": {}, +{{- end }} +{{- if and (not $element.useGRPC) (not $element.supportStreaming) }} + "max_requests_per_connection": "1", +{{- end }} + "load_assignment": { + "cluster_name": "9", + "endpoints": { + "lb_endpoints": [ + { + "endpoint": { + "address": { + "socket_address": { + "protocol": "TCP", + "address": "127.0.0.1", + "port_value": {{ $element.port }} + } + } + } + } + ] + } + } + }, + {{- end }} + ], + "listeners":[ + {{- range $index, $element := .Values.ContainerPort }} + { + "address": { + "socket_address": { + "protocol": "TCP", + "address": "0.0.0.0", + "port_value": {{ $element.envoyPort | default (add 8790 $index) }} + } + }, + "filter_chains": [ + { + "filters": [ + { + "name": "envoy.filters.network.http_connection_manager", + "config": { + "codec_type": "AUTO", + "stat_prefix": "stats", + "route_config": { + "virtual_hosts": [ + { + "name": "backend", + "domains": [ + "*" + ], + "routes": [ + { + "match": { + "prefix": "/" + }, + "route": { +{{- if $element.supportStreaming }} + "timeout": "0s", +{{- end }} +{{- if and ($element.envoyTimeout) (not $element.supportStreaming) }} + "timeout": "{{ $element.envoyTimeout }}", +{{- end }} + "cluster": "{{ $.Values.app }}-{{ $index }}" + } + } + ] + } + ] + }, + "http_filters": { + "name": "envoy.filters.http.router" + } + } + } + ] + } + ] + }, + {{- end }} + ] + } + } +--- +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/vertical-pod-autoscaler.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/vertical-pod-autoscaler.yaml new file mode 100644 index 0000000000..ffbf24d823 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/vertical-pod-autoscaler.yaml @@ -0,0 +1,34 @@ +{{ $VerticalPodAutoScalingEnabled := include "VerticalPodAutoScalingEnabled" . }} +{{- if eq "true" $VerticalPodAutoScalingEnabled -}} +apiVersion: autoscaling.k8s.io/v1 +kind: VerticalPodAutoscaler +metadata: + {{- if .Values.verticalPodScaling.name }} + name: {{ .Values.verticalPodScaling.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" . }}-vpa + {{- end }} + labels: + kind: Prometheus + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Values.prometheus.release }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} +spec: +{{- if .Values.verticalPodScaling.resourcePolicy }} + resourcePolicy: +{{ toYaml .Values.verticalPodScaling.resourcePolicy}} +{{- end }} +{{- if .Values.verticalPodScaling.updatePolicy }} + updatePolicy: +{{ toYaml .Values.verticalPodScaling.updatePolicy}} +{{- end }} + targetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include ".Chart.Name .fullname" $ }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/winter-soldier.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/winter-soldier.yaml new file mode 100644 index 0000000000..314f0c6db0 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/winter-soldier.yaml @@ -0,0 +1,45 @@ +{{- if .Values.winterSoldier.enabled }} +apiVersion: {{ $.Values.winterSoldier.apiVersion }} +kind: Hibernator +metadata: + {{- if .Values.winterSoldier.name }} + name: {{ .Values.winterSoldier.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-hibernator + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} + {{- if .Values.winterSoldier.labels }} +{{ toYaml .Values.winterSoldier.labels | indent 4 }} + {{- end }} +{{- if .Values.winterSoldier.annotations }} + annotations: +{{ toYaml .Values.winterSoldier.annotations | indent 4 }} +{{- end }} +spec: + timeRangesWithZone: +{{ toYaml $.Values.winterSoldier.timeRangesWithZone | indent 4}} + selectors: + - inclusions: + - objectSelector: + name: {{ include ".Chart.Name .fullname" $ }} + type: {{ .Values.winterSoldier.type | quote }} + fieldSelector: +{{toYaml $.Values.winterSoldier.fieldSelector | indent 14 }} + namespaceSelector: + name: {{ $.Release.Namespace }} + exclusions: [] + action: {{ $.Values.winterSoldier.action }} + {{- if eq .Values.winterSoldier.action "scale" }} + {{- if .Values.winterSoldier.targetReplicas }} + targetReplicas: {{ $.Values.winterSoldier.targetReplicas }} + {{- end }} + {{- end }} +{{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/test-values.json b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/test-values.json new file mode 100644 index 0000000000..a26806cb91 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/test-values.json @@ -0,0 +1,292 @@ +{ + "ConfigMaps": { + "enabled": true, + "maps": [ + { + "data": { + "a": "b" + }, + "esoSecretData": {}, + "external": false, + "externalType": "", + "filePermission": "", + "mountPath": "", + "name": "abc", + "roleARN": "", + "subPath": false, + "type": "environment" + } + ] + }, + "ConfigSecrets": { + "enabled": true, + "secrets": [ + { + "data": { + "access-key": "QUtJQVdQVENFV0w1Wk4zVFBSRzY=", + "secret-access-key": "dkJ1bXRJL1YyZFUrQmVrSnM4QkVsblJnQzlRbEZueVZqL0dEdUc4Ng==" + }, + "esoSecretData": {}, + "external": false, + "externalType": "", + "filePermission": "", + "mountPath": "", + "name": "auth-aws", + "roleARN": "", + "subPath": false, + "type": "environment" + }, + { + "esoSecretData": { + "esoData": [ + { + "key": "ajay-secret-aws", + "property": "mob", + "secretKey": "mymob" + }, + { + "key": "ajay-secret-aws", + "property": "pin", + "secretKey": "mypin" + } + ], + "secretStore": { + "aws": { + "auth": { + "secretRef": { + "accessKeyIDSecretRef": { + "key": "access-key", + "name": "auth-aws-1" + }, + "secretAccessKeySecretRef": { + "key": "secret-access-key", + "name": "auth-aws-1" + } + } + }, + "region": "ap-south-1", + "service": "SecretsManager" + } + } + }, + "external": true, + "externalType": "ESO_AWSSecretsManager", + "filePermission": "", + "mountPath": "", + "name": "external-secret-aws", + "roleARN": "", + "subPath": false, + "type": "environment" + } + ] + }, + "ContainerPort": [ + { + "envoyPort": 8799, + "idleTimeout": "1800s", + "name": "app", + "port": 80, + "servicePort": 80, + "supportStreaming": false, + "useHTTP2": false + } + ], + "EnvVariables": [], + "GracePeriod": 30, + "LivenessProbe": { + "Path": "", + "command": [], + "failureThreshold": 3, + "httpHeaders": [], + "initialDelaySeconds": 20, + "periodSeconds": 10, + "port": 8080, + "scheme": "", + "successThreshold": 1, + "tcp": false, + "timeoutSeconds": 5 + }, + "MaxSurge": 1, + "MaxUnavailable": 0, + "MinReadySeconds": 60, + "ReadinessProbe": { + "Path": "", + "command": [], + "failureThreshold": 3, + "httpHeaders": [], + "initialDelaySeconds": 20, + "periodSeconds": 10, + "port": 8080, + "scheme": "", + "successThreshold": 1, + "tcp": false, + "timeoutSeconds": 5 + }, + "Spec": { + "Affinity": { + "Values": "nodes", + "key": "" + } + }, + "app": "1", + "appLabels": {}, + "appMetrics": false, + "args": { + "enabled": false, + "value": [ + "/bin/sh", + "-c", + "touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600" + ] + }, + "autoscaling": { + "MaxReplicas": 2, + "MinReplicas": 1, + "TargetCPUUtilizationPercentage": 90, + "TargetMemoryUtilizationPercentage": 80, + "annotations": {}, + "behavior": {}, + "enabled": false, + "extraMetrics": [], + "labels": {} + }, + "command": { + "enabled": false, + "value": [], + "workingDir": {} + }, + "containerSecurityContext": {}, + "containers": [], + "dbMigrationConfig": { + "enabled": false + }, + "deployment": { + "strategy": { + "blueGreen": { + "autoPromotionEnabled": false, + "autoPromotionSeconds": 30, + "previewReplicaCount": 1, + "scaleDownDelaySeconds": 30 + } + } + }, + "deploymentType": "BLUE-GREEN", + "env": "1", + "envoyproxy": { + "configMapName": "", + "image": "quay.io/devtron/envoy:v1.14.1", + "resources": { + "limits": { + "cpu": "50m", + "memory": "50Mi" + }, + "requests": { + "cpu": "50m", + "memory": "50Mi" + } + } + }, + "hostAliases": [], + "image": { + "pullPolicy": "IfNotPresent" + }, + "imagePullSecrets": [], + "ingress": { + "annotations": {}, + "className": "", + "enabled": false, + "hosts": [ + { + "host": "chart-example1.local", + "pathType": "ImplementationSpecific", + "paths": [ + "/example1" + ] + } + ], + "labels": {}, + "tls": [] + }, + "ingressInternal": { + "annotations": {}, + "className": "", + "enabled": false, + "hosts": [ + { + "host": "chart-example1.internal", + "pathType": "ImplementationSpecific", + "paths": [ + "/example1" + ] + }, + { + "host": "chart-example2.internal", + "pathType": "ImplementationSpecific", + "paths": [ + "/example2", + "/example2/healthz" + ] + } + ], + "tls": [] + }, + "initContainers": [], + "kedaAutoscaling": { + "advanced": {}, + "authenticationRef": {}, + "enabled": false, + "envSourceContainerName": "", + "maxReplicaCount": 2, + "minReplicaCount": 1, + "triggerAuthentication": { + "enabled": false, + "name": "", + "spec": {} + }, + "triggers": [] + }, + "pauseForSecondsBeforeSwitchActive": 30, + "pipelineName": "cd-1-fpji", + "podAnnotations": {}, + "podLabels": {}, + "podSecurityContext": {}, + "prometheus": { + "release": "monitoring" + }, + "rawYaml": [], + "releaseVersion": "6", + "replicaCount": 1, + "resources": { + "limits": { + "cpu": "0.05", + "memory": "50Mi" + }, + "requests": { + "cpu": "0.01", + "memory": "10Mi" + } + }, + "secret": { + "data": {}, + "enabled": false + }, + "server": { + "deployment": { + "image": "aju121/test12", + "image_tag": "63118bf2-1-1" + } + }, + "service": { + "annotations": {}, + "loadBalancerSourceRanges": [], + "type": "ClusterIP" + }, + "servicemonitor": { + "additionalLabels": {} + }, + "tolerations": [], + "topologySpreadConstraints": [], + "volumeMounts": [], + "volumes": [], + "waitForSecondsBeforeScalingDown": 30 +} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/test_values.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/test_values.yaml new file mode 100644 index 0000000000..48e62037f6 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/test_values.yaml @@ -0,0 +1,782 @@ +# Default values for myapp. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +kedaAutoscaling: + enabled: true + envSourceContainerName: "" # Optional. Default: .spec.template.spec.containers[0] + cooldownPeriod: 300 # Optional. Default: 300 seconds + minReplicaCount: 1 + maxReplicaCount: 2 + idleReplicaCount: 0 # Optional. Must be less than minReplicaCount + pollingInterval: 30 # Optional. Default: 30 seconds + # The fallback section is optional. It defines a number of replicas to fallback to if a scaler is in an error state. + fallback: {} # Optional. Section to specify fallback options + # failureThreshold: 3 # Mandatory if fallback section is included + # replicas: 6 + advanced: {} + # horizontalPodAutoscalerConfig: # Optional. Section to specify HPA related options + # behavior: # Optional. Use to modify HPA's scaling behavior + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Percent + # value: 100 + # periodSeconds: 15 + triggers: + - type: kubernetes-workload + name: trig_one + metadata: + podSelector: 'pod=workload-test' + - type: metrics-api + name: trig_two + metadata: + url: "https://mockbin.org/bin/336a8d99-9e09-4f1f-979d-851a6d1b1423" + valueLocation: "tasks" + + triggerAuthentication: + enabled: true + name: "trigger-test" + spec: {} + authenticationRef: {} + +deploymentLabels: + name: kunalverma + Company: Devtron + Job: DevRel + +deploymentAnnotations: + name: kunalverma + Company: Devtron + Job: DevRel + +containerSpec: + lifecycle: + enabled: true + preStop: + exec: + command: ["sleep","10"] + postStart: + httpGet: + host: example.com + path: /example + port: 90 + +imagePullSecrets: + - test1 + - test2 +replicaCount: 1 +MinReadySeconds: 5 +MaxSurge: 1 +MaxUnavailable: 0 +GracePeriod: 30 +ContainerPort: + - name: app + port: 8080 + servicePort: 80 + envoyTimeout: 15 + targetPort: 8080 + envoyPort: 8799 + useHTTP2: false + supportStreaming: false + idleTimeout: 1800s + servicemonitor: + enabled: true + path: /abc + scheme: 'http' + interval: 30s + scrapeTimeout: 20s + metricRelabelings: + - sourceLabels: [namespace] + regex: '(.*)' + replacement: myapp + targetLabel: target_namespace + + - name: app1 + port: 8090 + targetPort: 1234 + servicePort: 8080 + useGRPC: true + servicemonitor: + enabled: true + - name: app2 + port: 8091 + servicePort: 8081 + useGRPC: true + +pauseForSecondsBeforeSwitchActive: 30 +waitForSecondsBeforeScalingDown: 30 +autoPromotionSeconds: 30 + +Spec: + Affinity: + Key: + # Key: kops.k8s.io/instancegroup + Values: + + +image: + pullPolicy: IfNotPresent + +autoscaling: + enabled: true + MinReplicas: 1 + MaxReplicas: 2 + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 + behavior: {} +# scaleDown: +# stabilizationWindowSeconds: 300 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# scaleUp: +# stabilizationWindowSeconds: 0 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# - type: Pods +# value: 4 +# periodSeconds: 15 +# selectPolicy: Max + + extraMetrics: [] +# - external: +# metricName: pubsub.googleapis.com|subscription|num_undelivered_messages +# metricSelector: +# matchLabels: +# resource.labels.subscription_id: echo-read +# targetAverageValue: "2" +# type: External +# + +secret: + enabled: false + +service: + type: ClusterIP + # name: "1234567890123456789012345678901234567890123456789012345678901234567890" + annotations: {} + # test1: test2 + # test3: test4 + +istio: + enable: true + gateway: + enabled: true + labels: {} + annotations: {} + # host: example.com + hosts: + - "example4.com" + tls: + enabled: true + secretName: example-tls-secret + virtualService: + enabled: true + labels: {} + annotations: {} + gateways: [] + hosts: + - example1.local + http: + # - match: + # - uri: + # prefix: /v1 + # - uri: + # prefix: /v2 + # rewriteUri: / + # timeout: 12 + # headers: + # request: + # add: + # x-some-header: "value" + # retries: + # attempts: 2 + # perTryTimeout: 3s + # route: + # - destination: + # host: service1 + # port: 80 + # - route: + # - destination: + # host: service2 + +flaggerCanary: + enabled: false + labels: {} + annotations: {} + createIstioGateway: + enabled: false + labels: {} + annotations: {} + host: example.com + tls: + enabled: false + secretName: example-tls-secret + # Istio gateways (optional) + addOtherGateways: [] + # Istio virtual service host names (optional) + addOtherHosts: [] + # Istio gateway refs (optional) + gatewayRefs: + # - name: istio-gateway + # namespace: istio-system + #service port + port: 80 + #containerPort + targetPort: 8080 + # discover all port open in container + portDiscovery: false + # application protocol (optional) + appProtocol: + # Istio retry policy (optional) + retries: + # attempts: 3 + # perTryTimeout: 1s + # retryOn: "gateway-error,connect-failure,refused-stream" + # HTTP match conditions (optional) + match: + - uri: + prefix: / + # HTTP rewrite (optional) + rewriteUri: + # timeout (optional) + timeout: + # Add headers (optional) + headers: + # request: + # add: + # x-some-header: "value" + # cross-origin resource sharing policy (optional) + corsPolicy: + # allowOrigin: + # - example.com + # allowMethods: + # - GET + # allowCredentials: false + # allowHeaders: + # - x-some-header + # maxAge: 24h + analysis: + # schedule interval (default 60s) + interval: 5s + # max number of failed metric checks before rollback + threshold: 10 + # max traffic percentage routed to canary + # percentage (0-100) + maxWeight: 50 + # canary increment step + # percentage (0-100) + stepWeight: 5 + thresholds: + # minimum req success rate (non 5xx responses) + # percentage (0-100) + successRate: 90 + # maximum req duration P99 + # milliseconds + latency: 500 + loadtest: + enabled: true + # load tester address + url: http://flagger-loadtester.test/ + +server: + deployment: + image_tag: 1-95af053 + image: "" +deploymentType: "RECREATE" + +topologySpreadConstraints: + - maxSkew: 1 + topologyKey: zone + whenUnsatisfiable: DoNotSchedule + autoLabelSelector: true + customLabelSelector: + foo: bar + +EnvVariables: + - name: FLASK_ENV + value: qa + +LivenessProbe: + Path: / + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: + - name: Custom-Header + value: abc + - name: Custom-Header2 + value: xyz + +ReadinessProbe: + Path: / + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: + - name: Custom-Header + value: abc + +StartupProbe: + Path: "/" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: [] + command: [] + tcp: false + +prometheus: + release: monitoring + +servicemonitor: + additionalLabels: {} + +prometheusRule: + enabled: true + additionalLabels: {} + namespace: "" + rules: + # These are just examples rules, please adapt them to your needs + - alert: TooMany500s + expr: 100 * ( sum( nginx_ingress_controller_requests{status=~"5.+"} ) / sum(nginx_ingress_controller_requests) ) > 5 + for: 1m + labels: + severity: critical + annotations: + description: Too many 5XXs + summary: More than 5% of the all requests did return 5XX, this require your attention + - alert: TooMany400s + expr: 100 * ( sum( nginx_ingress_controller_requests{status=~"4.+"} ) / sum(nginx_ingress_controller_requests) ) > 5 + for: 1m + labels: + severity: critical + annotations: + description: Too many 4XXs + summary: More than 5% of the all requests did return 4XX, this require your attention + + +ingress: + enabled: true + className: nginx + annotations: {} +# nginx.ingress.kubernetes.io/rewrite-target: / +# nginx.ingress.kubernetes.io/ssl-redirect: "false" +# kubernetes.io/ingress.class: nginx +# kubernetes.io/tls-acme: "true" +# nginx.ingress.kubernetes.io/canary: "true" +# nginx.ingress.kubernetes.io/canary-weight: "10" +# Old Ingress Format +# host: "ingress-example.com" +# path: "/app" + +# New Ingress Format + hosts: + - host: chart-example1.local + pathType: "ImplementationSpecific" + paths: + - /example1 + + - host: chart-example2.local + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + additionalBackends: + - path: /example1 + pathType: "ImplementationSpecific" + backend: + service: + name: test-service + port: + number: 80 + + tls: [] +### Legacy Ingress Format ## +# host: abc.com +# path: "/" +# pathType: "ImplementationSpecific" + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +ingressInternal: + enabled: true + className: nginx-internal + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + # nginx.ingress.kubernetes.io/canary: "true" + # nginx.ingress.kubernetes.io/canary-weight: "10" + hosts: + - host: chart-example1.internal + pathType: "ImplementationSpecific" + paths: + - /example1 + additionalBackends: + - path: /internal + pathType: "ImplementationSpecific" + backend: + service: + name: test-service-internal + port: + number: 80 + - path: /internal-01 + pathType: "ImplementationSpecific" + backend: + service: + name: test-service-internal + port: + number: 80 + - host: chart-example2.internal + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +winterSoldier: + apiVersion: pincher.devtron.ai/v1alpha1 + enabled: true + annotations: {} + labels: {} + type: Deployment + timeRangesWithZone: + timeZone: "Asia/Kolkata" + timeRanges: + - timeFrom: 00:00 + timeTo: 23:59:59 + weekdayFrom: Sat + weekdayTo: Sun + - timeFrom: 00:00 + timeTo: 08:00 + weekdayFrom: Mon + weekdayTo: Fri + - timeFrom: 20:00 + timeTo: 23:59:59 + weekdayFrom: Mon + weekdayTo: Fri + action: scale + targetReplicas: [1,1,1] + fieldSelector: + - AfterTime(AddTime(ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '5m'), Now()) + + +dbMigrationConfig: + enabled: false + +command: + workingDir: /app + enabled: false + value: ["ls"] + +args: + enabled: false + value: [] + +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: + cpu: 1 + memory: 200Mi + requests: + cpu: 0.10 + memory: 100Mi + +volumeMounts: [] +# - name: log-volume +# mountPath: /var/log + +volumes: [] +# - name: log-volume +# emptyDir: {} + + +nodeSelector: {} + + +#used for deployment algo selection +orchestrator.deploymant.algo: 1 + +ConfigMaps: + enabled: false + maps: [] +# - name: config-map-1 +# type: environment +# external: false +# data: +# key1: key1value-1 +# key2: key2value-1 +# key3: key3value-1 +# - name: config-map-2 +# type: volume +# external: false +# mountPath: /etc/config/2 +# filePermission: 0400 +# data: +# key1: | +# club : manchester utd +# nation : england +# key2: abc-2 +# key3: abc-2 +# - name: config-map-3 +# type: environment +# external: true +# mountPath: /etc/config/3 +# data: [] +# - name: config-map-4 +# type: volume +# external: true +# mountPath: /etc/config/4 +# data: [] + + +ConfigSecrets: + enabled: true + secrets: + - name: config-secret-1 + type: environment + external: false + externalType: AWSSecretsManager + esoSecretData: + secretStore: + aws: + service: SecretsManager + region: us-east-1 + auth: + secretRef: + accessKeyIDSecretRef: + name: awssm-secret + key: access-key + secretAccessKeySecretRef: + name: awssm-secret + key: secret-access-key + esoData: + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + data: + key1: key1value-1 + key2: key2value-1 + key3: key3value-1 + - name: config-secret-2 + type: environment + external: false + externalType: ESO_HashiCorpVault + esoSecretData: + secretStore: + vault: + server: "http://my.vault.server:8200" + path: "secret" + version: "v2" + auth: + tokenSecretRef: + name: vault-token + key: token + esoData: + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + - secretKey: prod-mysql-password + key: secrets/prod-mysql-secrets + property: prodPassword + date: + key1: key1value-1 + key2: key2value-1 + key3: key3value-1 + +# - name: config-secret-2 +# type: volume +# external: false +# mountPath: /etc/config/2 +# data: +# key1: | +# club : manchester utd +# nation : england +# key2: abc-2 + + +initContainers: + ## Additional init containers to run before the Scheduler pods. + ## for example, be used to run a sidecar that chown Logs storage . + - command: ["sh", "-c", "chown -R 1000:1000 logs"] + reuseContainerImage: true + volumeMounts: + - mountPath: /usr/local/airflow/logs + name: logs-data + securityContext: + privileged: true + runAsUser: 1000 + runAsGroup: 3000 + fsGroup: 2000 + - name: init-migrate + image: busybox:latest + command: ["sh", "-c", "chown -R 1000:1000 logs"] + volumeMounts: + - mountPath: /usr/local/airflow/logs + name: logs-data + securityContext: + capabilities: + drop: + - ALL + +containers: + # Additional init containers to run before the Scheduler pods. + # for example, be used to run a sidecar that chown Logs storage . + - name: volume-mount-hack + image: busybox + command: ["sh", "-c", "chown -R 1000:1000 logs"] + volumeMounts: + - mountPath: /usr/local/airflow/logs + name: logs-data + + +rawYaml: + - apiVersion: v1 + kind: Service + metadata: + annotations: + labels: + app: sample-metrics-app + name: sample-metrics-app + namespace: default + spec: + ports: + - name: web + port: 80 + protocol: TCP + targetPort: 8080 + selector: + app: sample-metrics-app + sessionAffinity: None + type: ClusterIP + - apiVersion: v1 + kind: Service + metadata: + annotations: + labels: + app: sample-metrics-app + name: sample-metrics-app + namespace: default + spec: + ports: + - name: web + port: 80 + protocol: TCP + targetPort: 8080 + selector: + app: sample-metrics-app + sessionAffinity: None + type: ClusterIP + +# If you need to provide some extra specs for main container which are not included by default in deployment template +# then provide them here +containerExtraSpecs: {} + +# If you need to provide some extra specs for pod which are not included by default in deployment template +# then provide them here +podExtraSpecs: {} + +envoyproxy: + image: docker.io/envoyproxy/envoy:v1.16.0 + configMapName: "" + lifecycle: {} + resources: + limits: + cpu: 50m + memory: 50Mi + requests: + cpu: 50m + memory: 50Mi + +podDisruptionBudget: + minAvailable: 1 + maxUnavailable: 1 + + # Node tolerations for server scheduling to nodes with taints + # Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ +# + +tolerations: + - key: "key" + operator: "Equal|Exists" + value: "value" + effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" + +appMetrics: true +serviceAccount: + ## @param serviceAccount.create Enable creation of ServiceAccount for pods + ## + create: false + ## @param serviceAccount.name The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the `.Chart.Name .fullname` template + name: "test1" + ## @param serviceAccount.annotations Annotations for service account. Evaluated as a template. + ## Only used if `create` is `true`. + ## + annotations: + kubernetes.io/service-account.name: build-robot +containerSecurityContext: + allowPrivilegeEscalation: false +privileged: true +hostAliases: [] +# - ip: "127.0.0.1" +# hostnames: +# - "foo.local" + + +affinity: + enabled: false + values: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: security + operator: In + values: + - S1 + topologyKey: topology.kubernetes.io/zone + +secondaryWorkload: + enabled: false + postfix: "od" + replicaCount: 1 + affinity: {} + tolerations: [] + autoscaling: + enabled: true + MinReplicas: 1 + MaxReplicas: 2 + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/values.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/values.yaml new file mode 100644 index 0000000000..d67a0b2560 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/values.yaml @@ -0,0 +1,718 @@ +# Default values for myapp. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 +MinReadySeconds: 5 +MaxSurge: 1 +MaxUnavailable: 0 +GracePeriod: 30 +ContainerPort: + - name: app + port: 8080 + servicePort: 80 + envoyPort: 8799 + envoyTimeout: 15s + useHTTP2: false + supportStreaming: false + idleTimeout: 1800s + protocol: TCP +# servicemonitor: +# enabled: true +# path: /abc +# scheme: 'http' +# interval: 30s +# scrapeTimeout: 20s +# metricRelabelings: +# - sourceLabels: [namespace] +# regex: '(.*)' +# replacement: myapp +# targetLabel: target_namespace + + - name: app1 + port: 8090 + servicePort: 8080 + useGRPC: true + +pauseForSecondsBeforeSwitchActive: 30 +waitForSecondsBeforeScalingDown: 30 +autoPromotionSeconds: 30 + +Spec: + Affinity: + Key: "" +# Key: kops.k8s.io/instancegroup + Values: "" + +affinity: {} + +image: + pullPolicy: IfNotPresent + +restartPolicy: Always + +ambassadorMapping: + enabled: false + # labels: + # key1: value1 + # prefix: / + # ambassadorId: 1234 + # hostname: devtron.example.com + # rewrite: /foo/ + # retryPolicy: + # retry_on: "5xx" + # num_retries: 10 + # cors: + # origins: http://foo.example,http://bar.example + # methods: POST, GET, OPTIONS + # headers: Content-Type + # credentials: true + # exposed_headers: X-Custom-Header + # max_age: "86400" + # weight: 10 + # method: GET + # extraSpec: + # method_regex: true + # headers: + # x-quote-mode: backend + # x-random-header: devtron + # tls: + # context: httpd-context + # create: true + # secretName: httpd-secret + # hosts: + # - anything.example.info + # - devtron.example.com + # extraSpec: + # min_tls_version: v1.2 + +autoscaling: + enabled: false + MinReplicas: 1 + MaxReplicas: 2 + annotations: {} + labels: {} + behavior: {} + containerResource: + enabled: false +# scaleDown: +# stabilizationWindowSeconds: 300 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# scaleUp: +# stabilizationWindowSeconds: 0 +# policies: +# - type: Percent +# value: 100 +# periodSeconds: 15 +# - type: Pods +# value: 4 +# periodSeconds: 15 +# selectPolicy: Max + extraMetrics: [] +# - external: +# metricName: pubsub.googleapis.com|subscription|num_undelivered_messages +# metricSelector: +# matchLabels: +# resource.labels.subscription_id: echo-read +# targetAverageValue: "2" +# type: External +# + +kedaAutoscaling: + enabled: false + envSourceContainerName: "" # Optional. Default: .spec.template.spec.containers[0] + cooldownPeriod: 300 # Optional. Default: 300 seconds + minReplicaCount: 1 + maxReplicaCount: 2 + idleReplicaCount: 0 # Optional. Must be less than minReplicaCount + pollingInterval: 30 # Optional. Default: 30 seconds + # The fallback section is optional. It defines a number of replicas to fallback to if a scaler is in an error state. + fallback: {} # Optional. Section to specify fallback options + # failureThreshold: 3 # Mandatory if fallback section is included + # replicas: 6 + advanced: {} + # horizontalPodAutoscalerConfig: # Optional. Section to specify HPA related options + # behavior: # Optional. Use to modify HPA's scaling behavior + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Percent + # value: 100 + # periodSeconds: 15 + triggers: [] + triggerAuthentication: + enabled: false + name: "" + spec: {} + authenticationRef: {} + +# kedaHttpScaledObject: +# enabled: false +# minReplicaCount: 1 +# maxReplicaCount: 2 +# targetPendingRequests: +# scaledownPeriod: +# servicePort: 80 # port of the service (required) + +secret: + enabled: false + +service: + type: ClusterIP + enabled: true +# name: "1234567890123456789012345678901234567890123456789012345678901234567890" + annotations: {} + # test1: test2 + # test3: test4 + sessionAffinity: + enabled: false + +istio: + enable: false + gateway: + enabled: false + labels: {} + annotations: {} + host: "" + tls: + enabled: false + secretName: "" + virtualService: + enabled: false + labels: {} + annotations: {} + gateways: [] + hosts: [] + http: [] + # - match: + # - uri: + # prefix: /v1 + # - uri: + # prefix: /v2 + # timeout: 12 + # headers: + # request: + # add: + # x-some-header: "value" + # retries: + # attempts: 2 + # perTryTimeout: 3s + destinationRule: + enabled: false + labels: {} + annotations: {} + subsets: [] + trafficPolicy: {} + peerAuthentication: + enabled: false + labels: {} + annotations: {} + selector: + enabled: false + mtls: + mode: "" + portLevelMtls: {} + requestAuthentication: + enabled: false + labels: {} + annotations: {} + selector: + enabled: false + jwtRules: [] + authorizationPolicy: + enabled: false + labels: {} + annotations: {} + action: + provider: {} + rules: [] + +flaggerCanary: + enabled: false + labels: {} + annotations: {} + createIstioGateway: + enabled: false + labels: {} + annotations: {} + host: "" + tls: + enabled: false + secretName: "" + # Istio gateways (optional) + addOtherGateways: [] + # Istio virtual service host names (optional) + addOtherHosts: [] + # Istio gateway refs (optional) + gatewayRefs: + # - name: istio-gateway + # namespace: istio-system + #service port + serviceport: 8080 + #containerPort + targetPort: 8080 + # discover all port open in container + portDiscovery: true + # application protocol (optional) + appProtocol: + # Istio retry policy (optional) + retries: + attempts: 3 + perTryTimeout: 1s + retryOn: "gateway-error,connect-failure,refused-stream" + # HTTP match conditions (optional) + match: + - uri: + prefix: / + # HTTP rewrite (optional) + rewriteUri: / + # timeout (optional) + timeout: + # Add headers (optional) + headers: + # request: + # add: + # x-some-header: "value" + # cross-origin resource sharing policy (optional) + corsPolicy: + # allowOrigin: + # - example.com + # allowMethods: + # - GET + # allowCredentials: false + # allowHeaders: + # - x-some-header + # maxAge: 24h + analysis: + # schedule interval (default 60s) + interval: 15s + # max number of failed metric checks before rollback + threshold: 5 + # max traffic percentage routed to canary + # percentage (0-100) + maxWeight: 50 + # canary increment step + # percentage (0-100) + stepWeight: 5 + thresholds: + # minimum req success rate (non 5xx responses) + # percentage (0-100) + successRate: 90 + # maximum req duration P99 + # milliseconds + latency: 500 + loadtest: + enabled: true + # load tester address + url: http://flagger-loadtester.istio-system/ + + +server: + deployment: + image_tag: 1-95af053 + image: "" + +EnvVariablesFromFieldPath: [] +# - name: POD_NAME +# fieldPath: metadata.name + +EnvVariables: [] + # - name: FLASK_ENV + # value: qa + +EnvVariablesFromSecretKeys: [] + # - name: ENV_NAME + # secretName: SECRET_NAME + # keyName: SECRET_KEY + +EnvVariablesFromConfigMapKeys: [] + # - name: ENV_NAME + # configMapName: CONFIG_MAP_NAME + # keyName: CONFIG_MAP_KEY + +LivenessProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + scheme: "" + httpHeaders: [] +# - name: Custom-Header +# value: abc + grpc: {} + + +ReadinessProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + scheme: "" + httpHeaders: [] +# - name: Custom-Header +# value: abc + grpc: {} + + +StartupProbe: + Path: "" + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + failureThreshold: 3 + httpHeaders: [] + command: [] + tcp: false + grpc: {} + + +prometheus: + release: monitoring + +servicemonitor: + additionalLabels: {} + + +prometheusRule: + enabled: false + additionalLabels: {} + namespace: "" +# rules: +# # These are just examples rules, please adapt them to your needs +# - alert: TooMany500s +# expr: 100 * ( sum( nginx_ingress_controller_requests{status=~"5.+"} ) / sum(nginx_ingress_controller_requests) ) > 5 +# for: 1m +# labels: +# severity: critical +# annotations: +# description: Too many 5XXs +# summary: More than 5% of the all requests did return 5XX, this require your attention +# - alert: TooMany400s +# expr: 100 * ( sum( nginx_ingress_controller_requests{status=~"4.+"} ) / sum(nginx_ingress_controller_requests) ) > 5 +# for: 1m +# labels: +# severity: critical +# annotations: +# description: Too many 4XXs +# summary: More than 5% of the all requests did return 4XX, this require your attention +# + +ingress: + enabled: false + className: "" + labels: {} + annotations: {} +# nginx.ingress.kubernetes.io/rewrite-target: / +# nginx.ingress.kubernetes.io/ssl-redirect: "false" +# kubernetes.io/ingress.class: nginx +# kubernetes.io/tls-acme: "true" +# nginx.ingress.kubernetes.io/canary: "true" +# nginx.ingress.kubernetes.io/canary-weight: "10" + + hosts: + - host: chart-example1.local + pathType: "ImplementationSpecific" + paths: + - /example1 + - host: chart-example2.local + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +ingressInternal: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + # nginx.ingress.kubernetes.io/canary: "true" + # nginx.ingress.kubernetes.io/canary-weight: "10" + + hosts: + - host: chart-example1.internal + pathType: "ImplementationSpecific" + paths: + - /example1 + - host: chart-example2.internal + pathType: "ImplementationSpecific" + paths: + - /example2 + - /example2/healthz + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +winterSoldier: + enabled: false + apiVersion: pincher.devtron.ai/v1alpha1 + labels: {} + annotations: {} + type: Deployment + timeRangesWithZone: {} + # timeZone: "Asia/Kolkata" + # timeRanges: [] + action: sleep + targetReplicas: [] + fieldSelector: [] + # - AfterTime(AddTime(ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '5m'), Now()) + +networkPolicy: + enabled: false + annotations: {} + labels: {} + podSelector: + matchExpressions: [] + matchLabels: {} + policyTypes: [] + ingress: [] + egress: [] + +dbMigrationConfig: + enabled: false + +command: + enabled: false + value: [] + +args: + enabled: false + value: [] + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + +volumeMounts: [] +# - name: log-volume +# mountPath: /var/log + +volumes: [] +# - name: log-volume +# emptyDir: {} + + +nodeSelector: {} + +# If you need to provide some extra specs for pod which are not included by default in deployment template +# then provide them here +podExtraSpecs: {} + +# If you need to provide some extra specs for main container which are not included by default in deployment template +# then provide them here +containerExtraSpecs: {} + +#used for deployment algo selection +orchestrator.deploymant.algo: 1 + +ConfigMaps: + enabled: false + maps: [] +# - name: config-map-1 +# type: environment +# external: false +# data: +# key1: key1value-1 +# key2: key2value-1 +# key3: key3value-1 +# - name: config-map-2 +# type: volume +# external: false +# mountPath: /etc/config/2 +# data: +# key1: | +# club : manchester utd +# nation : england +# key2: abc-2 +# key3: abc-2 +# - name: config-map-3 +# type: environment +# external: true +# mountPath: /etc/config/3 +# data: [] +# - name: config-map-4 +# type: volume +# external: true +# mountPath: /etc/config/4 +# data: [] + + +ConfigSecrets: + enabled: false + secrets: [] + # data: + # key1: key1value-1 + # key2: key2value-1 + # key3: key3value-1 +# - name: config-secret-2 +# type: volume +# external: false +# mountPath: /etc/config/2 +# data: +# key1: | +# club : manchester utd +# nation : england +# key2: abc-2 + + +initContainers: [] + ## Additional init containers to run before the Scheduler pods. + ## for example, be used to run a sidecar that chown Logs storage . + # volumeMounts: + # - mountPath: /usr/local/airflow/logs + # name: logs-data + # # Uncomment below line ONLY IF you want to reuse the container image. + # # This will assign your application's docker image to init container. + # reuseContainerImage: true + +containers: [] + ## Additional init containers to run before the Scheduler pods. + ## for example, be used to run a sidecar that chown Logs storage . + +rawYaml: [] +# - apiVersion: v1 +# kind: Service +# metadata: +# annotations: +# labels: +# app: sample-metrics-app +# name: sample-metrics-app +# namespace: default +# spec: +# ports: +# - name: web +# port: 80 +# protocol: TCP +# targetPort: 8080 +# selector: +# app: sample-metrics-app +# sessionAffinity: None +# type: ClusterIP +# - apiVersion: v1 +# kind: Service +# metadata: +# annotations: +# labels: +# app: sample-metrics-app +# name: sample-metrics-app +# namespace: default +# spec: +# ports: +# - name: web +# port: 80 +# protocol: TCP +# targetPort: 8080 +# selector: +# app: sample-metrics-app +# sessionAffinity: None +# type: ClusterIP + +topologySpreadConstraints: [] + # - maxSkew: 1 + # topologyKey: zone + # whenUnsatisfiable: DoNotSchedule + # autoLabelSelector: true + # minDomain: 1 + # nodeTaintsPolicy: Honor + +envoyproxy: + image: docker.io/envoyproxy/envoy:v1.16.0 + lifecycle: {} + configMapName: "" + resources: + limits: + cpu: 50m + memory: 50Mi + requests: + cpu: 50m + memory: 50Mi + +containerSpec: + lifecycle: + enabled: false + preStop: {} +# exec: +# command: ["sleep","10"] + postStart: {} +# httpGet: +# host: example.com +# path: /example +# port: 90 + +podDisruptionBudget: {} +# minAvailable: 1 +# maxUnavailable: 1 + + ## Node tolerations for server scheduling to nodes with taints + ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + ## + +podSecurityContext: {} + # runAsUser: 1000 + # runAsGroup: 3000 + # fsGroup: 2000 + +containerSecurityContext: {} + # allowPrivilegeEscalation: false +## Pods Service Account +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ +## +serviceAccount: + ## @param serviceAccount.create Enable creation of ServiceAccount for pods + ## + create: false + ## @param serviceAccount.name The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the `.Chart.Name .fullname` template + name: "" + ## @param serviceAccount.annotations Annotations for service account. Evaluated as a template. + ## Only used if `create` is `true`. + ## + annotations: {} + +tolerations: [] + # - key: "key" + # operator: "Equal|Exists" + # value: "value" + # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" + +imagePullSecrets: [] + # - test1 + # - test2 +persistentVolumeClaim: {} + +verticalPodScaling: + enabled: false + +customPodLabels: {} + +secondaryWorkload: + enabled: false + Spec: + Affinity: + Key: "" + Values: "" + replicaCount: 1 + affinity: {} + tolerations: [] + autoscaling: + enabled: false + containerResource: + enabled: false \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/templates/statefulset.yaml b/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/templates/statefulset.yaml index fa270dae1d..bcd68b75d5 100644 --- a/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/templates/statefulset.yaml +++ b/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/templates/statefulset.yaml @@ -220,64 +220,6 @@ spec: {{- end}} {{- end}} containers: -{{- if $.Values.appMetrics }} - - name: envoy - image: {{ $.Values.envoyproxy.image | default "quay.io/devtron/envoy:v1.16.0"}} - {{- if $.Values.envoyproxy.lifecycle }} - lifecycle: -{{ toYaml .Values.envoyproxy.lifecycle | indent 12 -}} - {{- else if $.Values.containerSpec.lifecycle.enabled }} - lifecycle: - {{- if $.Values.containerSpec.lifecycle.preStop }} - preStop: -{{ toYaml $.Values.containerSpec.lifecycle.preStop | indent 12 -}} - {{- end }} - {{- end }} - resources: -{{ toYaml $.Values.envoyproxy.resources | trim | indent 12 }} - ports: - - containerPort: 9901 - protocol: TCP - name: envoy-admin - {{- range $index, $element := .Values.ContainerPort }} - - name: {{ $element.name}} - containerPort: {{ $element.envoyPort | default (add 8790 $index) }} - protocol: TCP - {{- end }} - command: ["/usr/local/bin/envoy"] - args: ["-c", "/etc/envoy-config/envoy-config.json", "-l", "info", "--log-format", "[METADATA][%Y-%m-%d %T.%e][%t][%l][%n] %v"] - volumeMounts: - - name: {{ $.Values.envoyproxy.configMapName | default "envoy-config-volume" }} - mountPath: /etc/envoy-config/ -{{- end}} -{{- if $.Values.containers }} -{{- range $i, $c := .Values.containers }} -{{- if .reuseContainerImage}} - - name: {{ $.Chart.Name }}-sidecontainer-{{ add1 $i }} - image: "{{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}" - imagePullPolicy: {{ $.Values.image.pullPolicy }} -{{- if .securityContext }} - securityContext: -{{ toYaml .securityContext | indent 12 }} -{{- end }} -{{- if .command}} - command: -{{ toYaml .command | indent 12 -}} -{{- end}} -{{- if .resources}} - resources: -{{ toYaml .resources | indent 12 -}} -{{- end}} -{{- if .volumeMounts}} - volumeMounts: -{{ toYaml .volumeMounts | indent 12 -}} -{{- end}} -{{- else}} - - -{{ toYaml . | indent 10 }} -{{- end}} -{{- end}} -{{- end}} - name: {{ $.Chart.Name }} image: "{{ .Values.server.deployment.image }}:{{ .Values.server.deployment.image_tag }}" imagePullPolicy: {{ $.Values.image.pullPolicy }} @@ -627,8 +569,20 @@ spec: {{ toYaml .volumeMounts | indent 12 -}} {{- end}} {{- else}} +{{- $cCopy := deepCopy . }} +{{- if hasKey $cCopy "ports" }} +{{- $newPorts := list }} +{{- range $port := $cCopy.ports }} + {{- $newPorts = append $newPorts (dict + "name" (get $port "name") + "containerPort" (get $port "containerPort") + "protocol" (get $port "protocol") + ) }} +{{- end }} +{{- $_ := set $cCopy "ports" $newPorts }} +{{- end }} - -{{ toYaml . | indent 10 }} +{{ toYaml $cCopy | indent 10 }} {{- end}} {{- end}} {{- end}} From 167453ed128c80fca048dc0fe7b099ca526ef1e2 Mon Sep 17 00:00:00 2001 From: akshatsinha007 Date: Fri, 16 May 2025 12:10:25 +0530 Subject: [PATCH 12/16] updated the chart version in readme --- .../statefulset-chart_5-1-0/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/README.md b/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/README.md index 067e106393..8773af950f 100644 --- a/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/README.md +++ b/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/README.md @@ -1,5 +1,5 @@ -# StatefulSet Chart 1.0.0 +# StatefulSet Chart 5.1.0 ## 1. Yaml File - From f23ecbcb71bf34a8e8124bbdd3f1685541bdf09e Mon Sep 17 00:00:00 2001 From: akshatsinha007 Date: Fri, 16 May 2025 12:15:26 +0530 Subject: [PATCH 13/16] updated the chart version in readme --- .../statefulset-chart_5-1-0/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/README.md b/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/README.md index 8773af950f..b05d5d51c7 100644 --- a/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/README.md +++ b/scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/README.md @@ -1,5 +1,5 @@ -# StatefulSet Chart 5.1.0 +# StatefulSet Chart v5.1.0 ## 1. Yaml File - From 632a6f4c3be9a18e51aa3f35168d17a9d25c508e Mon Sep 17 00:00:00 2001 From: Ash-exp Date: Fri, 16 May 2025 15:09:19 +0530 Subject: [PATCH 14/16] fix: Remove funtionName from labels from pg_query_duration_seconds_* metrics --- go.mod | 4 ++-- go.sum | 8 ++++---- .../devtron-labs/common-lib/utils/SqlUtil.go | 12 ++++++------ vendor/modules.txt | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 9cf9b8da74..4120944e76 100644 --- a/go.mod +++ b/go.mod @@ -307,8 +307,8 @@ require ( replace ( github.com/argoproj/argo-workflows/v3 v3.5.13 => github.com/devtron-labs/argo-workflows/v3 v3.5.13 - github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250508071415-beab8643ef22 - github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250508071415-beab8643ef22 + github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250516092913-a8cc2e4a33e5 + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250516092913-a8cc2e4a33e5 github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127 github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5 k8s.io/api => k8s.io/api v0.29.7 diff --git a/go.sum b/go.sum index c7bc2a46c2..e4f982ed3f 100644 --- a/go.sum +++ b/go.sum @@ -829,10 +829,10 @@ github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc h1:VRRKCwnzq github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/devtron-labs/argo-workflows/v3 v3.5.13 h1:3pINq0gXOSeTw2z/vYe+j80lRpSN5Rp/8mfQORh8SmU= github.com/devtron-labs/argo-workflows/v3 v3.5.13/go.mod h1:/vqxcovDPT4zqr4DjR5v7CF8ggpY1l3TSa2CIG3jmjA= -github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250508071415-beab8643ef22 h1:Eli2aNwOnwvA5MgCxYtO4kqJ0f6DeK3NJ2GQiFJJ9BQ= -github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250508071415-beab8643ef22/go.mod h1:FfaLDXN1ZXxyRpnskBqVIYkpkWDCzBmDgIO9xqLnxdQ= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250508071415-beab8643ef22 h1:zGAASPlhYqEetPLnnhm58+QAJXdzoAcMojQVr+8dFTo= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250508071415-beab8643ef22/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= +github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250516092913-a8cc2e4a33e5 h1:RzH1TwejuyKys9pLooVRy+nDkI1vaBV+GTJK9zIhIEg= +github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250516092913-a8cc2e4a33e5/go.mod h1:FfaLDXN1ZXxyRpnskBqVIYkpkWDCzBmDgIO9xqLnxdQ= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250516092913-a8cc2e4a33e5 h1:8/TvnOcams0ewKNBZcywwA/Ccr8ZIhFWBrK3k6di5Lo= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250516092913-a8cc2e4a33e5/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0= github.com/devtron-labs/go-bitbucket v0.9.60-beta h1:VEx1jvDgdtDPS6A1uUFoaEi0l1/oLhbr+90xOwr6sDU= github.com/devtron-labs/go-bitbucket v0.9.60-beta/go.mod h1:GnuiCesvh8xyHeMCb+twm8lBR/kQzJYSKL28ZfObp1Y= github.com/devtron-labs/protos v0.0.3-0.20250323220609-ecf8a0f7305e h1:U6UdYbW8a7xn5IzFPd8cywjVVPfutGJCudjePAfL/Hs= diff --git a/vendor/github.com/devtron-labs/common-lib/utils/SqlUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/SqlUtil.go index 3bdec67be5..bc5dbeba10 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/SqlUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/SqlUtil.go @@ -85,31 +85,31 @@ func ExecutePGQueryProcessor(cfg bean.PgQueryMonitoringConfig, event bean.PgQuer } else { status = SUCCESS } - PgQueryDuration.WithLabelValues(status, cfg.ServiceName, event.FuncName, getErrorType(pgError).String()).Observe(queryDuration.Seconds()) + PgQueryDuration.WithLabelValues(status, cfg.ServiceName, getErrorType(pgError).String()).Observe(queryDuration.Seconds()) } // Log pg query if enabled logThresholdQueries := cfg.LogSlowQuery && queryDuration.Milliseconds() > cfg.QueryDurationThreshold logNetworkFailure := queryError && cfg.LogAllFailureQueries && isNetworkError(pgError) if logNetworkFailure { - log.Println(fmt.Sprintf("%s - query time", PgNetworkErrorLogPrefix), "duration", queryDuration.Seconds(), "query", event.Query, "pgError", pgError) + log.Println(fmt.Sprintf("%s - query time", PgNetworkErrorLogPrefix), "duration", queryDuration.Seconds(), "functionName", event.FuncName, "query", event.Query, "pgError", pgError) } logFailureQuery := queryError && cfg.LogAllFailureQueries && !isNetworkError(pgError) if logFailureQuery { - log.Println(fmt.Sprintf("%s - query time", PgQueryFailLogPrefix), "duration", queryDuration.Seconds(), "query", event.Query, "pgError", pgError) + log.Println(fmt.Sprintf("%s - query time", PgQueryFailLogPrefix), "duration", queryDuration.Seconds(), "functionName", event.FuncName, "query", event.Query, "pgError", pgError) } if logThresholdQueries { - log.Println(fmt.Sprintf("%s - query time", PgQuerySlowLogPrefix), "duration", queryDuration.Seconds(), "query", event.Query) + log.Println(fmt.Sprintf("%s - query time", PgQuerySlowLogPrefix), "duration", queryDuration.Seconds(), "functionName", event.FuncName, "query", event.Query) } if cfg.LogAllQuery { - log.Println("query time", "duration", queryDuration.Seconds(), "query", event.Query) + log.Println("query time", "duration", queryDuration.Seconds(), "functionName", event.FuncName, "query", event.Query) } } var PgQueryDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "pg_query_duration_seconds", Help: "Duration of PG queries", -}, []string{"status", "serviceName", "functionName", "errorType"}) +}, []string{"status", "serviceName", "errorType"}) func getErrorType(err error) ErrorType { if err == nil { diff --git a/vendor/modules.txt b/vendor/modules.txt index dd7edae493..904cd2444b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -472,7 +472,7 @@ github.com/davecgh/go-spew/spew # github.com/deckarep/golang-set v1.8.0 ## explicit; go 1.17 github.com/deckarep/golang-set -# github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250508071415-beab8643ef22 +# github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250516092913-a8cc2e4a33e5 ## explicit; go 1.21 github.com/devtron-labs/authenticator/apiToken github.com/devtron-labs/authenticator/client @@ -480,7 +480,7 @@ github.com/devtron-labs/authenticator/jwt github.com/devtron-labs/authenticator/middleware github.com/devtron-labs/authenticator/oidc github.com/devtron-labs/authenticator/password -# github.com/devtron-labs/common-lib v0.18.1-0.20241001061923-eda545dc839e => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250508071415-beab8643ef22 +# github.com/devtron-labs/common-lib v0.18.1-0.20241001061923-eda545dc839e => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250516092913-a8cc2e4a33e5 ## explicit; go 1.21 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/blob-storage @@ -2352,8 +2352,8 @@ xorm.io/xorm/log xorm.io/xorm/names xorm.io/xorm/schemas xorm.io/xorm/tags -# github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250508071415-beab8643ef22 -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250508071415-beab8643ef22 +# github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250516092913-a8cc2e4a33e5 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250516092913-a8cc2e4a33e5 # github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127 # github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5 # k8s.io/api => k8s.io/api v0.29.7 From b74c203d64a1ba4b8440a6954b05bfde068a2606 Mon Sep 17 00:00:00 2001 From: systemsdt <129372406+systemsdt@users.noreply.github.com> Date: Mon, 19 May 2025 13:07:57 +0530 Subject: [PATCH 15/16] release: PR for v1.6.0 (#6576) * Updated release-notes files * Update beta-releasenotes.md * Updated release notes * Updated release notes * Updated release notes * Updated release notes * Updated release notes * misc: exposed the postgres endpoint in migrator and app-sync (#6570) * exposed the postgres endpoint * renamed the parameter --------- Co-authored-by: Badal Kumar Prusty * Switched Kubelink to Headless mode & added retention for minio-cache-bucket * Updated minio added statement for no retention policy * Updated release notes * updated minio condition * Updated notifier to 99e2f3cd-372-32893 tag in values file * Updated kubewatch to da156379-419-32900 tag in values file * Updated kubelink to da156379-564-32903 tag in values file * Updated git-sensor to da156379-200-32905 tag in values file * Updated dashboard to c5dfd7aa-690-32907 tag in values file * Updated release notes * Updated lens to da156379-333-32910 tag in values file * Updated ci-runner to da156379-138-32911 tag in values file * Updated image-scanner to da156379-141-32912 tag in values file * Updated chart-sync to da156379-836-32914 tag in values file * Updated hyperion to fe2a86bb-280-32916 tag in values file * Updated devtron to fe2a86bb-434-32917 tag in values file * Updated the version in scripts * sorted the devtron-images.txt.source * Update devtron-bom.yaml * Update kubelink.yaml * Update devtron.yaml * Updated devtron to ccae0023-434-32949 tag in values file * Updated hyperion to ccae0023-280-32950 tag in values file * Updated devtron to 667bd63f-434-32952 tag in values file * Updated hyperion to 667bd63f-280-32953 tag in values file * Update releasenotes.md * Update release-notes-v1.6.0.md * Update release-notes-v1.6.0.md * Update releasenotes.md * Update release-notes-v1.6.0.md * Update releasenotes.md * Update release-notes-v1.6.0.md * Update releasenotes.md * Update releasenotes.md * Update release-notes-v1.6.0.md * Update Chart.yaml * Update devtron-bom.yaml --------- Co-authored-by: akshatsinha007 <156403098+akshatsinha007@users.noreply.github.com> Co-authored-by: Badal Kumar <130441461+badal773@users.noreply.github.com> Co-authored-by: Badal Kumar Prusty Co-authored-by: akshatsinha007 Co-authored-by: Pawan Mehta <117346502+pawan-mehta-dt@users.noreply.github.com> --- CHANGELOG/release-notes-v1.6.0.md | 12 +++++++ charts/devtron/Chart.yaml | 4 +-- charts/devtron/devtron-bom.yaml | 29 ++++++++------- charts/devtron/templates/app-sync-job.yaml | 6 ++-- charts/devtron/templates/devtron.yaml | 4 +-- charts/devtron/templates/kubelink.yaml | 5 +-- charts/devtron/templates/migrator.yaml | 12 +++---- charts/devtron/templates/minio.yaml | 6 ++++ charts/devtron/values.yaml | 30 +++++++++------- devtron-images.txt.source | 41 ++++++++++++---------- manifests/install/devtron-installer.yaml | 2 +- manifests/installation-script | 2 +- releasenotes.md | 14 +++++--- 13 files changed, 101 insertions(+), 66 deletions(-) create mode 100644 CHANGELOG/release-notes-v1.6.0.md diff --git a/CHANGELOG/release-notes-v1.6.0.md b/CHANGELOG/release-notes-v1.6.0.md new file mode 100644 index 0000000000..883db9b3fd --- /dev/null +++ b/CHANGELOG/release-notes-v1.6.0.md @@ -0,0 +1,12 @@ +## v1.6.0 + +## Enhancements +- feat: added support for relabelings in servicemonitor (#6562) +## Bugs +- fix: rest handler missing return statements (#6545) +- fix: chart name fixed in chart reference table (#6543) +- fix: error pg.ErrNoRow on base deployment template update (#6533) +## Others +- chore: rollout reference chart 5-1-0 (#6573) +- misc: updated ucid-cm and added prehook (#6557) +- chore: pipeline timeline alter sql (#6541) diff --git a/charts/devtron/Chart.yaml b/charts/devtron/Chart.yaml index 2dcb873a1c..2158c91d6d 100644 --- a/charts/devtron/Chart.yaml +++ b/charts/devtron/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: devtron-operator -appVersion: 1.5.1 +appVersion: 1.6.0 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.92 +version: 0.22.94 sources: - https://github.com/devtron-labs/charts dependencies: diff --git a/charts/devtron/devtron-bom.yaml b/charts/devtron/devtron-bom.yaml index 7799e0c877..c184144b04 100644 --- a/charts/devtron/devtron-bom.yaml +++ b/charts/devtron/devtron-bom.yaml @@ -10,7 +10,7 @@ global: containerRegistry: "quay.io/devtron" extraManifests: [] installer: - release: "v1.5.1" + release: "v1.6.0" registry: "" image: "inception" tag: "473deaa4-185-21582" @@ -35,13 +35,13 @@ components: ENABLE_RESOURCE_SCAN: "true" FEATURE_CODE_MIRROR_ENABLE: "true" registry: "" - image: "dashboard:0fc42ac3-690-32105" + image: "dashboard:c5dfd7aa-690-32907" imagePullPolicy: IfNotPresent healthPort: 8080 devtron: registry: "" - image: "hyperion:e4fc95a9-280-32767" - cicdImage: "devtron:e4fc95a9-434-32763" + image: "hyperion:667bd63f-280-32953" + cicdImage: "devtron:667bd63f-434-32952" imagePullPolicy: IfNotPresent customOverrides: {} podSecurityContext: @@ -55,7 +55,7 @@ components: healthPort: 8080 ciRunner: registry: "" - image: "ci-runner:c49b4aa5-138-32101" + image: "ci-runner:da156379-138-32911" argocdDexServer: registry: "" image: "dex:v2.30.2" @@ -64,7 +64,7 @@ components: authenticator: "authenticator:e414faff-393-13273" kubelink: registry: "" - image: "kubelink:c49b4aa5-564-32098" + image: "kubelink:da156379-564-32903" imagePullPolicy: IfNotPresent configs: ENABLE_HELM_RELEASE_CACHE: "true" @@ -91,7 +91,7 @@ components: healthPort: 50052 kubewatch: registry: "" - image: "kubewatch:c49b4aa5-419-32097" + image: "kubewatch:da156379-419-32900" imagePullPolicy: IfNotPresent healthPort: 8080 configs: @@ -119,7 +119,7 @@ components: image: postgres_exporter:v0.10.1 gitsensor: registry: "" - image: "git-sensor:c49b4aa5-200-32099" + image: "git-sensor:da156379-200-32905" imagePullPolicy: IfNotPresent serviceMonitor: enabled: false @@ -138,7 +138,7 @@ components: # Values for lens lens: registry: "" - image: "lens:c49b4aa5-333-32100" + image: "lens:da156379-333-32910" imagePullPolicy: IfNotPresent configs: GIT_SENSOR_PROTOCOL: GRPC @@ -174,6 +174,8 @@ components: kubectlImage: "kubectl:latest" duplicateChartImage: devtron-utils:dup-chart-repo-v1.1.0 entMigratorImage: "devtron-utils:geni-v1.1.4" + configs: + PG_ADDR: postgresql-postgresql.devtroncd envVars: devtron: DB_NAME: "orchestrator" @@ -185,8 +187,10 @@ components: DB_NAME: "lens" chartSync: registry: "" - image: chart-sync:c49b4aa5-836-32103 + image: chart-sync:da156379-836-32914 schedule: "0 19 * * *" + extraConfigs: + PG_ADDR: postgresql-postgresql.devtroncd podSecurityContext: fsGroup: 1001 runAsGroup: 1001 @@ -195,7 +199,6 @@ components: allowPrivilegeEscalation: false runAsNonRoot: true runAsUser: 1001 - extraConfigs: {} # values for argocd integration argo-cd: global: @@ -215,7 +218,7 @@ workflowController: IMDSv1ExecutorImage: "argoexec:v3.0.7" security: imageScanner: - image: "image-scanner:c49b4aa5-141-32102" + image: "image-scanner:da156379-141-32912" healthPort: 8080 configs: TRIVY_DB_REPOSITORY: mirror.gcr.io/aquasec/trivy-db @@ -226,7 +229,7 @@ security: tag: 4.3.6 # Values for notifier integration notifier: - image: "notifier:56798239-372-32072" + image: "notifier:99e2f3cd-372-32893" healthPort: 3000 minio: image: "minio:RELEASE.2021-02-14T04-01-33Z" diff --git a/charts/devtron/templates/app-sync-job.yaml b/charts/devtron/templates/app-sync-job.yaml index f0ba041a84..28907cc333 100644 --- a/charts/devtron/templates/app-sync-job.yaml +++ b/charts/devtron/templates/app-sync-job.yaml @@ -32,13 +32,13 @@ spec: image: {{ include "common.image" (dict "component" $.Values.components.chartSync "global" $.Values.global ) }} {{- include "common.containerSecurityContext" (dict "containerSecurityContext" $.Values.components.chartSync.containerSecurityContext "global" $.Values.global) | indent 8 }} env: - - name: PG_ADDR - value: postgresql-postgresql.devtroncd - name: PG_DATABASE value: orchestrator - name: PG_USER value: postgres envFrom: + - configMapRef: + name: app-sync-cm - secretRef: name: devtron-secret - configMapRef: @@ -80,8 +80,6 @@ spec: image: {{ include "common.image" (dict "component" $.Values.components.chartSync "global" $.Values.global ) }} {{- include "common.containerSecurityContext" (dict "containerSecurityContext" $.Values.components.chartSync.containerSecurityContext "global" $.Values.global) | indent 12 }} env: - - name: PG_ADDR - value: postgresql-postgresql.devtroncd - name: PG_DATABASE value: orchestrator - name: PG_USER diff --git a/charts/devtron/templates/devtron.yaml b/charts/devtron/templates/devtron.yaml index 66994e6c86..8040a9aa7b 100644 --- a/charts/devtron/templates/devtron.yaml +++ b/charts/devtron/templates/devtron.yaml @@ -18,7 +18,7 @@ data: PG_ADDR: postgresql-postgresql.devtroncd {{- end }} PG_PORT: "5432" - HELM_CLIENT_URL: kubelink-service:50051 + HELM_CLIENT_URL: kubelink-service-headless:50051 DASHBOARD_PORT: "80" DASHBOARD_HOST: dashboard-service.devtroncd PG_DATABASE: orchestrator @@ -353,4 +353,4 @@ spec: matchLabels: app: devtron {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/devtron/templates/kubelink.yaml b/charts/devtron/templates/kubelink.yaml index eab17e5d96..21eae25d48 100644 --- a/charts/devtron/templates/kubelink.yaml +++ b/charts/devtron/templates/kubelink.yaml @@ -123,7 +123,7 @@ kind: Service metadata: labels: app: kubelink - name: kubelink-service + name: kubelink-service-headless namespace: devtroncd annotations: "helm.sh/resource-policy": keep @@ -137,4 +137,5 @@ spec: app: kubelink sessionAffinity: None type: ClusterIP -{{- end }} \ No newline at end of file + clusterIP: None +{{- end }} diff --git a/charts/devtron/templates/migrator.yaml b/charts/devtron/templates/migrator.yaml index e600750c02..461dd588a0 100644 --- a/charts/devtron/templates/migrator.yaml +++ b/charts/devtron/templates/migrator.yaml @@ -27,7 +27,7 @@ spec: - name: PG_USER value: postgres - name: PG_ADDR - value: postgresql-postgresql.devtroncd + value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }} - name: DB_PORT value: "5432" - name: PG_DATABASE @@ -80,7 +80,7 @@ spec: - name: DB_USER_NAME value: postgres - name: DB_HOST - value: postgresql-postgresql.devtroncd + value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }} - name: DB_PORT value: "5432" - name: DB_NAME @@ -186,7 +186,7 @@ spec: - name: DB_USER_NAME value: postgres - name: DB_HOST - value: postgresql-postgresql.devtroncd + value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }} - name: DB_PORT value: "5432" - name: DB_NAME @@ -273,7 +273,7 @@ spec: - name: DB_USER_NAME value: postgres - name: DB_HOST - value: postgresql-postgresql.devtroncd + value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }} - name: DB_PORT value: "5432" - name: DB_NAME @@ -355,7 +355,7 @@ spec: - name: DB_USER_NAME value: postgres - name: DB_HOST - value: postgresql-postgresql.devtroncd + value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }} - name: DB_PORT value: "5432" - name: DB_NAME @@ -430,7 +430,7 @@ spec: - name: DB_USER_NAME value: postgres - name: DB_HOST - value: postgresql-postgresql.devtroncd + value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }} - name: DB_PORT value: "5432" - name: DB_NAME diff --git a/charts/devtron/templates/minio.yaml b/charts/devtron/templates/minio.yaml index c8a24d442a..003c322300 100644 --- a/charts/devtron/templates/minio.yaml +++ b/charts/devtron/templates/minio.yaml @@ -129,6 +129,12 @@ data: createBucket devtron-ci-log none false true createBucket devtron-ci-cache none false true {{- end }} + {{- if ne ($.Values.minio.retention | int) 0 }} + ${MC} ilm add myminio/devtron-ci-cache --expiry-days {{ $.Values.minio.retention }} + ${MC} ilm ls myminio/devtron-ci-cache + {{- else }} + echo "No Lifecycle Policy Specified" + {{- end }} {{- end }} --- apiVersion: rbac.authorization.k8s.io/v1 diff --git a/charts/devtron/values.yaml b/charts/devtron/values.yaml index 82e65a1e65..ddbd622ef5 100644 --- a/charts/devtron/values.yaml +++ b/charts/devtron/values.yaml @@ -28,7 +28,7 @@ global: extraManifests: [] installer: repo: "devtron-labs/devtron" - release: "v1.5.1" + release: "v1.6.0" registry: "" image: inception tag: 473deaa4-185-21582 @@ -82,13 +82,13 @@ components: ENABLE_RESOURCE_SCAN: "true" FEATURE_CODE_MIRROR_ENABLE: "true" registry: "" - image: "dashboard:0fc42ac3-690-32105" + image: "dashboard:c5dfd7aa-690-32907" imagePullPolicy: IfNotPresent healthPort: 8080 devtron: registry: "" - image: "hyperion:e4fc95a9-280-32767" - cicdImage: "devtron:e4fc95a9-434-32763" + image: "hyperion:667bd63f-280-32953" + cicdImage: "devtron:667bd63f-434-32952" imagePullPolicy: IfNotPresent customOverrides: {} healthPort: 8080 @@ -123,7 +123,7 @@ components: # - devtron.example.com ciRunner: registry: "" - image: "ci-runner:c49b4aa5-138-32101" + image: "ci-runner:da156379-138-32911" argocdDexServer: registry: "" image: "dex:v2.30.2" @@ -132,7 +132,7 @@ components: authenticator: "authenticator:e414faff-393-13273" kubelink: registry: "" - image: "kubelink:c49b4aa5-564-32098" + image: "kubelink:da156379-564-32903" imagePullPolicy: IfNotPresent healthPort: 50052 podSecurityContext: @@ -159,7 +159,7 @@ components: keyName: postgresql-password kubewatch: registry: "" - image: "kubewatch:c49b4aa5-419-32097" + image: "kubewatch:da156379-419-32900" imagePullPolicy: IfNotPresent healthPort: 8080 configs: @@ -189,7 +189,7 @@ components: volumeSize: "20Gi" gitsensor: registry: "" - image: "git-sensor:c49b4aa5-200-32099" + image: "git-sensor:da156379-200-32905" imagePullPolicy: IfNotPresent serviceMonitor: enabled: false @@ -208,7 +208,7 @@ components: # Values for lens lens: registry: "" - image: "lens:c49b4aa5-333-32100" + image: "lens:da156379-333-32910" imagePullPolicy: IfNotPresent secrets: {} resources: {} @@ -246,6 +246,8 @@ components: kubectlImage: "kubectl:latest" duplicateChartImage: devtron-utils:dup-chart-repo-v1.1.0 entMigratorImage: "devtron-utils:geni-v1.1.4" + configs: + PG_ADDR: postgresql-postgresql.devtroncd envVars: devtron: DB_NAME: "orchestrator" @@ -257,9 +259,10 @@ components: DB_NAME: "lens" chartSync: registry: "" - image: chart-sync:c49b4aa5-836-32103 + image: chart-sync:da156379-836-32914 schedule: "0 19 * * *" - extraConfigs: {} + extraConfigs: + PG_ADDR: postgresql-postgresql.devtroncd podSecurityContext: fsGroup: 1001 runAsGroup: 1001 @@ -411,7 +414,7 @@ argo-cd: security: enabled: false imageScanner: - image: "image-scanner:c49b4aa5-141-32102" + image: "image-scanner:da156379-141-32912" healthPort: 8080 configs: TRIVY_DB_REPOSITORY: mirror.gcr.io/aquasec/trivy-db @@ -430,7 +433,7 @@ security: notifier: enabled: false imagePullPolicy: IfNotPresent - image: "notifier:56798239-372-32072" + image: "notifier:99e2f3cd-372-32893" configs: CD_ENVIRONMENT: PROD DB: orchestrator @@ -446,6 +449,7 @@ notifier: # Set enable to true if you want to use minio for storing cache and logs minio: enabled: false + retention: 30 replicaCount: 1 image: "minio:RELEASE.2021-02-14T04-01-33Z" imagePullPolicy: IfNotPresent diff --git a/devtron-images.txt.source b/devtron-images.txt.source index 6367726db9..7617098967 100644 --- a/devtron-images.txt.source +++ b/devtron-images.txt.source @@ -1,37 +1,42 @@ -quay.io/devtron/image-scanner:c49b4aa5-141-32102 -quay.io/devtron/inception:473deaa4-185-21582 -quay.io/devtron/hyperion:e4fc95a9-280-32767 public.ecr.aws/docker/library/redis:7.0.5-alpine quay.io/argoproj/argocd:v2.5.2 quay.io/argoproj/workflow-controller:v3.4.3 +quay.io/devtron/alpine-k8s-utils:latest +quay.io/devtron/alpine-netshoot:latest quay.io/devtron/authenticator:e414faff-393-13273 quay.io/devtron/bats:v1.4.1 quay.io/devtron/busybox:1.31.1 -quay.io/devtron/chart-sync:c49b4aa5-836-32103 +quay.io/devtron/centos-k8s-utils:latest +quay.io/devtron/chart-sync:da156379-836-32914 +quay.io/devtron/ci-runner:da156379-138-32911 +quay.io/devtron/clair:4.3.6 quay.io/devtron/curl:7.73.0 -quay.io/devtron/dashboard:0fc42ac3-690-32105 +quay.io/devtron/dashboard:c5dfd7aa-690-32907 quay.io/devtron/devtron-utils:dup-chart-repo-v1.1.0 -quay.io/devtron/devtron:e4fc95a9-434-32763 -quay.io/devtron/ci-runner:c49b4aa5-138-32101 +quay.io/devtron/devtron:667bd63f-434-32952 quay.io/devtron/dex:v2.30.2 -quay.io/devtron/git-sensor:c49b4aa5-200-32099 +quay.io/devtron/git-sensor:da156379-200-32905 quay.io/devtron/grafana:7.3.1 +quay.io/devtron/hyperion:667bd63f-280-32953 +quay.io/devtron/image-scanner:da156379-141-32912 +quay.io/devtron/inception:473deaa4-185-21582 quay.io/devtron/k8s-sidecar:1.1.0 quay.io/devtron/k8s-utils:tutum-curl +quay.io/devtron/k9s-k8s-utils:latest quay.io/devtron/kubectl:latest -quay.io/devtron/kubelink:c49b4aa5-564-32098 -quay.io/devtron/kubewatch:c49b4aa5-419-32097 -quay.io/devtron/lens:c49b4aa5-333-32100 +quay.io/devtron/kubelink:da156379-564-32903 +quay.io/devtron/kubewatch:da156379-419-32900 +quay.io/devtron/lens:da156379-333-32910 quay.io/devtron/migrator:v4.16.2 +quay.io/devtron/minideb:latest +quay.io/devtron/minio-mc:RELEASE.2021-02-14T04-28-06Z +quay.io/devtron/minio:RELEASE.2021-02-14T04-01-33Z quay.io/devtron/nats-box quay.io/devtron/nats-server-config-reloader:0.6.2 quay.io/devtron/nats:2.9.3-alpine -quay.io/devtron/notifier:56798239-372-32072 +quay.io/devtron/notifier:99e2f3cd-372-32893 +quay.io/devtron/postgres:14.9 quay.io/devtron/postgres_exporter:v0.10.1 -quay.io/devtron/prometheus-nats-exporter:0.9.0 -quay.io/devtron/minio:RELEASE.2021-02-14T04-01-33Z -quay.io/devtron/clair:4.3.6 quay.io/devtron/postgres_exporter:v0.4.7 -quay.io/devtron/minio-mc:RELEASE.2021-02-14T04-28-06Z -quay.io/devtron/minideb:latest -quay.io/devtron/postgres:14.9 +quay.io/devtron/prometheus-nats-exporter:0.9.0 +quay.io/devtron/ubuntu-k8s-utils:latest diff --git a/manifests/install/devtron-installer.yaml b/manifests/install/devtron-installer.yaml index 5a61704349..effacecb6f 100644 --- a/manifests/install/devtron-installer.yaml +++ b/manifests/install/devtron-installer.yaml @@ -4,4 +4,4 @@ metadata: name: installer-devtron namespace: devtroncd spec: - url: https://raw.githubusercontent.com/devtron-labs/devtron/v1.5.1/manifests/installation-script + url: https://raw.githubusercontent.com/devtron-labs/devtron/v1.6.0/manifests/installation-script diff --git a/manifests/installation-script b/manifests/installation-script index d8f38c6909..2591e81125 100644 --- a/manifests/installation-script +++ b/manifests/installation-script @@ -1,4 +1,4 @@ -LTAG="v1.5.1"; +LTAG="v1.6.0"; REPO_RAW_URL="https://raw.githubusercontent.com/devtron-labs/devtron/"; log("executed devtron setup installation"); diff --git a/releasenotes.md b/releasenotes.md index fb6c27b636..883db9b3fd 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -1,6 +1,12 @@ -## v1.5.1 +## v1.6.0 +## Enhancements +- feat: added support for relabelings in servicemonitor (#6562) ## Bugs -- fix: stack manager page break on server api giving internal server error (#6556) - - +- fix: rest handler missing return statements (#6545) +- fix: chart name fixed in chart reference table (#6543) +- fix: error pg.ErrNoRow on base deployment template update (#6533) +## Others +- chore: rollout reference chart 5-1-0 (#6573) +- misc: updated ucid-cm and added prehook (#6557) +- chore: pipeline timeline alter sql (#6541) From 7229c146873cd7b8223a66fd8d545d6110c66431 Mon Sep 17 00:00:00 2001 From: Vikram Singh Date: Mon, 19 May 2025 17:08:41 +0530 Subject: [PATCH 16/16] vendor update in develop --- go.mod | 4 ++-- go.sum | 8 ++++---- .../devtron-labs/common-lib/constants/constants.go | 1 + vendor/modules.txt | 8 ++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 0d1f44c4db..aad9a8cba5 100644 --- a/go.mod +++ b/go.mod @@ -307,8 +307,8 @@ require ( replace ( github.com/argoproj/argo-workflows/v3 v3.5.13 => github.com/devtron-labs/argo-workflows/v3 v3.5.13 - github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519051255-c306199e8103 - github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519051255-c306199e8103 + github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519113737-b060cea3a495 + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519113737-b060cea3a495 github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127 github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5 k8s.io/api => k8s.io/api v0.29.7 diff --git a/go.sum b/go.sum index 6e84d8fd78..00f2869e2e 100644 --- a/go.sum +++ b/go.sum @@ -829,10 +829,10 @@ github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc h1:VRRKCwnzq github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/devtron-labs/argo-workflows/v3 v3.5.13 h1:3pINq0gXOSeTw2z/vYe+j80lRpSN5Rp/8mfQORh8SmU= github.com/devtron-labs/argo-workflows/v3 v3.5.13/go.mod h1:/vqxcovDPT4zqr4DjR5v7CF8ggpY1l3TSa2CIG3jmjA= -github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519051255-c306199e8103 h1:e87xUalShG6p69AHBL/R5CXsnaKRFv2T3d9v8pe57ok= -github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519051255-c306199e8103/go.mod h1:FfaLDXN1ZXxyRpnskBqVIYkpkWDCzBmDgIO9xqLnxdQ= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519051255-c306199e8103 h1:BMO9hE60ZyFUpAOPv4KawSMrkQOXglQxwiMpFu9VCxs= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519051255-c306199e8103/go.mod h1:CXQGEo+kZc7JPX5hn4jJf1msal9q/ExSdAYGkHNPnQw= +github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519113737-b060cea3a495 h1:GBe/yfpn5uU3Myv0TV4KBvSLfuwRRjTN7uXAupeUhbk= +github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519113737-b060cea3a495/go.mod h1:FfaLDXN1ZXxyRpnskBqVIYkpkWDCzBmDgIO9xqLnxdQ= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519113737-b060cea3a495 h1:aEJw3HPicUqpwBIZos5lsiNIuL1c4w5bqadkHyj+dAA= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519113737-b060cea3a495/go.mod h1:CXQGEo+kZc7JPX5hn4jJf1msal9q/ExSdAYGkHNPnQw= github.com/devtron-labs/go-bitbucket v0.9.60-beta h1:VEx1jvDgdtDPS6A1uUFoaEi0l1/oLhbr+90xOwr6sDU= github.com/devtron-labs/go-bitbucket v0.9.60-beta/go.mod h1:GnuiCesvh8xyHeMCb+twm8lBR/kQzJYSKL28ZfObp1Y= github.com/devtron-labs/protos v0.0.3-0.20250323220609-ecf8a0f7305e h1:U6UdYbW8a7xn5IzFPd8cywjVVPfutGJCudjePAfL/Hs= diff --git a/vendor/github.com/devtron-labs/common-lib/constants/constants.go b/vendor/github.com/devtron-labs/common-lib/constants/constants.go index f327d712ba..0baf2387e0 100644 --- a/vendor/github.com/devtron-labs/common-lib/constants/constants.go +++ b/vendor/github.com/devtron-labs/common-lib/constants/constants.go @@ -34,6 +34,7 @@ const ( Kubelink ServiceName = "KUBELINK" GitSensor ServiceName = "GITSENSOR" Kubewatch ServiceName = "KUBEWATCH" + ImageScanner ServiceName = "IMAGE_SCANNER" ) // metrics name constants diff --git a/vendor/modules.txt b/vendor/modules.txt index fdc8b22b5d..d45b2218f0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -472,7 +472,7 @@ github.com/davecgh/go-spew/spew # github.com/deckarep/golang-set v1.8.0 ## explicit; go 1.17 github.com/deckarep/golang-set -# github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519051255-c306199e8103 +# github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519113737-b060cea3a495 ## explicit; go 1.21 github.com/devtron-labs/authenticator/apiToken github.com/devtron-labs/authenticator/client @@ -480,7 +480,7 @@ github.com/devtron-labs/authenticator/jwt github.com/devtron-labs/authenticator/middleware github.com/devtron-labs/authenticator/oidc github.com/devtron-labs/authenticator/password -# github.com/devtron-labs/common-lib v0.18.1-0.20241001061923-eda545dc839e => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519051255-c306199e8103 +# github.com/devtron-labs/common-lib v0.18.1-0.20241001061923-eda545dc839e => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519113737-b060cea3a495 ## explicit; go 1.21 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/blob-storage @@ -2358,8 +2358,8 @@ xorm.io/xorm/log xorm.io/xorm/names xorm.io/xorm/schemas xorm.io/xorm/tags -# github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519051255-c306199e8103 -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519051255-c306199e8103 +# github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519113737-b060cea3a495 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519113737-b060cea3a495 # github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127 # github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5 # k8s.io/api => k8s.io/api v0.29.7