Congratulations. You have just deployed JFrog Artifactory!

1. Get the Artifactory URL by running these commands:

   {{- if .Values.ingress.enabled }}
   {{- range .Values.ingress.hosts }}
     http://{{ . }}
   {{- end }}
   
   {{- else if contains "NodePort" .Values.nginx.service.type }}
   export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "artifactory.nginx.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.nginx.service.type }}

   NOTE: It may take a few minutes for the LoadBalancer IP to be available.
         You can watch the status of the service by running 'kubectl get svc -w {{ template "artifactory.nginx.fullname" . }}'
   export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "artifactory.nginx.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
   echo http://$SERVICE_IP/

   {{- else if contains "ClusterIP" .Values.nginx.service.type }}
   export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "component={{ .Values.nginx.name }}" -o jsonpath="{.items[0].metadata.name}")
   echo http://127.0.0.1:{{ .Values.nginx.externalPortHttp }}
   kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME {{ .Values.nginx.externalPortHttp }}:{{ .Values.nginx.internalPortHttp }}

   {{- end }}

2. Open Artifactory in your browser
   Default credential for Artifactory:
   user: admin
   password: password

{{ if .Values.artifactory.javaOpts.jmx.enabled }}
JMX configuration:
{{- if not (contains "LoadBalancer"  .Values.artifactory.service.type) }}
If you want to access JMX from you computer with jconsole, you should set ".Values.artifactory.service.type=LoadBalancer" !!!
{{ end }}

1. Get the Artifactory service IP:
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "artifactory.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')

2. Map the service name to the service IP in /etc/hosts:
sudo sh -c "echo \"${SERVICE_IP}    {{ template "artifactory.fullname" . }}\" >> /etc/hosts"

3. Launch jconsole:
jconsole {{ template "artifactory.fullname" . }}:{{ .Values.artifactory.javaOpts.jmx.port }}
{{- end }}