Skip to content

Backport of NET-4967: Fix helm install when setting copyAnnotations or nodeSelector for apiGateway into release/1.2.x#2674

Merged
hc-github-team-consul-core merged 4 commits intorelease/1.2.xfrom
backport/multiline-args/formerly-known-possum
Jul 26, 2023
Merged

Backport of NET-4967: Fix helm install when setting copyAnnotations or nodeSelector for apiGateway into release/1.2.x#2674
hc-github-team-consul-core merged 4 commits intorelease/1.2.xfrom
backport/multiline-args/formerly-known-possum

Conversation

@hc-github-team-consul-core
Copy link
Copy Markdown
Collaborator

Backport

This PR is auto-generated from #2597 to be assessed for backporting due to the inclusion of the label backport/1.2.x.

The below text is copied from the body of the original PR.


Changes proposed in this PR:
Modify Helm chart to properly support passing multiline strings for api-gateway nodeSelector and copyAnnotations

How I've tested this PR:
helm install with a values.yaml containing multiline values for the impacted args. The Job modified in this PR should correctly install and run as a post-install hook. You should also see the copyAnnotations and nodeSelector value make it onto the GatewayClassConfig in their entirety.

global:
  name: consul

  tls:
    enabled: true

connectInject:
  apiGateway:
    managedGatewayClass:
      nodeSelector: |
        kubernetes.io/os: linux
        kubernetes.io/is: windows
      copyAnnotations:
        service:
          annotations: |
            - service.beta.kubernetes.io/aws-load-balancer-scheme
            - service.beta.kubernetes.io/aws-load-balancer-name
➜  consul git:(multiline-args) helm upgrade --install consul ~/workspaces/consul-k8s/charts/consul --values ~/workspaces/lab/node-selector/values.yaml
Release "consul" has been upgraded. Happy Helming!
...

➜  consul git:(multiline-args) kubectl get gatewayclassconfig consul-api-gateway -o yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: GatewayClassConfig
...
spec:
  copyAnnotations:
    service:
    - service.beta.kubernetes.io/aws-load-balancer-scheme
    - service.beta.kubernetes.io/aws-load-balancer-name
  deployment:
    defaultInstances: 1
    maxInstances: 1
    minInstances: 1
  nodeSelector:
    kubernetes.io/is: windows
    kubernetes.io/os: linux
  serviceType: LoadBalancer

How I expect reviewers to test this PR:
See above

Checklist:


Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core merged commit f88485f into release/1.2.x Jul 26, 2023
@hc-github-team-consul-core hc-github-team-consul-core deleted the backport/multiline-args/formerly-known-possum branch July 26, 2023 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants