From 4a91cc91bfe86b33c22a5548b56760b014d45f9a Mon Sep 17 00:00:00 2001 From: Krishanx92 Date: Thu, 4 Apr 2024 17:52:19 +0530 Subject: [PATCH 1/3] Common place for cp related config in helm template --- helm-charts/README.md | 12 +++---- helm-charts/in-place-upgrade-values.yaml | 11 ++++--- helm-charts/sample/apk/cp-enabled-values.yaml | 8 ++--- helm-charts/sample/apk/values.yaml | 12 +++---- .../adapter-server-certificate.yaml | 2 +- .../common-controller-server-certificate.yaml | 2 +- .../enforcer-server-certificate.yaml | 2 +- .../gateway-server-certificate.yaml | 2 +- .../webhook-server-certificate.yaml | 2 +- .../adapter/adapter-deployment.yaml | 2 +- .../adapter-grpc-probe-script-conf.yaml | 2 +- .../adapter/adapter-service.yaml | 2 +- .../adapter-truststore-consul-secret.yaml | 2 +- .../adapter/gateway-class.yaml | 3 +- .../gateway-components/adapter/gateway.yaml | 4 +-- .../common-controller-deployment.yaml | 2 +- ...mon-controller-grpc-probe-script-conf.yaml | 2 +- .../common-controller-service.yaml | 2 +- ...common-controller-sts-shared-auth-key.yaml | 4 +-- .../common-controller-web-server-service.yaml | 2 +- .../gateway-components/common-log-conf.yaml | 16 +++++----- .../gateway-runtime/default-jwt-issuer.yaml | 2 +- .../enforcer-grpc-probe-script-conf.yaml | 2 +- .../enforcer-keystore-secret.yaml | 2 +- .../enforcer-truststore-secret.yaml | 2 +- .../gateway-runtime-autoscaller.yaml | 2 +- .../gateway-runtime-deployment.yaml | 2 +- .../gateway-runtime/gateway-service.yaml | 2 +- .../gateway-runtime/idp-jwt-issuer.yaml | 2 +- .../gateway-components/log-conf.yaml | 6 ++-- helm-charts/values.yaml | 11 ++++--- helm-charts/values.yaml.template | 32 +++++++------------ 32 files changed, 74 insertions(+), 87 deletions(-) diff --git a/helm-charts/README.md b/helm-charts/README.md index 0c0088342..d9a388635 100644 --- a/helm-charts/README.md +++ b/helm-charts/README.md @@ -39,6 +39,11 @@ A Helm chart for APK components | wso2.apk.idp.signing.configMapName | string | `""` | IDP jwt signing certificate configmap name | | wso2.apk.idp.signing.secretName | string | `""` | IDP jwt signing certificate secret name | | wso2.apk.idp.signing.fileName | string | `""` | IDP jwt signing certificate file name | +| wso2.apk.cp.controlplane.enableApiPropagation | bool | `false` | Enable controlplane connection | +| wso2.apk.cp.controlplane.enabledSubscription | bool | `false` | Enable controlplane connection | +| wso2.apk.cp.controlplane.host | string | `"apim-apk-agent-service.apk.svc.cluster.local"` | Hostname of the APK agent service | +| wso2.apk.cp.controlplane.skipSSLVerification | bool | `false` | Skip SSL verification | +| wso2.apk.cp.controlplane.persistence | object | `{"type":"K8s"}` | Provide persistence mode DB/K8s | | wso2.apk.dp.enabled | bool | `true` | Enable the deployment of the Data Plane | | wso2.apk.dp.environment.name | string | `"Development"` | Environment Name of the Data Plane | | wso2.apk.dp.gatewayClass | object | `{"name":"wso2-apk-default"}` | GatewayClass custom resource name | @@ -134,13 +139,6 @@ A Helm chart for APK components | wso2.apk.dp.commonController.deployment.redis.userKeyPath | string | `"/home/wso2/security/keystore/commoncontroller.key"` | Redis user key to use for redis connections | | wso2.apk.dp.commonController.deployment.redis.cACertPath | string | `"/home/wso2/security/keystore/commoncontroller.crt"` | Redis CA cert to use for redis connections | | wso2.apk.dp.commonController.deployment.redis.channelName | string | `"wso2-apk-revoked-tokens-channel"` | Token revocation subscription channel name | -| wso2.apk.dp.commonController.deployment.controlplane.enabled | bool | `false` | Enable controlplane connection | -| wso2.apk.dp.commonController.deployment.controlplane.host | string | `"apim-apk-agent-service.apk.svc.cluster.local"` | Hostname of the APK agent service | -| wso2.apk.dp.commonController.deployment.controlplane.eventPort | int | `18000` | Port of the APK agent service for events | -| wso2.apk.dp.commonController.deployment.controlplane.skipSSLVerification | bool | `false` | Skip SSL verification | -| wso2.apk.dp.commonController.deployment.controlplane.persistence | object | `{"type":"K8s"}` | Provide persistence mode DB/K8s | -| wso2.apk.dp.commonController.deployment.database.enabled | bool | `false` | Enable Database mode for persistence | -| wso2.apk.dp.commonController.deployment.database.name | string | `"DATAPLANE"` | name of the database containing controlplane data for the use of dataplane | | wso2.apk.dp.commonController.deployment.database.host | string | `"wso2apk-db-service.apk"` | | | wso2.apk.dp.commonController.deployment.database.port | int | `5432` | | | wso2.apk.dp.commonController.deployment.database.username | string | `"wso2carbon"` | | diff --git a/helm-charts/in-place-upgrade-values.yaml b/helm-charts/in-place-upgrade-values.yaml index 62afed313..88c9e3b57 100644 --- a/helm-charts/in-place-upgrade-values.yaml +++ b/helm-charts/in-place-upgrade-values.yaml @@ -46,6 +46,13 @@ wso2: # jwksEndpoint: "https://idp.am.wso2.com:9095/oauth2/jwks" # secretName: "wso2apk-idp-signing" # fileName: "idp.crt" + # cp: + # enableApiPropagation: false + # enabledSubscription: false + # host: "apim-apk-agent-service.apk.svc.cluster.local" + # skipSSLVerification: false + # persistence: + # type: "K8s" dp: enabled: true gateway: @@ -149,10 +156,6 @@ wso2: image: wso2/apk-common-controller:latest security: sslHostname: "commoncontroller" -# controlplane: -# enabled: true -# host: "apim-apk-agent-service.apk.svc.cluster.local" -# skipSSLVerification: true # configs: # apiNamespaces: # - "apk-v12" diff --git a/helm-charts/sample/apk/cp-enabled-values.yaml b/helm-charts/sample/apk/cp-enabled-values.yaml index 8e2eff8c5..c6787d68a 100644 --- a/helm-charts/sample/apk/cp-enabled-values.yaml +++ b/helm-charts/sample/apk/cp-enabled-values.yaml @@ -46,6 +46,10 @@ wso2: # jwksEndpoint: "https://idp.am.wso2.com:9095/oauth2/jwks" # secretName: "wso2apk-idp-signing" # fileName: "idp.crt" + cp: + enabledSubscription: true + host: "apim-apk-agent-service.apk.svc.cluster.local" + skipSSLVerification: false dp: enabled: true gateway: @@ -147,10 +151,6 @@ wso2: image: wso2/apk-common-controller:1.1.0-beta security: sslHostname: "commoncontroller" - controlplane: - enabled: true - host: "apim-apk-agent-service.apk.svc.cluster.local" - skipSSLVerification: true # configs: # apiNamespaces: # - "apk-v12" diff --git a/helm-charts/sample/apk/values.yaml b/helm-charts/sample/apk/values.yaml index a2a5f8a1c..089db4f14 100644 --- a/helm-charts/sample/apk/values.yaml +++ b/helm-charts/sample/apk/values.yaml @@ -47,10 +47,10 @@ wso2: # secretName: "wso2apk-idp-signing" # fileName: "idp.crt" cp: - controlplane: - enableApiPropagation: true - host: "apim-apk-agent-service.apk.svc.cluster.local" - skipSSLVerification: true + enableApiPropagation: true + enabledSubscription: true + host: "apim-apk-agent-service.apk.svc.cluster.local" + skipSSLVerification: true dp: enabled: true gateway: @@ -152,10 +152,6 @@ wso2: image: wso2/apk-common-controller:1.1.0-beta security: sslHostname: "commoncontroller" - controlplane: - enabled: true - host: "apim-apk-agent-service.apk.svc.cluster.local" - skipSSLVerification: true # configs: # apiNamespaces: # - "apk-v12" diff --git a/helm-charts/templates/cert-manager/certificates/adapter-server-certificate.yaml b/helm-charts/templates/cert-manager/certificates/adapter-server-certificate.yaml index 264fbf7bd..b8fb48fa5 100644 --- a/helm-charts/templates/cert-manager/certificates/adapter-server-certificate.yaml +++ b/helm-charts/templates/cert-manager/certificates/adapter-server-certificate.yaml @@ -17,7 +17,7 @@ # The following manifests contain a self-signed issuer CR and a certificate CR. # More document can be found at https://docs.cert-manager.io -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: cert-manager.io/v1 kind: Certificate metadata: diff --git a/helm-charts/templates/cert-manager/certificates/common-controller-server-certificate.yaml b/helm-charts/templates/cert-manager/certificates/common-controller-server-certificate.yaml index 3fe1cc388..4e3460eb7 100644 --- a/helm-charts/templates/cert-manager/certificates/common-controller-server-certificate.yaml +++ b/helm-charts/templates/cert-manager/certificates/common-controller-server-certificate.yaml @@ -17,7 +17,7 @@ # The following manifests contain a self-signed issuer CR and a certificate CR. # More document can be found at https://docs.cert-manager.io -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: cert-manager.io/v1 kind: Certificate metadata: diff --git a/helm-charts/templates/cert-manager/certificates/enforcer-server-certificate.yaml b/helm-charts/templates/cert-manager/certificates/enforcer-server-certificate.yaml index 92887d659..df2d9b990 100644 --- a/helm-charts/templates/cert-manager/certificates/enforcer-server-certificate.yaml +++ b/helm-charts/templates/cert-manager/certificates/enforcer-server-certificate.yaml @@ -17,7 +17,7 @@ # The following manifests contain a self-signed issuer CR and a certificate CR. # More document can be found at https://docs.cert-manager.io -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: cert-manager.io/v1 kind: Certificate metadata: diff --git a/helm-charts/templates/cert-manager/certificates/gateway-server-certificate.yaml b/helm-charts/templates/cert-manager/certificates/gateway-server-certificate.yaml index 3171c1ce8..a1f54ddf0 100644 --- a/helm-charts/templates/cert-manager/certificates/gateway-server-certificate.yaml +++ b/helm-charts/templates/cert-manager/certificates/gateway-server-certificate.yaml @@ -17,7 +17,7 @@ # The following manifests contain a self-signed issuer CR and a certificate CR. # More document can be found at https://docs.cert-manager.io -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: cert-manager.io/v1 kind: Certificate metadata: diff --git a/helm-charts/templates/cert-manager/certificates/webhook-server-certificate.yaml b/helm-charts/templates/cert-manager/certificates/webhook-server-certificate.yaml index 63da23056..f6ddf4143 100644 --- a/helm-charts/templates/cert-manager/certificates/webhook-server-certificate.yaml +++ b/helm-charts/templates/cert-manager/certificates/webhook-server-certificate.yaml @@ -17,7 +17,7 @@ # The following manifests contain a self-signed issuer CR and a certificate CR. # More document can be found at https://docs.cert-manager.io -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: cert-manager.io/v1 kind: Certificate metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/adapter/adapter-deployment.yaml b/helm-charts/templates/data-plane/gateway-components/adapter/adapter-deployment.yaml index e002369ef..93eb9e18b 100644 --- a/helm-charts/templates/data-plane/gateway-components/adapter/adapter-deployment.yaml +++ b/helm-charts/templates/data-plane/gateway-components/adapter/adapter-deployment.yaml @@ -14,7 +14,7 @@ # specific language governing permissions and limitations # under the License. -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/adapter/adapter-grpc-probe-script-conf.yaml b/helm-charts/templates/data-plane/gateway-components/adapter/adapter-grpc-probe-script-conf.yaml index 8340cfea9..9d1d9bde9 100644 --- a/helm-charts/templates/data-plane/gateway-components/adapter/adapter-grpc-probe-script-conf.yaml +++ b/helm-charts/templates/data-plane/gateway-components/adapter/adapter-grpc-probe-script-conf.yaml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ----------------------------------------------------------------------- -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: ConfigMap metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/adapter/adapter-service.yaml b/helm-charts/templates/data-plane/gateway-components/adapter/adapter-service.yaml index 8c78ff45c..a1c323b90 100644 --- a/helm-charts/templates/data-plane/gateway-components/adapter/adapter-service.yaml +++ b/helm-charts/templates/data-plane/gateway-components/adapter/adapter-service.yaml @@ -14,7 +14,7 @@ # specific language governing permissions and limitations # under the License. -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: Service metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/adapter/adapter-truststore-consul-secret.yaml b/helm-charts/templates/data-plane/gateway-components/adapter/adapter-truststore-consul-secret.yaml index 625c01d4b..c82b8788c 100644 --- a/helm-charts/templates/data-plane/gateway-components/adapter/adapter-truststore-consul-secret.yaml +++ b/helm-charts/templates/data-plane/gateway-components/adapter/adapter-truststore-consul-secret.yaml @@ -1,4 +1,4 @@ -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: Secret metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/adapter/gateway-class.yaml b/helm-charts/templates/data-plane/gateway-components/adapter/gateway-class.yaml index 0936685dc..a326c1f4f 100644 --- a/helm-charts/templates/data-plane/gateway-components/adapter/gateway-class.yaml +++ b/helm-charts/templates/data-plane/gateway-components/adapter/gateway-class.yaml @@ -1,4 +1,3 @@ -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} # Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. # # WSO2 LLC. licenses this file to you under the Apache License, @@ -14,7 +13,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. - +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: gateway.networking.k8s.io/v1 kind: GatewayClass metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/adapter/gateway.yaml b/helm-charts/templates/data-plane/gateway-components/adapter/gateway.yaml index f90068d11..eab8debfc 100644 --- a/helm-charts/templates/data-plane/gateway-components/adapter/gateway.yaml +++ b/helm-charts/templates/data-plane/gateway-components/adapter/gateway.yaml @@ -1,4 +1,4 @@ -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: @@ -19,7 +19,7 @@ spec: port: {{ .Values.wso2.apk.dp.gateway.httpListener.port | default 9080}} protocol: HTTP {{ end }} - {{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} + {{- if .Values.wso2.apk.dp.enabled }} - name: httpslistener hostname: "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" port: 9095 diff --git a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-deployment.yaml b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-deployment.yaml index 3da01567b..6e0ef38f0 100644 --- a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-deployment.yaml +++ b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-deployment.yaml @@ -14,7 +14,7 @@ # specific language governing permissions and limitations # under the License. -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-grpc-probe-script-conf.yaml b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-grpc-probe-script-conf.yaml index 19003ad55..034c5fc51 100644 --- a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-grpc-probe-script-conf.yaml +++ b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-grpc-probe-script-conf.yaml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ----------------------------------------------------------------------- -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: ConfigMap metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-service.yaml b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-service.yaml index e5adf645f..c588fed09 100644 --- a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-service.yaml +++ b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-service.yaml @@ -14,7 +14,7 @@ # specific language governing permissions and limitations # under the License. -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: Service metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-sts-shared-auth-key.yaml b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-sts-shared-auth-key.yaml index 3a2cb0912..b1acab17b 100644 --- a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-sts-shared-auth-key.yaml +++ b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-sts-shared-auth-key.yaml @@ -1,5 +1,3 @@ -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} - # Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. # # WSO2 LLC. licenses this file to you under the Apache License, @@ -15,7 +13,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. - +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 data: auth_key.txt: MmpybXlwYWszOTF6c3F6OTc0dWdkZGRlYmY4MTJvZngxYjl0MW9xMjc1MzBpcjAydGM4MTVlZW1yeDQzNXF2Y3A0MXVjZ3k3djV1dWF3emk0cWNtanJ4MGsxemdveDJzMjhjcg== diff --git a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-web-server-service.yaml b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-web-server-service.yaml index a51c9d238..4d3e6c74a 100644 --- a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-web-server-service.yaml +++ b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-web-server-service.yaml @@ -14,7 +14,7 @@ # specific language governing permissions and limitations # under the License. -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: Service metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml b/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml index cbaf50a9f..7724bd2c9 100644 --- a/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml +++ b/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml @@ -1,4 +1,4 @@ -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: ConfigMap metadata: @@ -29,15 +29,15 @@ data: [commoncontroller.truststore] location = "/home/wso2/security/truststore" - {{- if .Values.wso2.apk.dp.commonController.deployment.controlplane }} + {{- if and .Values.wso2.apk.cp .Values.wso2.apk.cp.controlplane }} [commoncontroller.controlplane] - enabled = {{ .Values.wso2.apk.dp.commonController.deployment.controlplane.enabled | default false }} - host = "{{ .Values.wso2.apk.dp.commonController.deployment.controlplane.host | default "apim-apk-agent-service.apk.svc.cluster.local" }}" - eventPort = {{ .Values.wso2.apk.dp.commonController.deployment.controlplane.port | default 18000 }} - skipSSLVerification = {{ .Values.wso2.apk.dp.commonController.deployment.controlplane.skipSSLVerification | default false }} - {{- if .Values.wso2.apk.dp.commonController.deployment.controlplane.persistence }} + enabled = {{ .Values.wso2.apk.cp.controlplane.enabledSubscription | default false }} + host = "{{ .Values.wso2.apk.cp.controlplane.host | default "apim-apk-agent-service.apk.svc.cluster.local" }}" + eventPort = 18000 + skipSSLVerification = {{ .Values.wso2.apk.cp.controlplane.skipSSLVerification | default false }} + {{- if and .Values.wso2.apk.cp .Values.wso2.apk.cp.controlplane.persistence }} [commoncontroller.controlplane.persistence] - type = "{{ .Values.wso2.apk.dp.commonController.deployment.controlplane.persistence.type | default "K8s" }}" + type = "{{ .Values.wso2.apk.cp.controlplane.persistence.type | default "K8s" }}" {{- end }} {{- end }} diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/default-jwt-issuer.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/default-jwt-issuer.yaml index 48cf13873..ac84089f5 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/default-jwt-issuer.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/default-jwt-issuer.yaml @@ -1,4 +1,4 @@ -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} kind: TokenIssuer apiVersion: dp.wso2.com/v1alpha1 metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-grpc-probe-script-conf.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-grpc-probe-script-conf.yaml index 499a2beb8..c5c5710ca 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-grpc-probe-script-conf.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-grpc-probe-script-conf.yaml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ----------------------------------------------------------------------- -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: ConfigMap diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-keystore-secret.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-keystore-secret.yaml index 48187e37e..f042677f7 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-keystore-secret.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-keystore-secret.yaml @@ -1,4 +1,4 @@ -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: Secret metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-truststore-secret.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-truststore-secret.yaml index 200c9bb2b..e518bcf65 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-truststore-secret.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/enforcer-truststore-secret.yaml @@ -1,4 +1,4 @@ -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: Secret metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-autoscaller.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-autoscaller.yaml index 54840b132..b9a5a8c59 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-autoscaller.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-autoscaller.yaml @@ -14,7 +14,7 @@ # limitations under the License. # ----------------------------------------------------------------------- -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled}} +{{- if .Values.wso2.apk.dp.enabled }} {{- if and .Values.wso2.apk.dp.gateway.autoscaling .Values.wso2.apk.dp.gateway.autoscaling.enabled -}} apiVersion: autoscaling/v2 diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml index 257dc0475..b0d8ed0b2 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml @@ -14,7 +14,7 @@ # specific language governing permissions and limitations # under the License. -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-service.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-service.yaml index dca2ff7ed..1a1ef3f93 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-service.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-service.yaml @@ -14,7 +14,7 @@ # specific language governing permissions and limitations # under the License. -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: Service metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/idp-jwt-issuer.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/idp-jwt-issuer.yaml index 7bb1559ce..6cf9cbce1 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/idp-jwt-issuer.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/idp-jwt-issuer.yaml @@ -1,4 +1,4 @@ -{{ if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} kind: TokenIssuer apiVersion: dp.wso2.com/v1alpha1 metadata: diff --git a/helm-charts/templates/data-plane/gateway-components/log-conf.yaml b/helm-charts/templates/data-plane/gateway-components/log-conf.yaml index 6307f4d4f..eefc47590 100644 --- a/helm-charts/templates/data-plane/gateway-components/log-conf.yaml +++ b/helm-charts/templates/data-plane/gateway-components/log-conf.yaml @@ -1,4 +1,4 @@ -{{- if or .Values.wso2.apk.dp.enabled .Values.wso2.apk.cp.enabled }} +{{- if .Values.wso2.apk.dp.enabled }} apiVersion: v1 kind: ConfigMap metadata: @@ -25,8 +25,8 @@ data: [adapter.controlplane] enableAPIPropagation = {{ .Values.wso2.apk.cp.controlplane.enableApiPropagation | default false }} host = "{{ .Values.wso2.apk.cp.controlplane.host | default "apim-apk-agent-service.apk.svc.cluster.local" }}" - eventPort = {{ .Values.wso2.apk.cp.controlplane.port | default 18000 }} - restPort = {{ .Values.wso2.apk.cp.controlplane.restPort | default 18001 }} + eventPort = 18000 + restPort = 18001 skipSSLVerification = {{ .Values.wso2.apk.cp.controlplane.skipSSLVerification | default false }} {{- end }} diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml index 908dc6274..498a21137 100644 --- a/helm-charts/values.yaml +++ b/helm-charts/values.yaml @@ -47,6 +47,13 @@ wso2: # jwksEndpoint: "https://idp.am.wso2.com:9095/oauth2/jwks" # secretName: "wso2apk-idp-signing" # fileName: "idp.crt" + # cp: + # enableApiPropagation: false + # enabledSubscription: false + # host: "apim-apk-agent-service.apk.svc.cluster.local" + # skipSSLVerification: false + # persistence: + # type: "K8s" dp: enabled: true gateway: @@ -148,10 +155,6 @@ wso2: image: wso2/apk-common-controller:1.1.0-beta security: sslHostname: "commoncontroller" -# controlplane: -# enabled: true -# host: "apim-apk-agent-service.apk.svc.cluster.local" -# skipSSLVerification: true # configs: # apiNamespaces: # - "apk-v12" diff --git a/helm-charts/values.yaml.template b/helm-charts/values.yaml.template index 9a57fd8be..1a8a61fb6 100644 --- a/helm-charts/values.yaml.template +++ b/helm-charts/values.yaml.template @@ -70,15 +70,17 @@ wso2: # -- IDP jwt signing certificate file name fileName: "" cp: - controlplane: - # -- Enable controlplane connection - enableApiPropagation: false - # -- Hostname of the APK agent service - host: "apim-apk-agent-service.apk.svc.cluster.local" - # -- Port of the APK agent service for events - restPort: 18001 - # -- Skip SSL verification - skipSSLVerification: false + # -- Enable controlplane connection + enableApiPropagation: false + # -- Enable controlplane connection for subscription + enabledSubscription: false + # -- Hostname of the APK agent service + host: "apim-apk-agent-service.apk.svc.cluster.local" + # -- Skip SSL verification + skipSSLVerification: false + # -- Provide persistence mode DB/K8s + persistence: + type: "K8s" dp: # -- Enable the deployment of the Data Plane enabled: true @@ -320,18 +322,6 @@ wso2: cACertPath: "/home/wso2/security/keystore/commoncontroller.crt" # -- Token revocation subscription channel name channelName: "wso2-apk-revoked-tokens-channel" - controlplane: - # -- Enable controlplane connection - enabled: false - # -- Hostname of the APK agent service - host: "apim-apk-agent-service.apk.svc.cluster.local" - # -- Port of the APK agent service for events - eventPort: 18000 - # -- Skip SSL verification - skipSSLVerification: false - # -- Provide persistence mode DB/K8s - persistence: - type: "K8s" database: # -- Enable Database mode for persistence enabled: false From c4c1662f199a2f22bc64d9e8b9bad9d3b7621c9a Mon Sep 17 00:00:00 2001 From: Krishanx92 Date: Thu, 4 Apr 2024 17:57:43 +0530 Subject: [PATCH 2/3] Add missing config --- .../gateway-components/common-log-conf.yaml | 12 ++++++------ .../data-plane/gateway-components/log-conf.yaml | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml b/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml index 7724bd2c9..072da51bf 100644 --- a/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml +++ b/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml @@ -29,15 +29,15 @@ data: [commoncontroller.truststore] location = "/home/wso2/security/truststore" - {{- if and .Values.wso2.apk.cp .Values.wso2.apk.cp.controlplane }} + {{- if .Values.wso2.apk.cp }} [commoncontroller.controlplane] - enabled = {{ .Values.wso2.apk.cp.controlplane.enabledSubscription | default false }} - host = "{{ .Values.wso2.apk.cp.controlplane.host | default "apim-apk-agent-service.apk.svc.cluster.local" }}" + enabled = {{ .Values.wso2.apk.cp.enabledSubscription | default false }} + host = "{{ .Values.wso2.apk.cp.host | default "apim-apk-agent-service.apk.svc.cluster.local" }}" eventPort = 18000 - skipSSLVerification = {{ .Values.wso2.apk.cp.controlplane.skipSSLVerification | default false }} - {{- if and .Values.wso2.apk.cp .Values.wso2.apk.cp.controlplane.persistence }} + skipSSLVerification = {{ .Values.wso2.apk.cp.skipSSLVerification | default false }} + {{- if and .Values.wso2.apk.cp .Values.wso2.apk.cp.persistence }} [commoncontroller.controlplane.persistence] - type = "{{ .Values.wso2.apk.cp.controlplane.persistence.type | default "K8s" }}" + type = "{{ .Values.wso2.apk.cp.persistence.type | default "K8s" }}" {{- end }} {{- end }} diff --git a/helm-charts/templates/data-plane/gateway-components/log-conf.yaml b/helm-charts/templates/data-plane/gateway-components/log-conf.yaml index eefc47590..6cfb49e91 100644 --- a/helm-charts/templates/data-plane/gateway-components/log-conf.yaml +++ b/helm-charts/templates/data-plane/gateway-components/log-conf.yaml @@ -21,13 +21,13 @@ data: port = 18006 {{ end}} - {{- if and .Values.wso2.apk.cp .Values.wso2.apk.cp.controlplane }} + {{- if .Values.wso2.apk.cp }} [adapter.controlplane] - enableAPIPropagation = {{ .Values.wso2.apk.cp.controlplane.enableApiPropagation | default false }} - host = "{{ .Values.wso2.apk.cp.controlplane.host | default "apim-apk-agent-service.apk.svc.cluster.local" }}" + enableAPIPropagation = {{ .Values.wso2.apk.cp.enableApiPropagation | default false }} + host = "{{ .Values.wso2.apk.cp.host | default "apim-apk-agent-service.apk.svc.cluster.local" }}" eventPort = 18000 restPort = 18001 - skipSSLVerification = {{ .Values.wso2.apk.cp.controlplane.skipSSLVerification | default false }} + skipSSLVerification = {{ .Values.wso2.apk.cp.skipSSLVerification | default false }} {{- end }} {{ if and .Values.wso2.apk.dp.gatewayRuntime.deployment .Values.wso2.apk.dp.gatewayRuntime.deployment.router .Values.wso2.apk.dp.gatewayRuntime.deployment.router.configs }} From 08ee89ee4197e3e4c4f39441bed0a789bb49099d Mon Sep 17 00:00:00 2001 From: Krishanx92 Date: Thu, 4 Apr 2024 17:58:48 +0530 Subject: [PATCH 3/3] Add missing config --- helm-charts/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helm-charts/README.md b/helm-charts/README.md index d9a388635..ca9c03968 100644 --- a/helm-charts/README.md +++ b/helm-charts/README.md @@ -39,11 +39,11 @@ A Helm chart for APK components | wso2.apk.idp.signing.configMapName | string | `""` | IDP jwt signing certificate configmap name | | wso2.apk.idp.signing.secretName | string | `""` | IDP jwt signing certificate secret name | | wso2.apk.idp.signing.fileName | string | `""` | IDP jwt signing certificate file name | -| wso2.apk.cp.controlplane.enableApiPropagation | bool | `false` | Enable controlplane connection | -| wso2.apk.cp.controlplane.enabledSubscription | bool | `false` | Enable controlplane connection | -| wso2.apk.cp.controlplane.host | string | `"apim-apk-agent-service.apk.svc.cluster.local"` | Hostname of the APK agent service | -| wso2.apk.cp.controlplane.skipSSLVerification | bool | `false` | Skip SSL verification | -| wso2.apk.cp.controlplane.persistence | object | `{"type":"K8s"}` | Provide persistence mode DB/K8s | +| wso2.apk.cp.enableApiPropagation | bool | `false` | Enable controlplane connection | +| wso2.apk.cp.enabledSubscription | bool | `false` | Enable controlplane connection | +| wso2.apk.cp.host | string | `"apim-apk-agent-service.apk.svc.cluster.local"` | Hostname of the APK agent service | +| wso2.apk.cp.skipSSLVerification | bool | `false` | Skip SSL verification | +| wso2.apk.cp.persistence | object | `{"type":"K8s"}` | Provide persistence mode DB/K8s | | wso2.apk.dp.enabled | bool | `true` | Enable the deployment of the Data Plane | | wso2.apk.dp.environment.name | string | `"Development"` | Environment Name of the Data Plane | | wso2.apk.dp.gatewayClass | object | `{"name":"wso2-apk-default"}` | GatewayClass custom resource name |