cp-helm-charts icon indicating copy to clipboard operation
cp-helm-charts copied to clipboard

Toggle enterprise features

Open redsk opened this issue 4 years ago • 16 comments

What changes were proposed in this pull request?

Add a variable to cp-kafka/values.yaml to enable or disable enterprise features. Currently this only means enabling or disabling the ConfluentMetricsReporter and some configuration for it. Doing this allows us to use open source Kafka docker image without changing anything in the chart.

Fixes #377

This PR is completely based on the work of @oscarh on #378 with just a small change to fulfill the request to disable the control center when enableEnterpriseFeatures=false: I simply flipped the order of

condition: cp-kafka.enableEnterpriseFeatures, cp-control-center.enabled

How was this patch tested?

helm template --set cp-kafka.enableEnterpriseFeatures=false . > ~/tmp/kafka_enterprise_disabled.yaml
helm template --set cp-kafka.enableEnterpriseFeatures=true . > ~/tmp/kafka_enterprise_enabled.yaml
diff -u ~/tmp/kafka_enterprise_{enabled,disabled}.yaml
--- /Users/niki/tmp/kafka_enterprise_enabled.yaml	2020-05-23 03:22:46.000000000 +0200
+++ /Users/niki/tmp/kafka_enterprise_disabled.yaml	2020-05-23 03:23:00.000000000 +0200
@@ -241,24 +241,6 @@
         replicaId: "$2"
         memberType: "$3"
 ---
-# Source: cp-helm-charts/charts/cp-control-center/templates/service.yaml
-apiVersion: v1
-kind: Service
-metadata:
-  name: RELEASE-NAME-cp-control-center
-  labels:
-    app: cp-control-center
-    chart: cp-control-center-0.1.0
-    release: RELEASE-NAME
-    heritage: Helm
-spec:
-  ports:
-    - name: cc-http
-      port: 9021
-  selector:
-    app: cp-control-center
-    release: RELEASE-NAME
----
 # Source: cp-helm-charts/charts/cp-kafka-connect/templates/service.yaml
 apiVersion: v1
 kind: Service
@@ -408,59 +390,6 @@
     app: cp-zookeeper
     release: RELEASE-NAME
 ---
-# Source: cp-helm-charts/charts/cp-control-center/templates/deployment.yaml
-apiVersion: apps/v1
-kind: Deployment
-metadata:
-  name: RELEASE-NAME-cp-control-center
-  labels:
-    app: cp-control-center
-    chart: cp-control-center-0.1.0
-    release: RELEASE-NAME
-    heritage: Helm
-spec:
-  replicas: 1
-  selector:
-    matchLabels:
-      app: cp-control-center
-      release: RELEASE-NAME
-  template:
-    metadata:
-      labels:
-        app: cp-control-center
-        release: RELEASE-NAME
-      annotations:
-        prometheus.io/scrape: "true"
-        prometheus.io/port: "5556"
-    spec:
-      containers:
-        - name: cp-control-center
-          image: "confluentinc/cp-enterprise-control-center:5.5.0"
-          imagePullPolicy: IfNotPresent
-          ports:
-            - name: cc-http
-              containerPort: 9021
-              protocol: TCP
-          resources:
-            {}
-          env:
-            - name: CONTROL_CENTER_BOOTSTRAP_SERVERS
-              value: PLAINTEXT://RELEASE-NAME-cp-kafka-headless:9092
-            - name: CONTROL_CENTER_ZOOKEEPER_CONNECT
-              value:
-            - name: CONTROL_CENTER_CONNECT_CLUSTER
-              value: http://RELEASE-NAME-cp-kafka-connect:8083
-            - name: CONTROL_CENTER_KSQL_URL
-              value: http://RELEASE-NAME-cp-ksql-server:8088
-            - name: CONTROL_CENTER_KSQL_ADVERTISED_URL
-              value: http://RELEASE-NAME-cp-ksql-server:8088
-            - name: CONTROL_CENTER_SCHEMA_REGISTRY_URL
-              value: http://RELEASE-NAME-cp-schema-registry:8081
-            - name: KAFKA_HEAP_OPTS
-              value: "-Xms512M -Xmx512M"
-            - name: "CONTROL_CENTER_REPLICATION_FACTOR"
-              value: "3"
----
 # Source: cp-helm-charts/charts/cp-kafka-connect/templates/deployment.yaml
 apiVersion: apps/v1
 kind: Deployment
