Skip to content

Fix TLS Cert when using enableAutoEncrypt#1753

Merged
t-eckert merged 7 commits intomainfrom
te/fix-tls-autogen
Nov 30, 2022
Merged

Fix TLS Cert when using enableAutoEncrypt#1753
t-eckert merged 7 commits intomainfrom
te/fix-tls-autogen

Conversation

@t-eckert
Copy link
Copy Markdown
Contributor

@t-eckert t-eckert commented Nov 28, 2022

Changes proposed in this PR:

  • The generated cert will always mount to consul-ca-cert
  • The controller will use the cert at consul-ca-cert to talk to servers if running without clients. It will use consul-auto-encrypt-ca-cert to talk to clients only if running with clients.

How I've tested this PR:

  • Updated BATS
  • Deployed successfully with the following configurations, verifying that the controller received the correct cert and was able to talk to the server or client depending on the configuration.
    • tls.enableAutoEncrypt=false client.enabled=false apiGateway.image=...0.5.1
    • tls.enableAutoEncrypt=true client.enabled=false apiGateway.image=...0.5.1
    • tls.enableAutoEncrypt=false client.enabled=true apiGateway.image=...0.5.1
    • tls.enableAutoEncrypt=true client.enabled=true apiGateway.image=...0.5.1
    • tls.enableAutoEncrypt=true client.enabled=true apiGateway.image=...0.4.0

How I expect reviewers to test this PR:

  • BATS
  • Testing that the configuration that originally caught this bug works correctly:
global:
  logLevel: "trace"
  acls:
    manageSystemACLs: true
  image: hashicorp/consul:1.14.1
  imageK8S: hashicorp/consul-k8s-control-plane:1.0.1
  tls:
    enabled: true
    enableAutoEncrypt: true
apiGateway:
  enabled: true
  image: hashicorp/consul-api-gateway:0.5.1
  logLevel: debug
  managedGatewayClass:
    enabled: true
    serviceType: LoadBalancer
connectInject:
  enabled: true
controller:
  enabled: true
server:
  replicas: 1
client:
  enabled: true

Checklist:

  • Tests added
  • CHANGELOG entry added

    HashiCorp engineers only, community PRs should not add a changelog entry.
    Entries should use present tense (e.g. Add support for...)

@t-eckert t-eckert requested review from a team, andrewstucki, ishustava and kschoche and removed request for a team November 28, 2022 22:55
@t-eckert t-eckert force-pushed the te/fix-tls-autogen branch 2 times, most recently from c6bf305 to d486e02 Compare November 29, 2022 02:33
@nathancoleman nathancoleman added theme/api-gateway Related to Consul API Gateway area/chart-only Related to changes that simply require yaml Helm chart changes, e.g. exposing a new field labels Nov 29, 2022
Copy link
Copy Markdown
Contributor

@curtbushko curtbushko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/chart-only Related to changes that simply require yaml Helm chart changes, e.g. exposing a new field theme/api-gateway Related to Consul API Gateway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants