Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outbound connectivity for Init Container #8700

Closed
adarsh-padhi opened this issue Dec 20, 2023 · 15 comments
Closed

Outbound connectivity for Init Container #8700

adarsh-padhi opened this issue Dec 20, 2023 · 15 comments
Labels
kind/bug A bug triage/rotten closed due to lack of information for too long, rejected feature...

Comments

@adarsh-padhi
Copy link

adarsh-padhi commented Dec 20, 2023

What happened?

I am facing an issue where a pod with 2 containers (liquibase & app container) is present. The liquibase container is defined as init container which tries to connect to the database . post valid connection it starts the app container.

When we inject the sidecar container , the init container tries to connect to the database URL , but fails to connect as the sidecar container is not up & running .

getting this connection error in the logs

Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.DatabaseException
 
Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
 
Caused by: java.net.UnknownHostException: demo-database.postgres.database.azure.com

I have used external services & few annotations prescribed in the docs like

traffic.kuma.io/exclude-outbound-tcp-ports-for-uids
traffic.kuma.io/exclude-outbound-udp-ports-for-uids
traffic.kuma.io/exclude-outbound-ports

but getting same error

we are using kuma-CNI

@adarsh-padhi adarsh-padhi added kind/bug A bug triage/pending This issue will be looked at on the next triage meeting labels Dec 20, 2023
@michaelbeaumont
Copy link
Contributor

Can you provide exactly what configuration you used when trying the workarounds in the docs?

@jakubdyszkiewicz
Copy link
Contributor

Hey, what is the version of Kuma?
Can you double check with 2.5.0, because there was a bug in CNI that was fixed by #8319

@jakubdyszkiewicz jakubdyszkiewicz added triage/needs-information Reviewed and some extra information was asked to the reporter and removed triage/pending This issue will be looked at on the next triage meeting labels Jan 2, 2024
@ravish-kumar-maersk
Copy link

Hi @jakubdyszkiewicz
We were using Kuma 2.4.1.

Will upgrade and check for this.

@jakubdyszkiewicz
Copy link
Contributor

Triage: @ravish-kumar-maersk any luck in upgrade?

@ravish-kumar-maersk
Copy link

Hi @jakubdyszkiewicz

Will confirm in a fortnight.

@jakubdyszkiewicz
Copy link
Contributor

Triage: closing due to no activity. Feel free to reopen if this is still the problem with the newest version

@jakubdyszkiewicz jakubdyszkiewicz closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2024
@jakubdyszkiewicz jakubdyszkiewicz added triage/rotten closed due to lack of information for too long, rejected feature... and removed triage/needs-information Reviewed and some extra information was asked to the reporter labels Feb 26, 2024
@adarsh-padhi
Copy link
Author

adarsh-padhi commented Apr 25, 2024

Hii @jakubdyszkiewicz / @michaelbeaumont , we upgraded to kuma version 2.5.2 , and tested this use-case , Unfortunately this issue still persists , can you guide us here.

@slonka slonka reopened this May 29, 2024
Copy link
Contributor

Removing closed state labels due to the issue being reopened.

@github-actions github-actions bot added triage/pending This issue will be looked at on the next triage meeting and removed triage/rotten closed due to lack of information for too long, rejected feature... labels May 29, 2024
@slonka
Copy link
Contributor

slonka commented May 29, 2024

Can you provide exactly what configuration you used when trying the workarounds in the docs?

reposting Mike's question. Also I think it should work with:

traffic.kuma.io/exclude-outbound-ports: "53,5432"

let me know if it works with that setting

@adarsh-padhi
Copy link
Author

Can you provide exactly what configuration you used when trying the workarounds in the docs?

reposting Mike's question. Also I think it should work with:

traffic.kuma.io/exclude-outbound-ports: "53,5432"

let me know if it works with that setting

Hii @slonka , I have tried the solution which you have suggested , its not working too.

@slonka
Copy link
Contributor

slonka commented May 29, 2024

Yeah, traffic.kuma.io/exclude-outbound-ports works only for tcp and DNS can be tcp/udp - so we need to use traffic.kuma.io/exclude-outbound-ports-for-uids

can you try:

traffic.kuma.io/exclude-outbound-ports-for-uids: "*:5432:CONTAINER_UID;*:53:CONTAINER_UID"

?

@adarsh-padhi
Copy link
Author

I have already tested this
https://kuma.io/docs/2.5.x/production/dp-config/dpp-on-kubernetes/#network-calls-to-outside-of-the-mesh
which tells to use similar annotations

traffic.kuma.io/exclude-outbound-tcp-ports-for-uids: "443:1234"
traffic.kuma.io/exclude-outbound-udp-ports-for-uids: "53:1234"

Is the above annotations is different from your suggested one ?

@michaelbeaumont
Copy link
Contributor

@adarsh-padhi just a note, upgrade to Kubernetes v1.29 and Kuma v2.7 if you can. The k8s native sidecar feature support sidesteps all of this.

@adarsh-padhi
Copy link
Author

Hii @slonka , I tried the above solution , it is working with port 5432 , but what if its trying to connect to 443 port ?

facing issue with 443 port , its not able to connect

@slonka
Copy link
Contributor

slonka commented May 29, 2024

As @michaelbeaumont mentioned if you can upgrade k8s to have native sidecar support that would be great, otherwise you need to list all the ports the container is trying reach. So

traffic.kuma.io/exclude-outbound-ports-for-uids: "*:5432:1234;*:53:1234;*:443:1234"

@lahabana lahabana added triage/needs-information Reviewed and some extra information was asked to the reporter and removed triage/pending This issue will be looked at on the next triage meeting labels Jun 3, 2024
@lahabana lahabana closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2024
@lahabana lahabana removed the triage/needs-information Reviewed and some extra information was asked to the reporter label Jun 3, 2024
@lahabana lahabana added the triage/rotten closed due to lack of information for too long, rejected feature... label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug triage/rotten closed due to lack of information for too long, rejected feature...
Projects
None yet
Development

No branches or pull requests

6 participants