
1. Get the URL of your Node app  by running:

{{- if contains "NodePort" .Values.service.type }}

  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "node.fullname" . }})
  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  echo "Node app URL: 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.
        Watch the status with: 'kubectl get svc -w {{ template "node.fullname" . }} --namespace {{ .Release.Namespace }}'

  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "node.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
  echo "Node app URL: http://$SERVICE_IP/"

{{- else if contains "ClusterIP"  .Values.service.type }}

  kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "node.fullname" . }} {{ .Values.service.port  }}:{{ .Values.service.port }}
  echo "Node app URL: http://127.0.0.1:{{ .Values.service.port }}/"

{{- end }}

{{ include "node.checkRollingTags" . }}
