3

I deployed postgresql to okteto with the following configurations:

enter image description here

And then I add


  annotations:
    dev.okteto.com/auto-ingress: "true"

to the service/postgresql.

Now the dashboard shows:

enter image description here

But if I clicked the link above, it shows my environment is ready... thing. And if I tried to connect the url with adminer, it would fail.

enter image description here

How can I connect to the postgresql from public network?

Thanks in advance!

PS: I want my adminer deployed on heroku can connect to it without port forwarding.

Currently I can only enable the public accessing with port forwarding that as shows from the okteto log:

kubectl port-forward --namespace your-namespace svc/postgresql 5432:5432 &
PGPASSWORD="$POSTGRES_PASSWORD" psql --host 127.0.0.1 -U okteto -d okteto -p 5432
Jeff Tian
  • 5,210
  • 3
  • 51
  • 71

1 Answers1

5

Okteto Cloud doesn't support exposing non-https ports through the auto-ingress feature, it's only meant for services.

In the particular case, you get the error because it's expecting a deployment on port 8080 (the default port when it can't find the deployment behind). I'll work with the team to update the docs and to have that kind of situations give you a clear error message.

The scenario should work if you deploy adminer in the same Okteto Cloud namespace as your DB. Any reason why you are running it on Heroku?

Jeff Tian
  • 5,210
  • 3
  • 51
  • 71
Ramiro Berrelleza
  • 2,254
  • 1
  • 15
  • 27
  • 1
    Thanks for your reply! There is a long story that I deploy `adminer` on heroku, but forget it. I can connect the `postgresql` in Okteto with **port forwarding** and it works pretty good. – Jeff Tian Mar 26 '20 at 06:19
  • You can now also deploy PGAdmin directly from the Okteto Cloud catalog. – Ramiro Berrelleza May 24 '20 at 16:50
  • 1
    Thank you @Ramiro, I've also deployed adminer to okteto. And will try deploy PGAdmin later. By the way, okteto is blocked by GFW recently, sad. – Jeff Tian May 25 '20 at 01:46
  • You can also use port-forwarding, I wrote a post on that yesterday, in case it's helpful https://okteto.com/blog/connecting-to-database-with-port-forwarding/ – Ramiro Berrelleza Aug 04 '20 at 23:28