Skip to content

feat: Support of argo upgrade to 7.7.15 chart version #6693

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

Open
wants to merge 7 commits into
base: release-bot
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21 AS build-env
FROM golang:1.24.0 AS build-env

RUN echo $GOPATH && \
apt update && \
Expand Down
2 changes: 1 addition & 1 deletion DockerfileEA
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21 AS build-env
FROM golang:1.24.0 AS build-env

RUN echo $GOPATH && \
apt update && \
Expand Down
2 changes: 1 addition & 1 deletion charts/devtron/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sources:
- https://github.com/devtron-labs/charts
dependencies:
- name: argo-cd
version: "5.9.1"
version: "7.7.15"
repository: https://argoproj.github.io/argo-helm
condition: argo-cd.enabled
- name: security
Expand Down
266 changes: 149 additions & 117 deletions charts/devtron/templates/argocd-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,173 +64,205 @@ data:
health.lua: |
hs = {}
if obj.status ~= nil then
if obj.status.status ~= nil then
hs.status = "Degraded"
hs.message = obj.status.status
else
if obj.status.status ~= nil then
hs.status = "Degraded"
hs.message = obj.status.status
else
hs.status = "Healthy"
end
end
else
hs.status = "Healthy"
hs.status = "Healthy"
end
return hs
argoproj.io/Rollout:
health.lua: |
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
function checkReplicasStatus(obj)
hs = {}
replicasCount = getNumberValueOrDefault(obj.spec.replicas)
replicasStatus = getNumberValueOrDefault(obj.status.replicas)
updatedReplicas = getNumberValueOrDefault(obj.status.updatedReplicas)
availableReplicas = getNumberValueOrDefault(obj.status.availableReplicas)
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
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
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
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
end
return nil
end

hs = {}
if obj.status ~= nil then
if obj.status.conditions ~= nil then
function statusfromcondition(obj)
local hs={}
for _, condition in ipairs(obj.status.conditions) do
if condition.type == "InvalidSpec" then
hs.status = "Degraded"
hs.message = condition.message
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
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
end
if condition.type == "Progressing" and condition.reason == "ProgressDeadlineExceeded" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end
end
end
end
if obj.status.currentPodHash ~= nil then
return nil
end

function statusfrompodhash(obj)
local hs={}
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"
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
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"
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
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
if obj.status.stableRS ~= nil then
currentRSIsStable = obj.status.stableRS == obj.status.currentPodHash
end
if obj.status.canary.stableRS ~= nil then
currentRSIsStable = obj.status.canary.stableRS == obj.status.currentPodHash
end
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
currentStepIndex = obj.status.currentStepIndex
isPaused = checkPaused(obj)
if isPaused ~= nil then
return isPaused
end

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

-- The detecting the health of the Canary deployment when there are no steps
replicasHS = checkReplicasStatus(obj)
if replicasHS ~= nil then
-- 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
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
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
end

-- Main Code
hs = {}
if obj.status.phase ~= nil then
if obj.status.phase == "Paused" then
hs.status = "Progressing"
hs.message = "Rollout is paused"
elseif obj.status.phase == "Progressing" then
hs=statusfromcondition(obj) or hs
hs=statusfrompodhash(obj) or hs
elseif obj.status.phase == "Healthy" then
hs=statusfromcondition(obj) or hs
hs=statusfrompodhash(obj) or hs
else
hs.status = obj.status.phase
hs.message = obj.status.message
end
else
if obj.status ~= nil then
if obj.status.conditions ~= nil then
hs=statusfromcondition(obj)
end
if obj.status.currentPodHash ~= nil then
hs=statusfrompodhash(obj)
end
end
end
return hs
14 changes: 8 additions & 6 deletions charts/devtron/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,18 @@ argo-cd:
# -- If defined, a repository applied to all Argo CD deployments
repository: quay.io/argoproj/argocd
# -- Overrides the global Argo CD image tag whose default is the chart appVersion
tag: "v2.5.2"
tag: "v2.13.3"
# -- If defined, a imagePullPolicy applied to all Argo CD deployments
imagePullPolicy: IfNotPresent
configs:
secret:
createSecret: false
cm:
create: false
# argocd-rbac-cm
rbac:
create: true
policy.default: role:admin
# argocd-application-controller
controller:
args:
Expand Down Expand Up @@ -342,7 +348,6 @@ argo-cd:
tag: 7.0.5-alpine
# argocd-server
server:
configEnabled: false
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -365,9 +370,6 @@ argo-cd:
- all
readOnlyRootFilesystem: true
runAsNonRoot: true
# argocd-rbac-cm
rbacConfig:
policy.default: role:admin
# argocd-repo-server
repoServer:
affinity:
Expand Down Expand Up @@ -401,7 +403,7 @@ argo-cd:
readOnlyRootFilesystem: true
runAsNonRoot: true
applicationSet:
enabled: false
replicas: 0
notifications:
enabled: false
# Values for security integration
Expand Down
Loading
Loading