kubegres
kubegres copied to clipboard
service clusterip: none , is this normal?
Hi,
after installing postgres with kubegres i see there is no ips on service mypostgres/mypostgres-replica. How can this work?
kubernetes: MicroK8s v1.25.4 revision 4221 kubegres: 1.16
Steps:
1. kubectl apply -f https://raw.githubusercontent.com/reactive-tech/kubegres/v1.16/kubegres.yaml
2. create secret
3. deploy this yaml:
apiVersion: kubegres.reactive-tech.io/v1
kind: Kubegres
metadata:
name: mypostgres
namespace: default
spec:
replicas: 3
image: postgres:latest
database:
size: 1000Mi
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: mypostgres-secret
key: superUserPassword
- name: POSTGRES_REPLICATION_PASSWORD
valueFrom:
secretKeyRef:
name: mypostgres-secret
key: replicationUserPassword
5: results:
k8sadm@microk8s-nas:~$ kubectl get all -l 'app=mypostgres' --show-managed-fields -A -o wide
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
default pod/mypostgres-1-0 1/1 Running 0 88m 10.1.91.141 microk8s-nas <none> <none>
default pod/mypostgres-2-0 1/1 Running 0 87m 10.1.69.16 microk8s-node2 <none> <none>
default pod/mypostgres-3-0 1/1 Running 0 86m 10.1.91.143 microk8s-nas <none> <none>
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
default service/mypostgres ClusterIP None <none> 5432/TCP 88m app=mypostgres,replicationRole=primary
default service/mypostgres-replica ClusterIP None <none> 5432/TCP 86m app=mypostgres,replicationRole=replica
NAMESPACE NAME READY AGE CONTAINERS IMAGES
default statefulset.apps/mypostgres-1 1/1 89m mypostgres-1 postgres:latest
default statefulset.apps/mypostgres-2 1/1 88m mypostgres-2 postgres:latest
default statefulset.apps/mypostgres-3 1/1 86m mypostgres-3 postgres:latest
dns tests:
k8sadm@microk8s-nas:~$ kubectl get svc -A -l "k8s-app=kube-dns" -o wide
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
kube-system kube-dns ClusterIP 10.152.183.10 <none> 53/UDP,53/TCP,9153/TCP 4h54m k8s-app=kube-dns
k8sadm@microk8s-nas:~$ nslookup mypostgres.svc.cluster.local 10.152.183.10
Server: 10.152.183.10
Address: 10.152.183.10#53
** server can't find mypostgres.svc.cluster.local: NXDOMAIN
regards
ok i read that it was by design.
but how can we use postgres outside the cluster? i want to connect to it with dbeaver for example?
regards.
Add a ingress? or manually add another service as NodePort? I think inthery you should be able to add your own service there should be any conflict between them.
i finaly added a new service with external ip:
service/mypostgres-tcp-service LoadBalancer 10.152.183.217 172.16.99.99 5432:30127/TCP 12h
Le 04/01/2023 à 12:24, Lazy coder a écrit :
Add a ingress? or manually add another service as NodePort? I think inthery you should be able to add your own service there should be any conflict between them.
— Reply to this email directly, view it on GitHub https://github.com/reactive-tech/kubegres/issues/144#issuecomment-1370804102, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMB4IMBO6L4D63HPZXPKMDWQVMYTANCNFSM6AAAAAATPDPFCM. You are receiving this because you authored the thread.Message ID: @.***>
--
Gaétan
Only doctor Who can reboot the universe.