The ORY Kratos HTTP Public API is available via:
{{- if .Values.ingress.public.enabled }}
{{- range $host := .Values.ingress.public.hosts }}
  {{- range .paths }}
  http{{ if $.Values.ingress.public.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
  {{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.public.type }}
  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "kratos.fullname" . }})
  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  export KRATOS_PUBLIC_URL=http://$NODE_IP:$NODE_PORT

If you have the ORY Kratos CLI installed locally, you can run commands
against this endpoint:

  kratos ... $KRATOS_PUBLIC_URL

{{- else if contains "LoadBalancer" .Values.service.public.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 "kratos.fullname" . }}'
  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "kratos.fullname" . }}-public -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
  export KRATOS_PUBLIC_URL=http://$SERVICE_IP:{{ .Values.service.public.port }}

If you have the Kratos Kratos CLI installed locally, you can run commands
against this endpoint:

  kratos ... $KRATOS_PUBLIC_URL

{{- else if contains "ClusterIP" .Values.service.public.type }}
  export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "kratos.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
  echo "Visit http://127.0.0.1:{{ .Values.service.public.port }} to use your application"
  kubectl port-forward $POD_NAME {{ .Values.service.public.port }}:{{ .Values.kratos.config.serve.public.port }}
  export KRATOS_PUBLIC_URL=http://127.0.0.1:{{ .Values.service.public.port }}


If you have the ORY Kratos CLI installed locally, you can run commands
against this endpoint:

  kratos ... $KRATOS_PUBLIC_URL

{{- end }}

The ORY Kratos HTTP Admin API is available via:
{{- if .Values.ingress.admin.enabled }}
{{- range $host := .Values.ingress.admin.hosts }}
  {{- range .paths }}
  http{{ if $.Values.ingress.admin.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
  {{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.admin.type }}
  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "kratos.fullname" . }})
  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  export HIVE_ADMIN_URL=http://$NODE_IP:$NODE_PORT

If you have the ORY Kratos CLI installed locally, you can run commands
against this endpoint:

  kratos ... $KRATOS_ADMIN_URL

{{- else if contains "LoadBalancer" .Values.service.admin.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 "kratos.fullname" . }}'
  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "kratos.fullname" . }}-admin -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
  export HIVE_ADMIN_URL=http://$SERVICE_IP:{{ .Values.service.admin.port }}

If you have the ORY Kratos CLI installed locally, you can run commands
against this endpoint:

  kratos ... $KRATOS_ADMIN_URL

{{- else if contains "ClusterIP" .Values.service.admin.type }}
  export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "kratos.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
  echo "Visit http://127.0.0.1:{{ .Values.service.admin.port }} to use your application"
  kubectl port-forward $POD_NAME {{ .Values.service.admin.port }}:{{ .Values.kratos.config.serve.admin.port }}
  export KRATOS_ADMIN_URL=http://127.0.0.1:{{ .Values.service.admin.port }}

If you have the ORY Kratos CLI installed locally, you can run commands
against this endpoint:

  kratos ... $KRATOS_ADMIN_URL

{{- end }}
