[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: removed inception dependency for installation. #3228

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f0ee18f
changes in inception
jatin-jangir Apr 3, 2023
d0debb0
added kubewatch.yaml in templates
jatin-jangir Apr 3, 2023
883cbee
add the kubewatch.yaml
jatin-jangir Apr 3, 2023
e82aad8
Merge branch 'devtron-labs:main' into remove-kubewatch
jatin-jangir Apr 3, 2023
d10d676
add resources in kubewatch.yaml
jatin-jangir Apr 3, 2023
6ed767c
removed apply command for kubewatch
jatin-jangir Apr 3, 2023
ec1d6d4
add gitsensor in templates
jatin-jangir Apr 4, 2023
a4777b4
update gitsensor initcoontainer
jatin-jangir Apr 4, 2023
634a7da
updated for cicd module
jatin-jangir Apr 4, 2023
f865f1f
updated for installer for testing
jatin-jangir Apr 4, 2023
8ca9627
added migration for lens and gitsensor
jatin-jangir Apr 4, 2023
4e654f9
added random words to job
jatin-jangir Apr 4, 2023
9ce5fd7
deletion in inception
jatin-jangir Apr 4, 2023
0f6bb52
changed CM
jatin-jangir Apr 5, 2023
34cfbfc
Merge branch 'devtron-labs:main' into remove-kubewatch
jatin-jangir Apr 5, 2023
d95bc18
added nats
jatin-jangir Apr 5, 2023
c4958e7
added rollout
jatin-jangir Apr 5, 2023
acf4d6c
change crd
jatin-jangir Apr 5, 2023
91b3c75
change argocd-resources-json
jatin-jangir Apr 5, 2023
31c3a00
change argocd-resources-json fix
jatin-jangir Apr 5, 2023
8d204c6
added serviceAccount and CR and CRB
jatin-jangir Apr 6, 2023
5aa1af4
Merge branch 'devtron-labs:main' into remove-kubewatch
jatin-jangir Apr 6, 2023
23a1bf4
added secrets
jatin-jangir Apr 7, 2023
adef49d
Merge branch 'devtron-labs:main' into remove-kubewatch
jatin-jangir Apr 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions charts/devtron/Chart.lock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chart.lock file shouldn't be commited

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: argo-cd
repository: https://argoproj.github.io/argo-helm
version: 5.9.1
- name: security
repository: https://helm.devtron.ai
version: 0.1.5
digest: sha256:542747d1d1b2b6fc0c26eea55fe967b9351ed5f6f5eb08c5d121f1e6ec9313fe
generated: "2023-04-04T12:13:21.800918+05:30"
Binary file added charts/devtron/charts/argo-cd-5.9.1.tgz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these charts

Binary file not shown.
Binary file added charts/devtron/charts/security-0.1.5.tgz
Binary file not shown.
175 changes: 175 additions & 0 deletions charts/devtron/templates/argocd-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,178 @@ data:
- name: kedacore
type: helm
url: https://kedacore.github.io/charts
resource.customizations: >
kubernetes-client.io/ExternalSecret:
health.lua: |
hs = {}
if obj.status ~= nil then
if obj.status.status ~= nil then
hs.status = "Degraded"
hs.message = obj.status.status
else
hs.status = "Healthy"
end
else
hs.status = "Healthy"
end
return hs
argoproj.io/Rollout:
health.lua: |
function checkReplicasStatus(obj)
hs = {}
replicasCount = getNumberValueOrDefault(obj.spec.replicas)
replicasStatus = getNumberValueOrDefault(obj.status.replicas)
updatedReplicas = getNumberValueOrDefault(obj.status.updatedReplicas)
availableReplicas = getNumberValueOrDefault(obj.status.availableReplicas)

if updatedReplicas < replicasCount then
hs.status = "Progressing"
hs.message = "Waiting for roll out to finish: More replicas need to be updated"
return hs
end
-- Since the scale down delay can be very high, BlueGreen does not wait for all the old replicas to scale
-- down before marking itself healthy. As a result, only evaluate this condition if the strategy is canary.
if obj.spec.strategy.canary ~= nil and replicasStatus > updatedReplicas then
hs.status = "Progressing"
hs.message = "Waiting for roll out to finish: old replicas are pending termination"
return hs
end
if availableReplicas < updatedReplicas then
hs.status = "Progressing"
hs.message = "Waiting for roll out to finish: updated replicas are still becoming available"
return hs
end
return nil
end

function getNumberValueOrDefault(field)
if field ~= nil then
return field
end
return 0
end

function checkPaused(obj)
hs = {}
local paused = false
if obj.status.verifyingPreview ~= nil then
paused = obj.status.verifyingPreview
elseif obj.spec.paused ~= nil then
paused = obj.spec.paused
end

if paused then
hs.status = "Suspended"
hs.message = "Rollout is paused"
return hs
end
return nil
end

hs = {}
if obj.status ~= nil then
if obj.status.conditions ~= nil then
for _, condition in ipairs(obj.status.conditions) do
if condition.type == "InvalidSpec" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end
if condition.type == "Progressing" and condition.reason == "RolloutAborted" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end
if condition.type == "Progressing" and condition.reason == "ProgressDeadlineExceeded" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end
end
end
if obj.status.currentPodHash ~= nil then
if obj.spec.strategy.blueGreen ~= nil then
isPaused = checkPaused(obj)
if isPaused ~= nil then
return isPaused
end
replicasHS = checkReplicasStatus(obj)
if replicasHS ~= nil then
return replicasHS
end
if obj.status.blueGreen ~= nil and obj.status.blueGreen.activeSelector ~= nil and obj.status.blueGreen.activeSelector == obj.status.currentPodHash then
hs.status = "Healthy"
hs.message = "The active Service is serving traffic to the current pod spec"
return hs
end
hs.status = "Progressing"
hs.message = "The current pod spec is not receiving traffic from the active service"
return hs
end
if obj.spec.strategy.recreate ~= nil then
isPaused = checkPaused(obj)
if isPaused ~= nil then
return isPaused
end
replicasHS = checkReplicasStatus(obj)
if replicasHS ~= nil then
return replicasHS
end
if obj.status.recreate ~= nil and obj.status.recreate.currentRS ~= nil and obj.status.recreate.currentRS == obj.status.currentPodHash then
hs.status = "Healthy"
hs.message = "Rollout is successful"
return hs
end
hs.status = "Progressing"
hs.message = "Rollout is in progress"
return hs
end
if obj.spec.strategy.canary ~= nil then
currentRSIsStable = obj.status.canary.stableRS == obj.status.currentPodHash
if obj.spec.strategy.canary.steps ~= nil and table.getn(obj.spec.strategy.canary.steps) > 0 then
stepCount = table.getn(obj.spec.strategy.canary.steps)
if obj.status.currentStepIndex ~= nil then
currentStepIndex = obj.status.currentStepIndex
isPaused = checkPaused(obj)
if isPaused ~= nil then
return isPaused
end

if paused then
hs.status = "Suspended"
hs.message = "Rollout is paused"
return hs
end
if currentRSIsStable and stepCount == currentStepIndex then
replicasHS = checkReplicasStatus(obj)
if replicasHS ~= nil then
return replicasHS
end
hs.status = "Healthy"
hs.message = "The rollout has completed all steps"
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for rollout to finish steps"
return hs
end

-- The detecting the health of the Canary deployment when there are no steps
replicasHS = checkReplicasStatus(obj)
if replicasHS ~= nil then
return replicasHS
end
if currentRSIsStable then
hs.status = "Healthy"
hs.message = "The rollout has completed canary deployment"
return hs
end
hs.status = "Progressing"
hs.message = "Waiting for rollout to finish canary deployment"
end
end
end
hs.status = "Progressing"
hs.message = "Waiting for rollout to finish: status has not been reconciled."
return hs
13 changes: 13 additions & 0 deletions charts/devtron/templates/configmap-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{{- $grafanaPwd := include "getOrGeneratePass" (dict "Namespace" "devtroncd" "Kind" "Secret" "Name" "devtron-grafana-cred-secret" "Key" "admin-password") }}
{{- $minioAccessKey := include "getOrGeneratePass" (dict "Namespace" "devtroncd" "Kind" "Secret" "Name" "devtron-minio" "Key" "accesskey") }}
{{- $minioSecretKey := include "getOrGeneratePass" (dict "Namespace" "devtroncd" "Kind" "Secret" "Name" "devtron-minio" "Key" "secretkey") }}
{{- $EXTERNAL_CI_API_SECRET := include "getOrGeneratePass" (dict "Namespace" "devtroncd" "Kind" "Secret" "Name" "devtron-secret" "Key" "EXTERNAL_CI_API_SECRET") }}
{{- $WEBHOOK_TOKEN := include "getOrGeneratePass" (dict "Namespace" "devtroncd" "Kind" "Secret" "Name" "devtron-secret" "Key" "WEBHOOK_TOKEN") }}
{{- $ORCH_TOKEN := include "getOrGeneratePass" (dict "Namespace" "devtroncd" "Kind" "Secret" "Name" "devtron-secret" "Key" "ORCH_TOKEN") }}
{{- $DEX_SECRET := include "getOrGeneratePass" (dict "Namespace" "devtroncd" "Kind" "Secret" "Name" "devtron-secret" "Key" "DEX_SECRET") }}
{{- $DEX_JWTKEY := include "getOrGeneratePass" (dict "Namespace" "devtroncd" "Kind" "Secret" "Name" "devtron-secret" "Key" "DEX_JWTKEY") }}
{{- $DEX_CSTOREKEY := include "getOrGeneratePass" (dict "Namespace" "devtroncd" "Kind" "Secret" "Name" "devtron-secret" "Key" "DEX_CSTOREKEY") }}

{{- if $.Values.installer.modules }}
{{- if has "cicd" $.Values.installer.modules }}
apiVersion: v1
Expand Down Expand Up @@ -241,6 +248,12 @@ metadata:
"helm.sh/resource-policy": keep
data:
PG_PASSWORD: {{ $Secret }}
EXTERNAL_CI_API_SECRET: {{ $EXTERNAL_CI_API_SECRET }}
WEBHOOK_TOKEN: {{ $WEBHOOK_TOKEN }}
ORCH_TOKEN: {{ $ORCH_TOKEN }}
DEX_SECRET: {{ $DEX_SECRET }}
DEX_JWTKEY: {{ $DEX_JWTKEY }}
DEX_CSTOREKEY: {{ $DEX_CSTOREKEY }}
type: Opaque
---
apiVersion: v1
Expand Down
85 changes: 85 additions & 0 deletions charts/devtron/templates/devtron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,69 @@ data:
APP_SYNC_IMAGE: "quay.io/devtron/chart-sync:07ac8fd7-150-11120"
{{- if $.Values.installer.modules }}
{{- if has "cicd" $.Values.installer.modules }}
CD_HOST: "argocd-server.devtroncd"
CD_PORT: "80"
CD_NAMESPACE: "devtroncd"
EVENT_URL: "http://notifier-service.devtroncd:80/notify"
GIT_SENSOR_URL: "http://git-sensor-service.devtroncd:80"
GIT_SENSOR_TIMEOUT: "300"
LENS_URL: "http://lens-service.devtroncd:80"
LENS_TIMEOUT: "300"
NATS_SERVER_HOST: "nats://devtron-nats.devtroncd:4222"
APP: "orchestrator"
PG_LOG_QUERY: "true"
LOG_LEVEL: "0"
GIT_WORKING_DIRECTORY: "/tmp/gitops/"
ACD_URL: "argocd-server.devtroncd"
ACD_USER: "admin"
ACD_TIMEOUT: "300"
ACD_SKIP_VERIFY: "true"
MODE: "PROD"
CD_LIMIT_CI_CPU: "0.5"
CD_LIMIT_CI_MEM: "3G"
CD_REQ_CI_CPU: "0.5"
CD_REQ_CI_MEM: "1G"
CD_NODE_TAINTS_KEY: "dedicated"
CD_NODE_LABEL_SELECTOR: "kubernetes.io/os=linux"
CD_WORKFLOW_SERVICE_ACCOUNT: "cd-runner"
DEFAULT_BUILD_LOGS_KEY_PREFIX: "devtron"
DEFAULT_CD_ARTIFACT_KEY_LOCATION: "devtron/cd-artifacts"
CD_NODE_TAINTS_VALUE: "ci"
CD_ARTIFACT_LOCATION_FORMAT: "%d/%d.zip"
DEFAULT_CD_NAMESPACE: "devtron-cd"
DEFAULT_CI_IMAGE: "quay.io/devtron/ci-runner:1d8a38a6-138-13253"
DEFAULT_CD_TIMEOUT: "3600"
WF_CONTROLLER_INSTANCE_ID: "devtron-runner"
CI_LOGS_KEY_PREFIX: "ci-artifacts"
DEFAULT_NAMESPACE: "devtron-ci"
DEFAULT_TIMEOUT: "3600"
LIMIT_CI_CPU: "0.5"
LIMIT_CI_MEM: "3G"
REQ_CI_CPU: "0.5"
REQ_CI_MEM: "1G"
CI_NODE_TAINTS_KEY: ""
CI_NODE_TAINTS_VALUE: ""
CI_NODE_LABEL_SELECTOR: ""
CACHE_LIMIT: "5000000000"
DEFAULT_ARTIFACT_KEY_LOCATION: "devtron/ci-artifacts"
WORKFLOW_SERVICE_ACCOUNT: "ci-runner"
EXTERNAL_CI_PAYLOAD: "{\"ciProjectDetails\":[{\"gitRepository\":\"https://github.com/srj92/getting-started-nodejs.git\",\"checkoutPath\":\"./abc\",\"commitHash\":\"239077135f8cdeeccb7857e2851348f558cb53d3\",\"commitTime\":\"2019-10-31T20:55:21+05:30\",\"branch\":\"master\",\"message\":\"Update README.md\",\"author\":\"Suraj Gupta \"}],\"dockerImage\":\"445808685819.dkr.ecr.us-east-2.amazonaws.com/orch:23907713-2\",\"digest\":\"test1\",\"dataSource\":\"ext\",\"materialType\":\"git\"}"
CI_ARTIFACT_LOCATION_FORMAT: "%d/%d.zip"
IMAGE_SCANNER_ENDPOINT: "http://image-scanner-service.devtroncd:80"
ECR_REPO_NAME_PREFIX: "devtron/"
ACD_USERNAME: "admin"
DEX_RURL: "http://argocd-dex-server.devtroncd:8080/callback"
DEX_URL: "http://argocd-dex-server.devtroncd:5556/dex"
CExpirationTime: "600"
JwtExpirationTime: "120"
ACD_CM: "argocd-cm"
ACD_NAMESPACE: "devtroncd"
MINIO_ENDPOINT: http://devtron-minio:9000
GITOPS_REPO_PREFIX: "devtron"
ENFORCER_CACHE: "true"
ENFORCER_CACHE_EXPIRATION_IN_SEC: "345600"
ENFORCER_MAX_BATCH_SIZE: "1"
DEVTRON_SECRET_NAME: "devtron-secret"
{{- if $.Values.configs }}
{{- if or ($.Values.minio.enabled) ($.Values.configs.BLOB_STORAGE_PROVIDER) }}
BLOB_STORAGE_ENABLED: "true"
Expand Down Expand Up @@ -52,9 +115,14 @@ data:
{{- if $.Values.monitoring.grafana }}
{{- if $.Values.monitoring.grafana.enabled }}
GRAFANA_URL: "http://%s:%s@devtron-grafana.devtroncd/grafana"
GRAFANA_HOST: "devtron-grafana.devtroncd"
GRAFANA_PORT: "80"
GRAFANA_NAMESPACE: "devtroncd"
GRAFANA_ORG_ID: "2"
{{- end }}
{{- end }}
{{- end }}

{{- end }}
{{- end }}
{{- end }}
Expand All @@ -72,6 +140,23 @@ data:
{{ toYaml .customOverrides | indent 2}}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: devtron-cluster-components
labels:
release: devtron
data:
rollout.yaml: >-
rollout:
resources:
limits:
cpu: 250m
memory: 200Mi
requests:
cpu: 50m
memory: 100Mi
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
Loading