Open abdul-jabbar01 opened 1 year ago
Hi @abdul-jabbar01
I used terraform helm_resource and depends_on
where first one is Keda helm charts, and second is only a TriggerAuthentication
definition.
resource "helm_release" "keda" {
name = "keda"
repository = "https://kedacore.github.io/charts"
chart = "keda"
version = var.keda_version
namespace = var.namespace
wait = true
}
And i created a custom helm chart with only datadog-auth definition:
resource "helm_release" "trigger_authentication" {
depends_on = [helm_release.keda, kubernetes_secret.datadog]
name = "datadog-auth"
namespace = var.namespace
chart = "${path.module}/extras/datadog-auth"
values = [
yamlencode({
namespace = var.namespace
secret_name = local.secret_name
})
]
}
Module has this structure:
├── README.md
├── data.tf
├── extras
│ └── datadog-auth
│ ├── Chart.yaml
│ ├── templates
│ │ └── trigger-auth.yaml
│ └── values.yaml
├── irsa.tf
├── kubernetes.tf
├── locals.tf
├── main.tf
└── variables.tf
And this custom chart template looks like that:
---
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: {{ .Chart.Name }}
namespace: {{ .Values.namespace }}
spec:
secretTargetRef:
- parameter: apiKey
name: {{ .Values.secret_name }}
key: api-key
- parameter: appKey
name: {{ .Values.secret_name }}
key: app-key
- parameter: datadogSite
name: {{ .Values.secret_name }}
key: dd-site
Of course it's not a solution to initial problem mentioned by @pierluigilenoci , but it will allow you to install everything in one run with ci/cd tools.
If I am referring
ClusterTriggerAuthentication
withextraObjects
, it gives following errorIt works with following workaround:
extraObjects
extraObjects
and then helm upgradeBut this is not the ideal workaround. It makes automation difficult (installing via pipelines)
Expected Behavior
It should first install CRDs and then run
99-extra-manifests.yaml
forextraObjects
Actual Behavior
It is installing
extraObjects
first before installing CRDsSteps to Reproduce the Problem
keda/values.yaml
to include followinghelm upgrade --install keda kedacore/keda -f values.yaml --namespace keda
Specifications