<p>So I am trying to configure postgresql with pgadmin access, I have managed to get postgresql and pgadmin deployed but issues appears when I try to login into pgadmin UI.</p>
<p>My k8s cluster is on google cloud platform.</p>
<p>Cluster info.</p>
<pre><code>Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;18&quot;, GitVersion:&quot;v1.18.4&quot;, GitCommit:&quot;c96aede7b5205121079932896c4ad89bb93260af&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-06-18T17:02:08Z&quot;, GoVersion:&quot;go1.13.12&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;14+&quot;, GitVersion:&quot;v1.14.10-gke.36&quot;, GitCommit:&quot;34a615f32e9a0c9e97cdb9f749adb392758349a6&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-04-06T16:33:17Z&quot;, GoVersion:&quot;go1.12.12b4&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<p>This is pgadmin-deployment.yaml:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: pgadmin
spec:
  selector:
    matchLabels:
      frontend: pgadmin
  replicas: 1
  template:
    metadata:
      labels:
        frontend: pgadmin
    spec:
     containers:
     - name: pgadmin
       image: dpage/pgadmin4
       imagePullPolicy: &quot;IfNotPresent&quot;
       env:
       - name: PGADMIN_DEFAULT_EMAIL
         value: &quot;test@test.com&quot;
       - name: PGADMIN_DEFAULT_PASSWORD
         value: &quot;test!&quot;
       - name: PGADMIN_LISTEN_PORT
         value: &quot;443&quot;
       ports:
       - containerPort: 443
</code></pre>
<p>Here is mine pgadmin-service.yaml</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: pgadmin-service
spec:
  type: ClusterIP
  selector:
    frontend: pgadmin
  ports:
    - port: 9210
      targetPort: 443
      protocol: TCP
</code></pre>
<p>Also I have certmanager and nginx ingress installed on the cluster.</p>
<p>Nginx installation steps:</p>
<pre><code>helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm install my-ingress stable/nginx-ingress --set rbac.create=true
</code></pre>
<p>Cert-Manager install steps:</p>
<pre><code>kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.15.1/cert-manager-legacy.crds.yaml
kubectl create namespace cert-manager
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install \
  cert-manager jetstack/cert-manager \
  --namespace cert-manager \
  --version v0.15.1 \
  # --set installCRDs=true
</code></pre>
<p>My issuer.yaml</p>
<pre><code>apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
  name: letsencrypt-prod
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: &quot;my@email.com&quot;
    privateKeySecretRef:
      name: letsencrypt-prod
    solvers:
      - http01:
          ingress:
            class: nginx
</code></pre>
<p>My certificate.yaml</p>
<pre><code>apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
  name: mydomain.com
spec:
  secretName: cert
  issuerRef:
    name: letsencrypt-prod
    kind: ClusterIssuer
  commonName: mydomain.com
  dnsNames:
    - pgadmin.mydomain.com
  acme:
    config:
      - http01:
          ingressClass: nginx
        domains:
          - pgadmin.mydomain.com
</code></pre>
<p>And finally ingress-service.yaml</p>
<pre><code> apiVersion: networking.k8s.io/v1beta1 #networking.k8s.io/v1beta1 # for versions before 1.14 use extensions/v1beta1
 kind: Ingress
 metadata:
   name: example-ingress
   namespace: default
   annotations:
     kubernetes.io/ingress.class: nginx
     nginx.ingress.kubernetes.io/rewrite-target: /
     cert-manager.io/cluster-issuer: &quot;letsencrypt-prod&quot;
     nginx.ingress.kubernetes.io/ssl-redirect: 'true'
     nginx.ingress.kubernetes.io/use-regex: 'true'
 spec:
   tls:
    - hosts:
        - pgadmin.mydomain.com
      secretName: cert
   rules:
     - host: pgadmin.mydomain.com
       http:
         paths:
         - path: /
           backend:
             serviceName: pgadmin-service
             servicePort: 9210
</code></pre>
<p>Currently my issue is when I try to login into my pgadmin UI, I get the following error:
<a href="https://i.stack.imgur.com/6hBqY.png" rel="nofollow noreferrer">error</a></p>
<p>Container logs: <a href="https://i.stack.imgur.com/dS8Xa.png" rel="nofollow noreferrer">logs</a></p>
<p>My domain is located behind CloudFlare. <a href="https://i.stack.imgur.com/atMty.png" rel="nofollow noreferrer">tls settings</a></p>
<p>If anything else is needed please let me know.</p>

<p>Don't use port 443 .. use 80 and don't use ssl in pod.Terminate pls on ingress</p>
