First version of service exposure
[nonrtric.git] / service-exposure / charts / rapp-invoker / templates / NOTES.txt
1 {{/*
2 #
3 # ============LICENSE_START=======================================================
4 #  Copyright (C) 2022 Nordix Foundation.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
20 #
21 */}}
22 1. Get the application URL by running these commands:
23 {{- if .Values.ingress.enabled }}
24 {{- range $host := .Values.ingress.hosts }}
25   {{- range .paths }}
26   http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
27   {{- end }}
28 {{- end }}
29 {{- else if contains "NodePort" .Values.service.type }}
30   export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "rapp-invoker.fullname" . }})
31   export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
32   echo http://$NODE_IP:$NODE_PORT
33 {{- else if contains "LoadBalancer" .Values.service.type }}
34      NOTE: It may take a few minutes for the LoadBalancer IP to be available.
35            You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "rapp-invoker.fullname" . }}'
36   export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "rapp-invoker.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
37   echo http://$SERVICE_IP:{{ .Values.service.port }}
38 {{- else if contains "ClusterIP" .Values.service.type }}
39   export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "rapp-invoker.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
40   export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
41   echo "Visit http://127.0.0.1:8080 to use your application"
42   kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
43 {{- end }}