Skip to content

Commit

Permalink
feat(lifecycle-operator): add feature flag for enabling promotion tas…
Browse files Browse the repository at this point in the history
…ks (keptn#3055)

Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: vickysomtee <[email protected]>
  • Loading branch information
bacherfl authored and Vickysomtee committed Apr 22, 2024
1 parent caa77d9 commit 9fa19a0
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/scripts/.helm-tests/default/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11478,6 +11478,8 @@ spec:
value: "0"
- name: SCHEDULING_GATES_ENABLED
value: "false"
- name: PROMOTION_TASKS_ENABLED
value: "false"
- name: KUBERNETES_CLUSTER_DOMAIN
value: cluster.local
- name: CERT_MANAGER_ENABLED
Expand Down
2 changes: 2 additions & 0 deletions .github/scripts/.helm-tests/lifecycle-only/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8887,6 +8887,8 @@ spec:
value: "0"
- name: SCHEDULING_GATES_ENABLED
value: "false"
- name: PROMOTION_TASKS_ENABLED
value: "true"
- name: KUBERNETES_CLUSTER_DOMAIN
value: cluster.local
- name: CERT_MANAGER_ENABLED
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/.helm-tests/lifecycle-only/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ global:

lifecycleOperator:
enabled: true
promotionTasksEnabled: true
lifecycleOperator:
image:
repository: myrep
Expand Down
2 changes: 2 additions & 0 deletions .github/scripts/.helm-tests/lifecycle-with-certs/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9201,6 +9201,8 @@ spec:
value: "0"
- name: SCHEDULING_GATES_ENABLED
value: "false"
- name: PROMOTION_TASKS_ENABLED
value: "false"
- name: KUBERNETES_CLUSTER_DOMAIN
value: cluster.local
- name: CERT_MANAGER_ENABLED
Expand Down
1 change: 1 addition & 0 deletions lifecycle-operator/chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ and application health checks
| `annotations` | add deployment level annotations | `{}` |
| `podAnnotations` | adds pod level annotations | `{}` |
| `schedulingGatesEnabled` | enables the scheduling gates in lifecycle-operator. This feature is available in alpha version from K8s 1.27 or 1.26 enabling the alpha version | `false` |
| `promotionTasksEnabled` | enables the promotion task feature in the lifecycle-operator. | `false` |
| `allowedNamespaces` | specifies the allowed namespaces for the lifecycle orchestration functionality | `[]` |
| `deniedNamespaces` | specifies a list of namespaces where the lifecycle orchestration functionality is disabled, ignored if `allowedNamespaces` is set | `["cert-manager","keptn-system","observability","monitoring"]` |

Expand Down
3 changes: 3 additions & 0 deletions lifecycle-operator/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ spec:
- name: SCHEDULING_GATES_ENABLED
value: {{ .Values.schedulingGatesEnabled | quote
}}
- name: PROMOTION_TASKS_ENABLED
value: {{ .Values.promotionTasksEnabled | quote
}}
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ .Values.kubernetesClusterDomain }}
- name: CERT_MANAGER_ENABLED
Expand Down
4 changes: 3 additions & 1 deletion lifecycle-operator/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ lifecycleOperatorMetricsService:
type: ClusterIP

## @section Global
## Current available parameters: kubernetesClusterDomain, imagePullSecrets, schedulingGatesEnabled, allowedNamespaces, deniedNamespaces
## Current available parameters: kubernetesClusterDomain, imagePullSecrets, schedulingGatesEnabled, allowedNamespaces, deniedNamespaces, promotionTasksEnabled
## @param kubernetesClusterDomain overrides cluster.local
kubernetesClusterDomain: cluster.local
## @param annotations add deployment level annotations
Expand All @@ -173,6 +173,8 @@ annotations: {}
podAnnotations: {}
## @param schedulingGatesEnabled enables the scheduling gates in lifecycle-operator. This feature is available in alpha version from K8s 1.27 or 1.26 enabling the alpha version
schedulingGatesEnabled: false
## @param promotionTasksEnabled enables the promotion task feature in the lifecycle-operator.
promotionTasksEnabled: false
## @param allowedNamespaces specifies the allowed namespaces for the lifecycle orchestration functionality
allowedNamespaces: []
## @param deniedNamespaces specifies a list of namespaces where the lifecycle orchestration functionality is disabled, ignored if `allowedNamespaces` is set
Expand Down
2 changes: 2 additions & 0 deletions lifecycle-operator/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ spec:
value: "0"
- name: SCHEDULING_GATES_ENABLED
value: "false"
- name: PROMOTION_TASKS_ENABLED
value: "false"
- name: CERT_MANAGER_ENABLED
value: "true"
securityContext:
Expand Down
1 change: 1 addition & 0 deletions lifecycle-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ type envConfig struct {
KeptnOptionsControllerLogLevel int `envconfig:"OPTIONS_CONTROLLER_LOG_LEVEL" default:"0"`

SchedulingGatesEnabled bool `envconfig:"SCHEDULING_GATES_ENABLED" default:"false"`
PromotionTasksEnabled bool `envconfig:"PROMOTION_TASKS_ENABLED" default:"false"`

CertManagerEnabled bool `envconfig:"CERT_MANAGER_ENABLED" default:"true"`
}
Expand Down

0 comments on commit 9fa19a0

Please sign in to comment.