Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[helm] Add support for TLS config blocks #38

Merged
merged 3 commits into from
Apr 2, 2020
Merged

Conversation

wallyqs
Copy link
Member

@wallyqs wallyqs commented Apr 2, 2020

Example:

helm install nats -f ../deploy-nats-gateways.yaml ./charts/nats

where the yaml is:

nats:
  externalAccess: true
  logging:
    debug: true
    trace: true
  tls:
    secret:
      name: nats-client-tls
    ca: "ca.crt"
    cert: "tls.crt"
    key: "tls.key"

cluster:
  enabled: true
  tls:
    secret:
      name: nats-server-tls
    ca: "ca.crt"
    cert: "tls.crt"
    key: "tls.key"

leafnodes:
  enabled: true

  tls:
    secret:
      name: nats-server-tls
    ca: "ca.crt"
    cert: "tls.crt"
    key: "tls.key"

  remotes:
    - url: tls://connect.ngs.global:7422
      credentials:
        secret:
          name: ngs-creds
          key: NGS.creds

gateway:
  enabled: true
  name: aws-useast2

  # Shared for all gateways
  tls:
    secret:
      name: nats-server-tls
    ca: "ca.crt"
    cert: "tls.crt"
    key: "tls.key"

# Add system credentials to the nats-box instance for example
natsbox:
  enabled: true

  credentials:
    secret:
      name: nats-sys-creds
      key: sys.creds

Signed-off-by: Waldemar Quevedo <[email protected]>
@wallyqs wallyqs changed the title Add support for TLS config blocks [helm] Add support for TLS config blocks Apr 2, 2020
{{ $secretName := .secret.name }}
- name: {{ $secretName }}-gateways-volume
mountPath: /etc/nats-certs/gateways/{{ $secretName }}
{{- end }}
Copy link
Member Author

Choose a reason for hiding this comment

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

These should also be mounted by the reloader sidecar so that it tracks the changes of the certs, but we can do that in a separate PR...

helm/charts/nats/values.yaml Show resolved Hide resolved

#############################
# #
# List of remote gateways #
Copy link
Contributor

Choose a reason for hiding this comment

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

there is a per gateway tls option as well. mention that this was explicitly left out?

Copy link
Member Author

Choose a reason for hiding this comment

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

explicitly left out for now for both leafnode remotes and gateway remotes to reduce size of PR a bit...

helm/charts/nats/values.yaml Show resolved Hide resolved
Signed-off-by: Waldemar Quevedo <[email protected]>
@matthiashanel
Copy link
Contributor

LGTM

Copy link
Contributor

@matthiashanel matthiashanel left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Waldemar Quevedo <[email protected]>
@wallyqs wallyqs merged commit da27033 into account-server Apr 2, 2020
@wallyqs wallyqs deleted the now-with-tls branch April 2, 2020 23:18
@ondrejtomcik
Copy link
Contributor

Greetings @wallyqs @matthiashanel
This feature was merged but looks like a human error occurred during merge conflict resolution. This feature is not in the master nor in v0.3.0.

@wallyqs
Copy link
Member Author

wallyqs commented Apr 3, 2020

@ondrejtomcik you are right 😨 It looks like something may have happened with the merge probably during the Github outage...

@wallyqs
Copy link
Member Author

wallyqs commented Apr 3, 2020

@ondrejtomcik can you try helm repo update and use release v0.3.2? I think this should be fixed there. Here is an example:

# Authentication setup
auth:
  enabled: true

  # Reference to the Operator JWT which will be mounted as a volume,
  # shared with the account server in this case.
  operatorjwt:
    configMap:
      name: operator-jwt
      key: KO.jwt

  # Public key of the System Account
  systemAccount: AAITGVORQ4VHOQ32A7XMEKUIDMJ5GSAYSUGOV6GZAVSQWYFAL72DIXLC

  resolver:
    type: URL

    # 
    # NOTE: In case the account server URL is not present
    # in the operator JWT then need to set it explicitly here.
    # 
    url: "http://nats-account-server:9090/jwt/v1/accounts/"

nats:
  externalAccess: true
  logging:
    debug: true
    trace: true
  tls:
    secret:
      name: nats-client-tls
    ca: "ca.crt"
    cert: "tls.crt"
    key: "tls.key"

cluster:
  enabled: true
  tls:
    secret:
      name: nats-server-tls
    ca: "ca.crt"
    cert: "tls.crt"
    key: "tls.key"

leafnodes:
  enabled: true

  tls:
    secret:
      name: nats-server-tls
    ca: "ca.crt"
    cert: "tls.crt"
    key: "tls.key"

  remotes:
    - url: tls://connect.ngs.global:7422
      credentials:
        secret:
          name: ngs-creds
          key: NGS.creds

gateway:
  enabled: true
  name: aws-useast2

  # Shared for all gateways
  tls:
    secret:
      name: nats-server-tls
    ca: "ca.crt"
    cert: "tls.crt"
    key: "tls.key"

  # gateways:
  #   - name: euwest1
  #     url: tls://euwest1.aws.ngs.global:7522

# Add system credentials to the nats-box instance for example
natsbox:
  enabled: true

  credentials:
    secret:
      name: nats-sys-creds
      key: sys.creds

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.

3 participants