replicas: 2
selector:
matchLabels:
app: test
template:
metadata:
labels:
app: test
spec:
containers:
- name: test
image: registry.ser60v.com/instagram/test:0.0.12
imagePullPolicy: Always
env:
- name: PORT
value: "80"
- name: DB_USER
valueFrom:
secretKeyRef:
name: prod-postgres
key: username
- name: DB_PASS
valueFrom:
secretKeyRef:
name: prod-postgres
key: password
- name: DB_NAME
valueFrom:
secretKeyRef:
name: prod-postgres
key: database
ports:
- containerPort: 80
imagePullSecrets:
- name: gitlab-auth
---
apiVersion: v1
kind: Service
metadata:
name: test
spec:
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
selector:
app: test
По физ адресу всё ок
> curl http://10.88.1.22/v1/test
{"reports":[{"id":1,"user_name":"1","user_password":"1","email":"1","email_password":"1","proxy":"1","process_id":"1","locked_timestamp":"2021-07-20T12:56:40.129Z"}]}
> curl http://test
curl: (7) Failed to connect to test port 80: Connection refused
По сервису хрен там
если по dn внутри кластера то надо указывать полное dn сервиса
Бля, спасибо, дважды на одни грабли за сегодня наступаю =\
Обсуждают сегодня