From bc8a6a4ce7eb26b1720cd281486ce6a67ee40ac4 Mon Sep 17 00:00:00 2001 From: rameshiyer27 Date: Mon, 11 Mar 2024 17:18:11 +0000 Subject: [POLICY] Add kafka support in policy charts Added kafka support in all policy charts. Dmaap option is removed Issue-ID: POLICY-4941 Change-Id: I015d303c11c04a64d815fe2f054919eca2252250 Signed-off-by: rameshiyer27 --- .../resources/config/OnapPfConfig.json | 11 +---------- .../policy-apex-pdp/templates/deployment.yaml | 18 +----------------- .../policy-apex-pdp/templates/kafkauser.yaml | 3 +-- .../policy/components/policy-apex-pdp/values.yaml | 21 ++------------------- 4 files changed, 5 insertions(+), 48 deletions(-) (limited to 'kubernetes/policy/components/policy-apex-pdp') diff --git a/kubernetes/policy/components/policy-apex-pdp/resources/config/OnapPfConfig.json b/kubernetes/policy/components/policy-apex-pdp/resources/config/OnapPfConfig.json index 3a38b88d56..441955f1ed 100755 --- a/kubernetes/policy/components/policy-apex-pdp/resources/config/OnapPfConfig.json +++ b/kubernetes/policy/components/policy-apex-pdp/resources/config/OnapPfConfig.json @@ -30,23 +30,17 @@ "useHttps": false, "fetchTimeout": 15000, "servers": [ "${KAFKA_URL}" ], -{{ if .Values.global.useStrimziKafkaPf }} "topicCommInfrastructure": "kafka", "additionalProps": { "group.id" : "${GROUP_ID}", "security.protocol": "SASL_PLAINTEXT", "sasl.mechanism": "${SASL}", "sasl.jaas.config": "${JAASLOGIN}" - } -{{ else }} - "topicCommInfrastructure": "dmaap" -{{ end }} - }], + }}], "topicSinks" : [{ "topic": "${PAP_TOPIC}", "useHttps": false, "servers": [ "${KAFKA_URL}" ], -{{ if .Values.global.useStrimziKafkaPf }} "topicCommInfrastructure": "kafka", "additionalProps": { "group.id" : "${GROUP_ID}", @@ -54,9 +48,6 @@ "sasl.mechanism": "${SASL}", "sasl.jaas.config": "${JAASLOGIN}" } -{{ else }} - "topicCommInfrastructure": "dmaap" -{{ end }} }] } } diff --git a/kubernetes/policy/components/policy-apex-pdp/templates/deployment.yaml b/kubernetes/policy/components/policy-apex-pdp/templates/deployment.yaml index daed724cbd..5ba0d823f4 100755 --- a/kubernetes/policy/components/policy-apex-pdp/templates/deployment.yaml +++ b/kubernetes/policy/components/policy-apex-pdp/templates/deployment.yaml @@ -31,45 +31,29 @@ spec: metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: initContainers: -{{- if not .Values.global.useStrimziKafkaPf }} -{{ include "common.readinessCheck.waitFor" . | nindent 6 }} -{{- end }} - command: ["/bin/sh", "-cx"] -{{- if .Values.global.useStrimziKafkaPf }} args: - JAASLOGIN=`echo $JAASLOGIN | tr -d '"'`; cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done -{{ else }} - args: - - cd /config-input && for PFILE in `ls -1`; - do envsubst <${PFILE} >/config/${PFILE}; done -{{ end }} env: - name: RESTSERVER_USER {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 10 }} - name: RESTSERVER_PASSWORD {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "password") | indent 10 }} -{{- if .Values.global.useStrimziKafkaPf }} - name: JAASLOGIN valueFrom: secretKeyRef: name: {{ include "common.name" . }}-ku key: sasl.jaas.config - name: KAFKA_URL - value: {{ include "common.release" . }}-strimzi-kafka-bootstrap:9092 + value: {{ include "common.release" . }}-{{ .Values.global.kafkaBootstrap }} - name: SASL value: {{ .Values.kafkaUser.authenticationType | upper }} - name: GROUP_ID value: {{ .Values.config.kafka.consumer.groupId }} - name: PAP_TOPIC value: {{ .Values.config.app.listener.policyPdpPapTopic }} -{{ else }} - - name: KAFKA_URL - value: message-router - - name: PAP_TOPIC - value: {{ .Values.config.app.listener.policyPdpPapTopic | upper }} -{{- end }} volumeMounts: - mountPath: /config-input name: apexconfig-input diff --git a/kubernetes/policy/components/policy-apex-pdp/templates/kafkauser.yaml b/kubernetes/policy/components/policy-apex-pdp/templates/kafkauser.yaml index d2fab9f535..4259381afe 100644 --- a/kubernetes/policy/components/policy-apex-pdp/templates/kafkauser.yaml +++ b/kubernetes/policy/components/policy-apex-pdp/templates/kafkauser.yaml @@ -13,6 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. */}} -{{ if .Values.global.useStrimziKafkaPf }} {{ include "common.kafkauser" . }} -{{ end }} + diff --git a/kubernetes/policy/components/policy-apex-pdp/values.yaml b/kubernetes/policy/components/policy-apex-pdp/values.yaml index e01cb61176..3cea773d0f 100755 --- a/kubernetes/policy/components/policy-apex-pdp/values.yaml +++ b/kubernetes/policy/components/policy-apex-pdp/values.yaml @@ -25,7 +25,6 @@ global: nodePortPrefix: 302 persistence: {} - useStrimziKafkaPf: set-via-parent-chart-global-value ################################################################# # Secrets metaconfig @@ -93,7 +92,7 @@ ingress: serviceMesh: authorizationPolicy: authorizedPrincipals: - - serviceAccount: message-router-read + - serviceAccount: strimzi-kafka-read # Resource Limit flavor -By Default using small # Segregation for Different environment (Small and Large) @@ -145,25 +144,13 @@ metrics: # application configuration config: # Event consumption (kafka) properties - useStrimziKafkaPf: true - kafkaBootstrap: strimzi-kafka-bootstrap kafka: consumer: groupId: policy-apex app: listener: policyPdpPapTopic: policy-pdp-pap -# If targeting a custom kafka cluster, ie useStrimziKakfa: false -# uncomment below config and target your kafka bootstrap servers, -# along with any other security config. -# -# eventConsumption: -# spring.kafka.bootstrap-servers: :9092 -# spring.kafka.security.protocol: PLAINTEXT -# spring.kafka.consumer.group-id: policy-group -# -# Any new property can be added in the env by setting in overrides in the format mentioned below -# All the added properties must be in "key: value" format instead of yaml. + kafkaUser: authenticationType: scram-sha-512 acls: @@ -178,7 +165,3 @@ kafkaUser: type: topic patternType: prefix operations: [Create, Describe, Read, Write] - -readinessCheck: - wait_for: - - message-router -- cgit 1.2.3-korg