name: backend
namespace: backend-proto
labels:
app: backend
annotations:
deployment.kubernetes.io/revision: '3'
spec:
replicas: 3
selector:
matchLabels:
app: backend
template:
metadata:
labels:
app: backend
spec:
containers:
- name: backend
image: '172.17.66.126:5000/backend'
ports:
- containerPort: 6001
protocol: TCP
imagePullPolicy: Always
restartPolicy: Always
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 75%
maxSurge: 25%
service.yml:
kind: Service
apiVersion: v1
metadata:
name: backend
namespace: backend-proto
labels:
app: backend
spec:
ports:
- name: http
protocol: TCP
port: 80
targetPort: 9000
selector:
app: backend
clusterIP: 10.233.50.37
type: ClusterIP
ingress.yml:
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
name: backend
namespace: backend-proto
labels:
app: backend
spec:
backend:
serviceName: backend
servicePort: 80
rules:
- host: backend
http:
paths:
- path: /
backend:
serviceName: backend
servicePort: 80
Поды в UP, сервис поды видит.
curl backend
curl: (7) Failed to connect to backend port 80: В соединении отказано
И почему-то в адресах пусто:
kubectl -n backend-proto get ingress
NAME HOSTS ADDRESS PORTS AGE
backend backend 80 72s
> service.yaml > type: LoadBalancer
Обсуждают сегодня