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(lifecycle-operator): add feature flag for enabling promotion tasks #3055

Merged
merged 2 commits into from
Feb 15, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -11425,6 +11425,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 @@ -8834,6 +8834,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
Original file line number Diff line number Diff line change
Expand Up @@ -9148,6 +9148,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
Loading