redpanda-data / helm-charts

Redpanda Helm Chart
http://redpanda.com
Apache License 2.0
77 stars 96 forks source link

Allow more than one value in advertisedPorts #660

Open gugu opened 1 year ago

gugu commented 1 year ago

What happened?

When I'm trying to use redpanda in LoadBalancer mode, it creates 3 load balancers. It is cheaper to create 1 load balancer with a separate port for each node. It can be done with service.beta.kubernetes.io/aws-load-balancer-name: lb-name annotation, but it is not possible to provide a different port for each LB service

What did you expect to happen?

advertisedPorts expects an array, but only first value is used. I expect the chart to use N-th value for each service

How can we reproduce it (as minimally and precisely as possible)?. Please include values file.

```console $ helm get values -n --all auth: sasl: enabled: true mechanism: SCRAM-SHA-512 secretRef: redpanda-users clusterDomain: cluster.local commonLabels: {} config: cluster: {} node: {} rpk: {} tunable: compacted_log_segment_size: 67108864 group_topic_partitions: 16 kafka_batch_max_bytes: 1048576 kafka_connection_rate_limit: 1000 log_segment_size: 134217728 log_segment_size_max: 268435456 log_segment_size_min: 16777216 max_compacted_log_segment_size: 536870912 topic_partitions_per_shard: 1000 console: affinity: {} annotations: {} autoscaling: enabled: false maxReplicas: 100 minReplicas: 1 targetCPUUtilizationPercentage: 80 config: {} configmap: create: false console: config: {} deployment: create: false enabled: true extraContainers: [] extraEnv: [] extraEnvFrom: [] extraVolumeMounts: [] extraVolumes: [] fullnameOverride: "" global: {} image: pullPolicy: IfNotPresent registry: docker.redpanda.com repository: redpandadata/console tag: "" imagePullSecrets: [] ingress: annotations: {} className: "" enabled: false hosts: - host: chart-example.local paths: - path: / pathType: ImplementationSpecific tls: [] livenessProbe: failureThreshold: 3 initialDelaySeconds: 0 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 nameOverride: "" nodeSelector: {} podAnnotations: {} podLabels: {} podSecurityContext: fsGroup: 99 runAsUser: 99 priorityClassName: "" readinessProbe: failureThreshold: 3 initialDelaySeconds: 10 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 replicaCount: 1 resources: {} secret: create: false enterprise: {} kafka: {} login: github: {} google: {} jwtSecret: "" oidc: {} okta: {} redpanda: adminApi: {} secretMounts: [] securityContext: runAsNonRoot: true service: annotations: {} port: 8080 type: ClusterIP serviceAccount: annotations: {} create: true name: "" tolerations: [] topologySpreadConstraints: {} external: addresses: - redpanda-eu-central-1-0 - redpanda-eu-central-1-1 - redpanda-eu-central-1-2 annotations: service.beta.kubernetes.io/aws-load-balancer-scheme: internal service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip domain: example.com enabled: true externalDns: enabled: true type: LoadBalancer fullnameOverride: "" image: pullPolicy: IfNotPresent repository: docker.redpanda.com/redpandadata/redpanda tag: "" imagePullSecrets: [] license_key: "" license_secret_ref: {} listeners: admin: external: default: advertisedPorts: - 31644 enabled: false port: 9645 tls: cert: external port: 9644 tls: cert: default requireClientAuth: false http: authenticationMethod: null enabled: true external: default: advertisedPorts: - 30082 authenticationMethod: null enabled: false port: 8083 tls: cert: external kafkaEndpoint: default port: 8082 tls: cert: default requireClientAuth: false kafka: authenticationMethod: null external: default: advertisedPorts: - 31093 - 31094 - 31095 authenticationMethod: null port: 9094 tls: cert: external port: 9093 tls: cert: default requireClientAuth: false rpc: port: 33145 tls: cert: default requireClientAuth: false schemaRegistry: authenticationMethod: null enabled: true external: default: advertisedPorts: - 30073 - 30074 - 30075 authenticationMethod: null port: 8084 tls: cert: external kafkaEndpoint: default port: 8081 tls: cert: default requireClientAuth: false logging: logLevel: info usageStats: enabled: true monitoring: enabled: false labels: {} scrapeInterval: 30s nameOverride: "" node: developer_mode: false nodeSelector: {} post_install_job: enabled: true post_upgrade_job: enabled: true rackAwareness: enabled: false nodeAnnotation: topology.kubernetes.io/zone rbac: annotations: {} enabled: false resources: cpu: cores: 1 memory: container: max: 2560Mi min: 2560Mi serviceAccount: annotations: {} create: false name: "" statefulset: additionalRedpandaCmdFlags: [] annotations: prometheus.io/path: /public_metrics prometheus.io/port: "9644" prometheus.io/scheme: https prometheus.io/scrape: "true" budget: maxUnavailable: 1 initContainerImage: repository: busybox tag: latest initContainers: configurator: resources: {} setDataDirOwnership: enabled: false resources: {} setTieredStorageCacheDirOwnership: resources: {} tuning: resources: {} livenessProbe: failureThreshold: 3 initialDelaySeconds: 10 periodSeconds: 10 nodeSelector: {} podAffinity: {} podAntiAffinity: custom: {} topologyKey: kubernetes.io/hostname type: hard weight: 100 priorityClassName: "" readinessProbe: failureThreshold: 3 initialDelaySeconds: 1 periodSeconds: 10 successThreshold: 1 replicas: 3 securityContext: fsGroup: 101 fsGroupChangePolicy: OnRootMismatch runAsUser: 101 sideCars: configWatcher: enabled: true resources: {} securityContext: {} startupProbe: failureThreshold: 120 initialDelaySeconds: 1 periodSeconds: 10 terminationGracePeriodSeconds: 90 tolerations: [] topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: ScheduleAnyway updateStrategy: type: RollingUpdate storage: hostPath: "" persistentVolume: annotations: {} enabled: true labels: {} size: 50Gi storageClass: redpanda-xfs tieredConfig: cloud_storage_access_key: "" cloud_storage_api_endpoint: "" cloud_storage_azure_container: null cloud_storage_azure_shared_key: null cloud_storage_azure_storage_account: null cloud_storage_bucket: "" cloud_storage_cache_size: 5368709120 cloud_storage_credentials_source: config_file cloud_storage_enable_remote_read: true cloud_storage_enable_remote_write: true cloud_storage_enabled: false cloud_storage_region: "" cloud_storage_secret_key: "" tieredStorageHostPath: "" tieredStoragePersistentVolume: annotations: {} enabled: false labels: {} storageClass: "" tls: certs: default: caEnabled: true external: caEnabled: true enabled: true tolerations: [] tuning: tune_aio_events: true ```

Anything else we need to know?

I can try to send PR if the bug is approved

Which are the affected charts?

Redpanda

Chart Version(s)

```console $ helm -n list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION redirector-redpanda default 12 2023-08-12 14:23:51.04921211 +0000 UTC deployed redpanda-5.0.4 v23.2.2 ```

Cloud provider

EKS

JIRA Link: K8S-54

joejulian commented 1 year ago

Mentioned in slack, the problem's a little more complicated than this but we're currently prototyping a solution.