i’ve learning k8s, and i facing a problem. this is my maniest.
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 2
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: cesarags/web-color-private:blue
ports:
- containerPort: 80
imagePullSecrets:
- name: docker-auth
---
apiVersion: v1
kind: Service
metadata:
name: web
spec:
selector:
app: web
ports:
- protocol: TCP
port: 80
targetPort: 80
nodePort: 30000
type: NodePort
I’m using k8s to check status, and show that all its runing, but when i enter localhost:30000 dont work. If remove Kind: Service and try again making a port-forward wok fine. Also if i create onlya Pod work, but when i use a Service semm that somethings its blocked. Im using wsl2 and k3d.
Another test that i made was
kubectl run -i –tty –rm debug –image=busybox — sh
Hi guys, i’ve learning k6s, and i facing a problem. this is my maniest.
`apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 2
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
– name: web
image: cesarags/web-color-private:blue
ports:
– containerPort: 80
imagePullSecrets:
– name: docker-auth
apiVersion: v1
kind: Service
metadata:
name: web
spec:
selector:
app: web
ports:
– protocol: TCP
port: 80
targetPort: 80
nodePort: 30000
type: NodePort`
I’m using k8s to check status, and show that all its runing, but when i enter localhost:30000 dont work. If remove Kind: Service and try again making a port-forward wok fine. Also if i create onlya Pod work, but when i use a Service semm that somethings its blocked. Im using wsl2 and k3d.
Another test that i made was use busybox, that show me the html page. but via browser i cant acess.
kubectl run -i –tty –rm debug –image=busybox — sh
wget -qO- http://web:80
cesar augusto gadelha santos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.