File tree Expand file tree Collapse file tree 7 files changed +54
-25
lines changed Expand file tree Collapse file tree 7 files changed +54
-25
lines changed Original file line number Diff line number Diff line change 1+ apiVersion : platform.confluent.io/v1beta1
2+ kind : Kafka
3+ metadata :
4+ name : kafka
5+ spec :
6+ configOverrides :
7+ server :
8+ - confluent.schema.registry.url=https://schemaregistry:8081
9+ - listener.name.internal.plain.sasl.server.callback.handler.class=io.confluent.security.auth.provider.ldap.LdapAuthenticateCallbackHandler
10+ - listener.name.external.plain.sasl.server.callback.handler.class=io.confluent.security.auth.provider.ldap.LdapAuthenticateCallbackHandler
11+ - listener.name.replication.plain.sasl.server.callback.handler.class=io.confluent.security.auth.provider.ldap.LdapAuthenticateCallbackHandler
12+ - authorizer.class.name=io.confluent.kafka.security.authorizer.ConfluentServerAuthorizer
13+ - confluent.authorizer.access.rule.providers=ZK_ACL,CONFLUENT
14+ - quota.consumer.default = 1024
15+ - quota.producer.default = 1024
16+ - quota.window.num = 11
17+ - quota.window.size.seconds = 1
18+
19+
Original file line number Diff line number Diff line change @@ -4,4 +4,6 @@ namespace: sandbox
44resources :
55- namespace.yaml
66- ../../base/cfk-components/confluent-rbac
7-
7+ - quota-manager
8+ patchesStrategicMerge :
9+ - confluent/kafka.yaml
Original file line number Diff line number Diff line change 11#! /bin/bash
2-
32quota_definition=" /tmp/quota-definition/quotas.yaml"
4-
53for i in $( yq ' .platform.quotas | keys' < $quota_definition ) ; do
64 principal=" ${i: 0} "
75 if [[ " $principal " != " -" ]]; then
@@ -20,16 +18,25 @@ for i in $(yq '.platform.quotas | keys' < $quota_definition); do
2018 fi
2119 # Removes white space and the last trailing comma
2220 config=$( echo $config_string | tr -d " \t\n\r" | rev | cut -c 2- | rev)
23- set -x
2421 echo $config
25-
26- kafka-configs \
27- --bootstrap-server kafka:9071 \
28- --alter \
29- --entity-type users \
30- --entity-name $principal \
31- --command-config /tmp/config-properties/kafka.properties \
32- --add-config " $config "
22+ set -x
23+ if [[ " $principal " == " global" ]]; then
24+ kafka-configs \
25+ --bootstrap-server kafka:9071 \
26+ --alter \
27+ --entity-type users \
28+ --entity-default \
29+ --command-config /tmp/config-properties/kafka.properties \
30+ --add-config " $config "
31+ else
32+ kafka-configs \
33+ --bootstrap-server kafka:9071 \
34+ --alter \
35+ --entity-type users \
36+ --entity-name $principal \
37+ --command-config /tmp/config-properties/kafka.properties \
38+ --add-config " $config "
39+ fi
3340 set +x
3441 fi
3542done
File renamed without changes.
Original file line number Diff line number Diff line change 11---
22platform :
33 quotas :
4- app-0 :
4+ global :
55 producer_byte_rate : 1024
66 consumer_byte_rate : 1024
77 request_percentage : 50.0
8+ app-0 :
9+ producer_byte_rate : 4096
10+ consumer_byte_rate : 2048
11+ request_percentage : 50.0
812 app-2 :
913 producer_byte_rate : 2048
1014 consumer_byte_rate : 2048
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ resources:
44configMapGenerator :
55- name : oso-quota-example
66 files :
7- - ./definition /quotas.yaml
7+ - ./default /quotas.yaml
88- name : config-properties
99 files :
10- - ./definition /kafka.properties
10+ - ./default /kafka.properties
1111- name : apply-quota-script
1212 files :
13- - ./definition /apply-quotas-script.sh
13+ - ./default /apply-quotas-script.sh
1414generatorOptions :
1515 disableNameSuffixHash : true
Original file line number Diff line number Diff line change 11---
2- apiVersion : apps /v1
3- kind : StatefulSet
2+ apiVersion : batch /v1
3+ kind : Job
44metadata :
55 name : quota-manager
66 namespace : sandbox
77spec :
8- serviceName : quota-manager
9- podManagementPolicy : OrderedReady
10- replicas : 1
11- selector :
12- matchLabels :
13- app : quota-manager
8+
149 template :
1510 metadata :
1611 labels :
1712 app : quota-manager
1813 spec :
14+ restartPolicy : OnFailure
1915 containers :
2016 - name : quota-manager
2117 image : quota-manager:latest
2218 imagePullPolicy : Never
2319 command :
20+ - /tmp/quotas/apply-quotas-script.sh
2421# - "sleep"
2522# - "10000000"
26- - /tmp/quotas/apply-quotas-script.sh
23+
2724 resources :
2825 requests :
2926 memory : 512Mi # 768Mi
You can’t perform that action at this time.
0 commit comments