-
Notifications
You must be signed in to change notification settings - Fork 48
feat(chart): show real endpoints in Helm post-install notes #2801
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
Open
ghophp
wants to merge
1
commit into
chainloop-dev:main
Choose a base branch
from
ghophp:ghophp/issue-97/dynamic-helm-notes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+140
−4
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,11 +8,115 @@ APP VERSION: {{ .Chart.AppVersion }} | |
| CONFIGURE CLI | ||
| ########################################################################### | ||
|
|
||
| Configure the CLI to point to this instance, for example | ||
| {{- $cpGrpcURL := include "chainloop.controlplane.external_grpc_url" . }} | ||
| {{- $casGrpcURL := include "chainloop.cas.external_grpc_url" . }} | ||
|
|
||
| chainloop --insecure config save \ | ||
| --control-plane my-controlplane.acme.com:80 \ | ||
| --artifact-cas cas.acme.com:80 | ||
| {{- $cpSvcType := .Values.controlplane.serviceAPI.type }} | ||
| {{- $cpSvcPort := coalesce .Values.controlplane.serviceAPI.port .Values.controlplane.serviceAPI.ports.http }} | ||
| {{- $cpSvcName := printf "%s-api" (include "chainloop.controlplane.fullname" .) }} | ||
|
|
||
| {{- $casSvcType := .Values.cas.serviceAPI.type }} | ||
| {{- $casSvcPort := coalesce .Values.cas.serviceAPI.port .Values.cas.serviceAPI.ports.http }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .Values.cas.serviceAPI.port same here |
||
| {{- $casSvcName := printf "%s-api" (include "chainloop.cas.fullname" .) }} | ||
|
|
||
| {{- $namespace := include "common.names.namespace" . }} | ||
|
|
||
| {{- $cpHasTLS := or (and .Values.controlplane.ingressAPI.enabled .Values.controlplane.ingressAPI.tls) (ne (.Values.controlplane.tls.existingSecret | default "") "") }} | ||
| {{- $casHasTLS := or (and .Values.cas.ingressAPI.enabled .Values.cas.ingressAPI.tls) (ne (.Values.cas.tls.existingSecret | default "") "") }} | ||
| {{- $insecure := not (and $cpHasTLS $casHasTLS) }} | ||
|
|
||
| {{- if and (ne $cpGrpcURL "") (ne $casGrpcURL "") }} | ||
| {{- /* Both endpoints can be resolved - show a single ready-to-use command */ -}} | ||
|
|
||
| Configure the CLI to point to this instance: | ||
|
|
||
| chainloop {{ if $insecure }}--insecure {{ end }}config save \ | ||
| --control-plane {{ $cpGrpcURL }} \ | ||
| --artifact-cas {{ $casGrpcURL }} | ||
|
|
||
| {{- else }} | ||
|
|
||
| To configure the CLI, you need the Control Plane and Artifact CAS gRPC endpoints. | ||
| {{- /* --- CONTROL PLANE ENDPOINT --- */ -}} | ||
| {{- if ne $cpGrpcURL "" }} | ||
|
|
||
| 1. The Control Plane gRPC API is available at: | ||
|
|
||
| {{ $cpGrpcURL }} | ||
| {{- else if eq $cpSvcType "LoadBalancer" }} | ||
|
|
||
| 1. Get the Control Plane gRPC endpoint: | ||
|
|
||
| NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
| Watch the status with: kubectl get --namespace {{ $namespace }} svc {{ $cpSvcName }} -w | ||
|
|
||
| export CP_HOST=$(kubectl get svc --namespace {{ $namespace }} {{ $cpSvcName }} --template "{{ "{{" }} range (index .status.loadBalancer.ingress 0) {{ "}}" }}{{ "{{" }} . {{ "}}" }}{{ "{{" }} end {{ "}}" }}") | ||
| export CP_PORT={{ $cpSvcPort }} | ||
| {{- else if eq $cpSvcType "NodePort" }} | ||
|
|
||
| 1. Get the Control Plane gRPC endpoint: | ||
|
|
||
| export CP_HOST=$(kubectl get nodes --namespace {{ $namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
| export CP_PORT=$(kubectl get --namespace {{ $namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ $cpSvcName }}) | ||
| {{- else }} | ||
|
|
||
| 1. The Control Plane gRPC API is not externally accessible (ClusterIP). Use port-forwarding: | ||
|
|
||
| kubectl port-forward --namespace {{ $namespace }} svc/{{ $cpSvcName }} 9000:{{ $cpSvcPort }} & | ||
| {{- end }} | ||
| {{- /* --- CAS ENDPOINT --- */ -}} | ||
| {{- if ne $casGrpcURL "" }} | ||
|
|
||
| 2. The Artifact CAS gRPC API is available at: | ||
|
|
||
| {{ $casGrpcURL }} | ||
| {{- else if eq $casSvcType "LoadBalancer" }} | ||
|
|
||
| 2. Get the Artifact CAS gRPC endpoint: | ||
|
|
||
| NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
| Watch the status with: kubectl get --namespace {{ $namespace }} svc {{ $casSvcName }} -w | ||
|
|
||
| export CAS_HOST=$(kubectl get svc --namespace {{ $namespace }} {{ $casSvcName }} --template "{{ "{{" }} range (index .status.loadBalancer.ingress 0) {{ "}}" }}{{ "{{" }} . {{ "}}" }}{{ "{{" }} end {{ "}}" }}") | ||
| export CAS_PORT={{ $casSvcPort }} | ||
| {{- else if eq $casSvcType "NodePort" }} | ||
|
|
||
| 2. Get the Artifact CAS gRPC endpoint: | ||
|
|
||
| export CAS_HOST=$(kubectl get nodes --namespace {{ $namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
| export CAS_PORT=$(kubectl get --namespace {{ $namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ $casSvcName }}) | ||
| {{- else }} | ||
|
|
||
| 2. The Artifact CAS gRPC API is not externally accessible (ClusterIP). Use port-forwarding: | ||
|
|
||
| kubectl port-forward --namespace {{ $namespace }} svc/{{ $casSvcName }} 9001:{{ $casSvcPort }} & | ||
| {{- end }} | ||
|
|
||
| 3. Configure the CLI: | ||
|
|
||
| {{- $cpRef := $cpGrpcURL -}} | ||
| {{- if eq $cpRef "" -}} | ||
| {{- if or (eq $cpSvcType "LoadBalancer") (eq $cpSvcType "NodePort") -}} | ||
| {{- $cpRef = "$CP_HOST:$CP_PORT" -}} | ||
| {{- else -}} | ||
| {{- $cpRef = "localhost:9000" -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{- $casRef := $casGrpcURL -}} | ||
| {{- if eq $casRef "" -}} | ||
| {{- if or (eq $casSvcType "LoadBalancer") (eq $casSvcType "NodePort") -}} | ||
| {{- $casRef = "$CAS_HOST:$CAS_PORT" -}} | ||
| {{- else -}} | ||
| {{- $casRef = "localhost:9001" -}} | ||
| {{- end -}} | ||
| {{- end }} | ||
|
|
||
| chainloop {{ if $insecure }}--insecure {{ end }}config save \ | ||
| --control-plane {{ $cpRef }} \ | ||
| --artifact-cas {{ $casRef }} | ||
|
|
||
| {{- end }} | ||
|
|
||
| Refer to this link for more information | ||
| https://docs.chainloop.dev/get-started/setup | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Values.controlplane.serviceAPI.port this key does not exist, it should be .ports