'Minikube ClusterIP not reachable
i have created a deployment and a service to deploy an angular app. I'm using minikube and here is my deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: angular-deployment
spec:
selector:
matchLabels:
app: angular
replicas: 1
template:
metadata:
labels:
app: angular
spec:
containers:
- name: angular
image: dhartl231198/k3s-dashboard
imagePullPolicy: Always
ports:
- containerPort: 80
kind: Service
apiVersion: v1
metadata:
name: angular-service
spec:
selector:
app: angular
ports:
- protocol: TCP
port: 8080
targetPort: 80
type: ClusterIP
the deployment is already reachable within the cluster but i cannot access it from my machine.
Solution 1:[1]
You haven't exposed your Service to outside of your cluster. That's why you can't access the Service from your local machine.
Now, you have two options:
- Make the Service type
NodePort, then follow this official minikube guide. - Use
kubectl port-forward svc/angular-service :8080on a terminal. Then, use the forwarded port to connect from the local machine.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Emruz Hossain |
