Skip to content

Use secret for trust path - #414

Merged
freeznet merged 9 commits into
streamnative:masterfrom
jiangpengcheng:use_secret_for_trust_path
Jul 11, 2022
Merged

freeznet merged 9 commits into
streamnative:masterfrom
jiangpengcheng:use_secret_for_trust_path

Conversation

@jiangpengcheng

Copy link
Copy Markdown
Member

Fixes #412

Motivation

users may just want to provide one of the TLS-related parameters to function mesh, such as --tls-allow-insecure, yet currently all parameters are required

another reason is that tls-trust-cert-path should be mounted as a secret file instead of written into docker images directly

Modifications

  • provide default value for tlsAllowInseure and tlsHostnameVerificationEnable

  • add a field TlsTrustCert for function/sink/source so that it will automatically mount related secret as a file in the runtime pod, and be used in instance start commands

Verifying this change

  • Make sure that the change passes the CI checks.

  • This change added tests and can be verified as follows:

    • Added unit test to generate related volume and volume mounts

Documentation

  • doc-required

    needs to update doc for users about how to use tls-trust-cert-path

@jiangpengcheng
jiangpengcheng requested review from a team, freeznet and nlu90 as code owners June 30, 2022 02:29
@github-actions github-actions Bot added the doc-required This pr needs a document label Jun 30, 2022

@freeznet freeznet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @jiangpengcheng, the default value of tlsAllowInseure and tlsHostnameVerificationEnable LGTM. But I would like to have some changes on the TLS cert part, please check my comment, thanks.

Comment thread api/v1alpha1/sink_types.go Resolved
@freeznet freeznet added type/feature Indicates new functionality m/2022-07 labels Jul 1, 2022
@jiangpengcheng
jiangpengcheng force-pushed the use_secret_for_trust_path branch from 56ba682 to eeff60e Compare July 5, 2022 03:22
@jiangpengcheng
jiangpengcheng requested a review from freeznet July 5, 2022 06:33
@jiangpengcheng
jiangpengcheng force-pushed the use_secret_for_trust_path branch from 7b36abf to 52789b6 Compare July 5, 2022 06:53

@freeznet freeznet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, please check the comments, thanks.

Comment thread api/v1alpha1/common.go
Enabled bool `json:"enabled,omitempty"`
AllowInsecure bool `json:"allowInsecure,omitempty"`
HostnameVerification bool `json:"hostnameVerification,omitempty"`
CertSecretName string `json:"certSecretName,omitempty"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it possible to use SecretRef instead of CertSecretName and CertSecretKey?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Do you mean to use SecretRef.path as the secret name and SecretRef.key as the key?

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

Labels

doc-added m/2022-07 type/feature Indicates new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

when TLSSecret is provided, all tls related parameters are required

4 participants