Kubernetes issues with ingress
Don't use port 443 .. use 80 and don't use ssl in pod.Terminate pls on ingress
It's is because you aren't passing the TLS certificate to pgadmin pods.
As mentioned in documentation, you need to provide the certificate and key:
PGADMIN_ENABLE_TLS
Default:
If left un-set, the container will listen on port 80 for connections in plain text. If set to any value, the container will listen on port 443 for TLS connections.
When TLS is enabled, a certificate and key must be provided. Typically these should be stored on the host file system and mounted from the container. The expected paths are /certs/server.crt and /certs/server.key
You have 2 options:
- Provide the key using the
volumes
on your deployment as mentioned here - Use port 80 on deployment and configure the SSL in the Ingress.
From the specs you have provided, you should change the deployment file to:
.. env: - name: PGADMIN_DEFAULT_EMAIL value: "test@test.com" - name: PGADMIN_DEFAULT_PASSWORD value: "test!" ports: - containerPort: 80
Change the service
spec to point to the correct port:
apiVersion: v1kind: Servicemetadata: name: pgadmin-servicespec: selector: frontend: pgadmin ports: - port: 80 targetPort: 80 protocol: TCP
And then, change the ingress to the correct port:
spec: tls: - hosts: - pgadmin.mydomain.com secretName: cert rules: - host: pgadmin.mydomain.com http: paths: - path: / backend: serviceName: pgadmin-service servicePort: 80
The ingress will redirect all request from port 80 to 443 since you are using the nginx.ingress.kubernetes.io/ssl-redirect
annotation