apache / apisix-helm-chart

Apache APISIX Helm Chart
https://apisix.apache.org/
Apache License 2.0
228 stars 208 forks source link

how to browser to the apisix-dashboard #213

Open tranbaokhanh opened 2 years ago

tranbaokhanh commented 2 years ago

I have a cluster. i install APISIX via Helm with:

helm install apisix apisix/apisix \
--set gateway.type=NodePort \
--set dashboard.enabled=true \
--set etcd.persistence.size=15G \
--set etcd.persistence.enabled=true \
--set etcd.volumePermissions.enabled=true \
--set admin.allow.ipList="" \
--namespace apisix

kubectl get pods -o wide -n apisix

NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES apisix-8bd85d5ff-zhgnd 1/1 Running 0 135m 10.42.196.158 node01 apisix-dashboard-b69d5c768-b2jfj 1/1 Running 0 10m 10.42.196.163 node01 apisix-dashboard-b69d5c768-mdhsl 1/1 Running 3 135m 10.42.196.159 node01 apisix-etcd-0 1/1 Running 0 135m 10.42.196.160 node01 apisix-etcd-1 1/1 Running 0 135m 10.42.186.235 node03 apisix-etcd-2 1/1 Running 0 135m 10.42.196.161 node01

kubectl get svc -n apisix

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE apisix-admin ClusterIP 10.43.152.21 9180/TCP 158m apisix-dashboard ClusterIP 10.43.233.190 80/TCP 158m apisix-etcd ClusterIP 10.43.35.188 2379/TCP,2380/TCP 158m apisix-etcd-headless ClusterIP None 2379/TCP,2380/TCP 158m apisix-gateway NodePort 10.43.153.8 80:31588/TCP 158m

So, How to browser to the apisix-dashboard

tokers commented 2 years ago
  1. You can use kubectl port-forward to expose the service to your localhost, so that you can access it.
  2. You can set the apisix-dashboard service type to NodePort so that you can access it through Kubernetes worker nodes' IP addresses;
  3. If you're using a managed Kubernetes service like EKS, you can set the apisix-dashboard service type to LoadBalancer, so AWS will assign an ELB address for you, and you can access it on the Internet;
  4. (NOT SUGGEST), you can expose your APISIX service firstly through the above 3 ways, then adding a route to expose the apisix-dashboard by APISIX.
tranbaokhanh commented 2 years ago

@tokers how to set the apisix dashboard svc type to Nodeport? i use this cmd: helm install apisix apisix/apisix --set gateway.type=NodePort --set ingress-controller.enabled=false --set dashboard.enabled=true --set dashboard.type=NodePort --set etcd.persistence.size=15G --set etcd.persistence.enabled=true --set etcd.volumePermissions.enabled=true --set admin.allow.ipList="" --namespace apisix But that incorrect.

tokers commented 2 years ago

@tranbaokhanh See https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix-dashboard/values.yaml#L81.

tranbaokhanh commented 2 years ago

@tokers Thanks for your advice. i got it. BTW i have one more prbl. According this cmd #

@tokers how to set the apisix dashboard svc type to Nodeport? i use this cmd: helm install apisix apisix/apisix --set gateway.type=NodePort --set ingress-controller.enabled=false --set dashboard.enabled=true --set dashboard.type=NodePort --set etcd.persistence.size=15G --set etcd.persistence.enabled=true --set etcd.volumePermissions.enabled=true --set admin.allow.ipList="" --namespace apisix But that incorrect.

i have check https://github.com/apache/apisix-helm-chart/issues/105#issuecomment-864813598 and set etcd.volumePermissions.enabled=true but it dont auto create pv on my Nodes i follow Setting up a High-availability RKE Kubernetes Cluster https://rancher.com/docs/rancher/v2.6/en/installation/resources/k8s-tutorials/ha-rke/

tokers commented 2 years ago

@tokers Thanks for your advice. i got it. BTW i have one more prbl. According this cmd

@tokers how to set the apisix dashboard svc type to Nodeport? i use this cmd: helm install apisix apisix/apisix --set gateway.type=NodePort --set ingress-controller.enabled=false --set dashboard.enabled=true --set dashboard.type=NodePort --set etcd.persistence.size=15G --set etcd.persistence.enabled=true --set etcd.volumePermissions.enabled=true --set admin.allow.ipList="" --namespace apisix But that incorrect.

i have check #105 (comment) and set etcd.volumePermissions.enabled=true but it dont auto create pv on my Nodes i follow Setting up a High-availability RKE Kubernetes Cluster https://rancher.com/docs/rancher/v2.6/en/installation/resources/k8s-tutorials/ha-rke/

I don't have too much experience for the use of RKE, maybe you can throw the question to Rancher community.

flylan commented 1 year ago

You can access it using the SVC internal domain name of k8s, which should be the simplest. You can also enable the dashboard's ingress configuration and configure the ingress class to apisix, but this configuration can be relatively complex

flylan commented 1 year ago

The format of the SVC domain name for k8s is: {service-name}.{namespace-name}.svc.{cluster-domain}

Assuming the service name of your dashboard is apisix-dashboard, the deployed namespace is ingress-apisix, and the cluster domain of your k8s cluster is cluster.local, then your dashboard domain name is:

apisix-dashboard.ingress-apisix.svc.cluster.local

For details, please refer to the documentation of k8s: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/

pawankukreja01 commented 11 months ago
  1. If you have the APISIX Dashboard running locally, you can use kubectl port-forward to expose the service to your localhost.
  2. Alternatively, you can set the apisix-dashboard service type to NodePort so that you can access it through Kubernetes worker nodes’ IP addresses.
  3. If you are using a managed Kubernetes service like EKS, you can set the apisix-dashboard service type to LoadBalancer. This will assign an ELB address for you, and you can access it on the Internet.
  4. Another option is to expose your APISIX service first through the above three ways and then add a route to expose the apisix-dashboard by APISIX.
vinay-agens commented 11 months ago

Localhost: If you're running the dashboard locally, you can visit this URL: http://localhost:9000/user/login.

Kubernetes: If you're using Kubernetes, you can set the app six-dashboard service type to NodePort so that you can access it through Kubernetes worker nodes' IP addresses. If you're using a managed Kubernetes service like EKS, you can set the app six-dashboard service type to LoadBalancer, so AWS will assign an ELB address for you, and you can access it on the Internet.

Shell or Service: You can run the dashboard in the shell with sudo manager-api -p /usr/local/apisix/dashboard/ or run the dashboard as a service with systemctl start apisix-dashboard. Remember to replace /usr/local/apisix/dashboard/ with your actual APISIX Dashboard path if it's different.