0

I have run a basic example project and can confirm it is running, but I cannot identify its URL?

Kubectl describe service - gives me

NAME                       READY   STATUS    RESTARTS   AGE
frontend-6c8b5cc5b-v9jlb   1/1     Running   0          26s
PS D:\git\helm3\lab1_kubectl_version1\yaml> kubectl describe service
Name:              frontend
Namespace:         default
Labels:            name=frontend
Annotations:       <none>
Selector:          app=frontend
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                10.108.59.44
IPs:               10.108.59.44
Port:              <unset>  80/TCP
TargetPort:        4200/TCP
Endpoints:         10.1.0.38:4200
Session Affinity:  None
Events:            <none>


Name:              kubernetes
Namespace:         default
Labels:            component=apiserver
                   provider=kubernetes
Annotations:       <none>

Should I be able to hit this locally or not? The demo suggests yes but no URL is given and anything I attempt fails.

Aaron Gibson
  • 1,280
  • 1
  • 21
  • 36
  • 1
    Does this answer your question? [Kubernetes: access from outside](https://stackoverflow.com/questions/61538098/kubernetes-access-from-outside) – chresse May 17 '22 at 10:38

1 Answers1

3

From outside you do not have any way to connect to your service since its type is set to ClusterIP if you want directly to expose your service, you should set it to either type LoadBalancer or NodePort. For more info about these types check this link.

However your service has an internal url ( which works within the cluster, for example if you exec into a pod and curl that url, you will get a response ) and that is: <your service>.<your namespace>.svc.cluster.local

Instead of <your service> type the name of the service and instead of <your namespace> namespace in which that service resides. The rest of the url is the same for all services.

Johnny9
  • 436
  • 5
  • 8