# SSL enabled postgres - kong migration fails

**URL:** <https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [August 16, 2019, 10:12am UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248 "2019-08-16T10:12:53Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![swapnild2111](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/swapnild2111/32/1197_2.png) [@swapnild2111](https://discuss.konghq.com/u/swapnild2111)\
**Post date:** [August 16, 2019, 10:12am UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/1 "2019-08-16T10:12:53Z")

</div>

Kong migration job fails for SSL. When I specify KONG\_PG\_SSL as “true”, it says field is immutable.

```auto
$ k logs pod/kong-migrations-wq4d6 -n apigateway
Error: [PostgreSQL error] failed to retrieve server_version_num: FATAL: SSL connection is required. Please specify SSL options and retry.

  Run with --v (verbose) or --vv (debug) for more details

```

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [August 16, 2019, 3:40pm UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/2 "2019-08-16T15:40:35Z")

</div>

Can you share the YAML manifest of the migration job?  
And how are you installing Kong?

---

<div class="post-metadata">

**Author:** ![swapnild2111](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/swapnild2111/32/1197_2.png) [@swapnild2111](https://discuss.konghq.com/u/swapnild2111)\
**Post date:** [August 18, 2019, 9:49pm UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/3 "2019-08-18T21:49:13Z")

</div>

Hello @hbagdi  
I am using [https://raw.githubusercontent.com/Kong/kubernetes-ingress-controller/master/deploy/single/all-in-one-postgres.yaml](https://raw.githubusercontent.com/Kong/kubernetes-ingress-controller/master/deploy/single/all-in-one-postgres.yaml)

And installed in one namespace of k8s cluster.

It works great if SSL if Off on Postgres database.  
Can you share an example of SSL properties yaml?

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [August 19, 2019, 1:01am UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/4 "2019-08-19T01:01:01Z")

</div>

> [@swapnild2111](#):
>
> When I specify KONG\_PG\_SSL as “true”, it says field is immutable.

Where do you specify it?  
Please make sure that you specify the field before you apply the above manifest.  
Also, it might be happening that the migration `Job` already exists, in which case, please delete it first from your k8s cluster and then apply the update manifest.

It would be nice if you could PR this change of turning SSL on by default for Postgres and Kong communication.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![swapnild2111](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/swapnild2111/32/1197_2.png) [@swapnild2111](https://discuss.konghq.com/u/swapnild2111)\
**Post date:** [August 19, 2019, 7:42am UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/5 "2019-08-19T07:42:15Z")

</div>

Yes it was part of manifest before I applied it.

But Yes you are right. Job was already there and they with SSL field I was applying manifest.  
I used `kubectl apply --force` to make it work 🙂

I am not sure if we should PR this, my Postgres has SSL On, but may be not case with everyone. Rather we can add few lines in documentation. What do you think?

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [August 19, 2019, 5:03pm UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/6 "2019-08-19T17:03:56Z")

</div>

> [@swapnild2111](#):
>
> I am not sure if we should PR this, my Postgres has SSL On, but may be not case with everyone. Rather we can add few lines in documentation. What do you think?

Did you have to configure anything in Kong or Postgres deployment other than changing values of environment values? If not, then we can include this in the default deployment for a little more secure and sane deployment.  
If yes, then we should let users decide what is best for them.

---

<div class="post-metadata">

**Author:** ![swapnild2111](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/swapnild2111/32/1197_2.png) [@swapnild2111](https://discuss.konghq.com/u/swapnild2111)\
**Post date:** [August 20, 2019, 9:02am UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/7 "2019-08-20T09:02:05Z")

</div>

Makes sense. Sure lets have PR. How do I raise it? Never done before.

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [August 20, 2019, 4:28pm UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/8 "2019-08-20T16:28:20Z")

</div>

You will need a Github account and then fork the following repository:

> **[Kong/kubernetes-ingress-controller](https://github.com/kong/kubernetes-ingress-controller)**
>
> Use Kong for Kubernetes Ingress. Contribute to Kong/kubernetes-ingress-controller development by creating an account on GitHub.

The files that you will need to edit are here: [https://github.com/Kong/kubernetes-ingress-controller/tree/master/deploy/manifests](https://github.com/Kong/kubernetes-ingress-controller/tree/master/deploy/manifests)

Let me know if you have any questions.

---

<div class="post-metadata">

**Author:** ![swapnild2111](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/swapnild2111/32/1197_2.png) [@swapnild2111](https://discuss.konghq.com/u/swapnild2111)\
**Post date:** [August 22, 2019, 8:24am UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/9 "2019-08-22T08:24:22Z")

</div>

Created Pull requests - [https://github.com/swapnild2111/kubernetes-ingress-controller/pulls](https://github.com/swapnild2111/kubernetes-ingress-controller/pulls)  
Please take a look 🙂

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [August 22, 2019, 4:21pm UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/10 "2019-08-22T16:21:00Z")

</div>

Please send the Pull Request against `kong/kubernetes-ingress-controller` repository.  
You have opened up Pull Requests against the fork itself, meaning you will merge in the changes in your copy of the code only.

---

<div class="post-metadata">

**Author:** ![swapnild2111](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/swapnild2111/32/1197_2.png) [@swapnild2111](https://discuss.konghq.com/u/swapnild2111)\
**Post date:** [August 22, 2019, 7:13pm UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/11 "2019-08-22T19:13:06Z")

</div>

Here it is: [https://github.com/Kong/kubernetes-ingress-controller/pull/368](https://github.com/Kong/kubernetes-ingress-controller/pull/368)

---

<div class="post-metadata">

**Author:** ![jesse](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@jesse](https://discuss.konghq.com/u/jesse)\
**Post date:** [April 30, 2021, 8:27am UTC](https://discuss.konghq.com/t/ssl-enabled-postgres-kong-migration-fails/4248/12 "2021-04-30T08:27:38Z")

</div>

May I ask is this problem resolved ? I have the same issue while I use this file to deploy kong ingress in K8S cluster  
[https://raw.githubusercontent.com/Kong/kubernetes-ingress-controller/master/deploy/single/all-in-one-postgres.yaml](https://raw.githubusercontent.com/Kong/kubernetes-ingress-controller/master/deploy/single/all-in-one-postgres.yaml)
