danhuawang commented on code in PR #56:
URL: 
https://github.com/apache/gravitino-playground/pull/56#discussion_r1722987523


##########
helm-chart/templates/NOTES.txt:
##########
@@ -0,0 +1,22 @@
+1. Get the application URL by running these commands:
+{{- if .Values.ingress.enabled }}
+{{- range $host := .Values.ingress.hosts }}
+  {{- range .paths }}
+  http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
+  {{- end }}
+{{- end }}
+{{- else if contains "NodePort" .Values.service.type }}
+  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o 
jsonpath="{.spec.ports[0].nodePort}" services {{ include 
"gravitino-playground.fullname" . }})
+  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o 
jsonpath="{.items[0].status.addresses[0].address}")
+  echo http://$NODE_IP:$NODE_PORT
+{{- else if contains "LoadBalancer" .Values.service.type }}
+     NOTE: It may take a few minutes for the LoadBalancer IP to be available.
+           You can watch the status of by running 'kubectl get --namespace {{ 
.Release.Namespace }} svc -w {{ include "gravitino-playground.fullname" . }}'
+  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ 
include "gravitino-playground.fullname" . }} --template "{{"{{ range (index 
.status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
+  echo http://$SERVICE_IP:{{ .Values.service.port }}
+{{- else if contains "ClusterIP" .Values.service.type }}
+  export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l 
"app.kubernetes.io/name={{ include "gravitino-playground.name" . 
}},app.kubernetes.io/instance={{ .Release.Name }}" -o 
jsonpath="{.items[0].metadata.name}")
+  export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} 
$POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")

Review Comment:
   The note that I got on console is 
   ```
   1. Get the application URL by running these commands:
     export POD_NAME=$(kubectl get pods --namespace gravitino-playground -l 
"app.kubernetes.io/name=gravitino-playground,app.kubernetes.io/instance=gravitino-playground"
 -o jsonpath="{.items[0].metadata.name}")
     export CONTAINER_PORT=$(kubectl get pod --namespace gravitino-playground 
$POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
     echo "Visit http://127.0.0.1:8080 to use your application"
     kubectl --namespace gravitino-playground port-forward $POD_NAME 
8080:$CONTAINER_PORT
   ```
   The command above do not work, see the following:
   ```
   kubectl get pods --namespace gravitino-playground -l 
"app.kubernetes.io/name=gravitino-playground,app.kubernetes.io/instance=gravitino-playground"
 -o jsonpath="{.items[0].metadata.name}"
   error: error executing jsonpath "{.items[0].metadata.name}": Error executing 
template: array index out of bounds: index 0, length 0. Printing more 
information for debugging the template:
           template was:
                   {.items[0].metadata.name}
           object given to jsonpath engine was:
                   map[string]interface {}{"apiVersion":"v1", 
"items":[]interface {}{}, "kind":"List", "metadata":map[string]interface 
{}{"resourceVersion":""}}
   
   ```
   In fact, expectation is like:
   ```
   1. Get the application URL by running these commands:
   export POD_NAME=$(kubectl get pods --namespace gravitino-playground -l 
"app=gravitino" -o jsonpath="{.items[0].metadata.name}")
   export CONTAINER_PORT=$(kubectl get pod --namespace gravitino-playground 
$POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
   echo "Visit http://127.0.0.1:8090 to use your application"
   kubectl --namespace gravitino-playground port-forward $POD_NAME 
8090:$CONTAINER_PORT
   ```
   Gravitino UI use 8090 port by default.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to