如何为CFK Kafka连接资源设置PDB(Pod Disruption Budget)。

huangapple go评论96阅读模式
英文:

How can i set PDB (Pod Disruption Budget) for CFK Kafka connect resource

问题

I am using confluent cloud and then have Connect cluster using CFK

https://github.com/confluentinc/confluent-kubernetes-examples/tree/master/hybrid/ccloud-integration

Its all working fine but i am not sure how can i set PDB as i have 8 replicas and i use karpenetr to scale nodes. I have to setup PDB to make sure atleast 7 replicas run at all times

  1. ---
  2. apiVersion: platform.confluent.io/v1beta1
  3. kind: Connect
  4. metadata:
  5. name: connect
  6. namespace: confluent
  7. spec:
  8. replicas: 1
  9. image:
  10. application: confluentinc/cp-server-connect:7.4.0
  11. init: confluentinc/confluent-init-container:2.6.0
  12. tls:
  13. autoGeneratedCerts: true
  14. mountedSecrets:
  15. - secretRef: kafka-client-config-secure
  16. dependencies:
  17. kafka:
  18. bootstrapEndpoint: <cloudKafka_url>:9092
  19. authentication:
  20. type: plain
  21. jaasConfig:
  22. secretRef: cloud-plain
  23. tls:
  24. enabled: true
  25. ignoreTrustStoreConfig: true
  26. schemaRegistry:
  27. url: https://<cloudSR_url>
  28. authentication:
  29. type: basic
  30. basic:
  31. secretRef: cloud-sr-access
  32. ---
英文:

I am using confluent cloud and then have Connect cluster using CFK

https://github.com/confluentinc/confluent-kubernetes-examples/tree/master/hybrid/ccloud-integration

Its all working fine but i am not sure how can i set PDB as i have 8 replicas and i use karpenetr to scale nodes. I have to setup PDB to make sure atleast 7 replicas run at all times

  1. ---
  2. apiVersion: platform.confluent.io/v1beta1
  3. kind: Connect
  4. metadata:
  5. name: connect
  6. namespace: confluent
  7. spec:
  8. replicas: 1
  9. image:
  10. application: confluentinc/cp-server-connect:7.4.0
  11. init: confluentinc/confluent-init-container:2.6.0
  12. tls:
  13. autoGeneratedCerts: true
  14. mountedSecrets:
  15. - secretRef: kafka-client-config-secure
  16. dependencies:
  17. kafka:
  18. bootstrapEndpoint: &lt;cloudKafka_url&gt;:9092
  19. authentication:
  20. type: plain
  21. jaasConfig:
  22. secretRef: cloud-plain
  23. tls:
  24. enabled: true
  25. ignoreTrustStoreConfig: true
  26. schemaRegistry:
  27. url: https://&lt;cloudSR_url&gt;
  28. authentication:
  29. type: basic
  30. basic:
  31. secretRef: cloud-sr-access
  32. ---

答案1

得分: 0

  1. 你可以使用类似这样的配置;

apiVersion: platform.confluent.io/v1beta1
kind: Connect
metadata:
labels:
app: connect
name: connect
namespace: confluent
spec:
replicas: 7
image:
application: confluentinc/cp-server-connect:7.4.0
init: confluentinc/confluent-init-container:2.6.0
tls:
autoGeneratedCerts: true
mountedSecrets:
- secretRef: kafka-client-config-secure
dependencies:
kafka:
bootstrapEndpoint: <cloudKafka_url>:9092
authentication:
type: plain
jaasConfig:
secretRef: cloud-plain
tls:
enabled: true
ignoreTrustStoreConfig: true
schemaRegistry:
url: https://<cloudSR_url>
authentication:
type: basic
basic:
secretRef: cloud-sr-access

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: connect-pdb
namespace: confluent
spec:
minAvailable: 7
selector:
matchLabels:
app: connect

英文:

you can use something like this;

  1. ---
  2. apiVersion: platform.confluent.io/v1beta1
  3. kind: Connect
  4. metadata:
  5. labels:
  6. app: connect
  7. name: connect
  8. namespace: confluent
  9. spec:
  10. replicas: 7
  11. image:
  12. application: confluentinc/cp-server-connect:7.4.0
  13. init: confluentinc/confluent-init-container:2.6.0
  14. tls:
  15. autoGeneratedCerts: true
  16. mountedSecrets:
  17. - secretRef: kafka-client-config-secure
  18. dependencies:
  19. kafka:
  20. bootstrapEndpoint: &lt;cloudKafka_url&gt;:9092
  21. authentication:
  22. type: plain
  23. jaasConfig:
  24. secretRef: cloud-plain
  25. tls:
  26. enabled: true
  27. ignoreTrustStoreConfig: true
  28. schemaRegistry:
  29. url: https://&lt;cloudSR_url&gt;
  30. authentication:
  31. type: basic
  32. basic:
  33. secretRef: cloud-sr-access
  34. ---
  1. apiVersion: policy/v1
  2. kind: PodDisruptionBudget
  3. metadata:
  4. name: connect-pdb
  5. namespace: confluent
  6. spec:
  7. minAvailable: 7
  8. selector:
  9. matchLabels:
  10. app: connect

huangapple
  • 本文由 发表于 2023年7月18日 12:49:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76709606.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定