@@ -896,10 +825,6 @@
           value: "RELEASE-NAME-cp-zookeeper-headless:2181"
         - name: KAFKA_LOG_DIRS
           value: "/opt/kafka/data-0/logs"
-        - name: KAFKA_METRIC_REPORTERS
-          value: "io.confluent.metrics.reporter.ConfluentMetricsReporter"
-        - name: CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS
-          value: "PLAINTEXT://RELEASE-NAME-cp-kafka-headless:9092"
         - name: "KAFKA_LISTENER_SECURITY_PROTOCOL_MAP"
           value: "PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT"
         - name: "KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR"

@gAmUssA can you take a look, please?

redsk avatar May 23 '20 01:05 redsk

Hey @redsk, thank you for your Pull Request.

It looks like you haven't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence. Wikipedia

You can read and sign our full Contributor License Agreement here.

Once you've signed reply with [clabot:check] to prove it.

Appreciation of efforts,

clabot

ghost avatar May 23 '20 01:05 ghost

[clabot:check]

redsk avatar May 23 '20 01:05 redsk

@confluentinc It looks like @redsk just signed our Contributor License Agreement. :+1:

Always at your service,

clabot

ghost avatar May 23 '20 01:05 ghost

Hi. Is this repo still maintained? It seems like this is a critical fix, no?

gjones-r7 avatar Oct 08 '20 05:10 gjones-r7

@redsk would you be able to address the requested changes so that we could move forward with that PR ? Let us know if you need anything! thanks!

scoquelin avatar Oct 15 '20 18:10 scoquelin

@redsk ping

gAmUssA avatar Dec 29 '20 03:12 gAmUssA

@redsk let me know if you want to finish this. otherwise, I will try to look at those changes and finish this PR. Let me know

gAmUssA avatar Mar 24 '21 16:03 gAmUssA

I have tested this on my side and solution working fine but it is not ended we need following addition changes: charts/cp-kafka/templates/statefulset.yaml: Change: image: "{{ .Values.image }}:{{ .Values.imageTag }}" To: {{ if .Values.image }} image: "{{ .Values.image }}:{{ .Values.imageTag }}" {{ else if .Values.enableEnterpriseFeatures }} image: "confluentinc/cp-enterprise-kafka:{{ .Values.imageTag }}" {{ else }} image: "confluentinc/cp-kafka:{{ .Values.imageTag }}" {{ end }} image then it will really set image based on enableEnterpriseFeatures property in values.yaml In addition we need some changed in values.yaml (both cp-helm-charts and cp-kafka): charts/cp-kafka/values.yaml: comment out this line: image: confluentinc/cp-enterprise-kafka image And in values.yaml: comment out this line: image: confluentinc/cp-enterprise-kafka image

Thanks for this PR.

rambai avatar Mar 25 '21 11:03 rambai

Sorry for the delay guys; I've been out of business for a while. Are these charts still relevant? Interested in finishing this PR?

redsk avatar Nov 04 '21 17:11 redsk

Rebased to current master

redsk avatar Nov 04 '21 18:11 redsk

@rambai Thanks for your suggestion, I've implemented it.

redsk avatar Nov 05 '21 12:11 redsk

Thank you very much!

rambai avatar Nov 11 '21 16:11 rambai

@gAmUssA Hi, is this PR still relevant to the project?

redsk avatar Nov 16 '21 15:11 redsk

@redsk this PR is very much relevant. However, I don't have merged permissions anymore for this project. Confluent were kind enough to move as a community project, https://github.com/confluent-helm-charts/cp-helm-charts. Could you kindly move this PR over there? I'm still trying to figure out how to move PRs and Issues to a new location.

gAmUssA avatar Nov 16 '21 16:11 gAmUssA

@gAmUssA Oh I see! Absolutely, I'll send you a PR there.

redsk avatar Nov 18 '21 14:11 redsk

@gAmUssA created PR on https://github.com/confluent-helm-charts/cp-helm-charts.

redsk avatar Nov 30 '21 14:11 redsk