Skip to content

Conversation

@MaciejKaras
Copy link
Collaborator

@MaciejKaras MaciejKaras commented Sep 24, 2025

Summary

We are using Istio as a service mesh provider for our Multi Cluster tests. The way it works by default is Istio adds privileged init-istio container to every Pod that configures network accordingly.

By default Istio injects an init container, istio-init, in pods deployed in the mesh. The istio-init container sets up the pod network traffic redirection to/from the Istio sidecar proxy. This requires the user or service-account deploying pods to the mesh to have sufficient Kubernetes RBAC permissions to deploy containers with the NET_ADMIN and NET_RAW capabilities.

While this works fine it is not meeting the PSS restricted level, thus making it less secure. Related HELP-81729 and #473 that enables restricted level in warn mode. Additionally we provide Istio sidecar configuration as an example in our code snippets thus not following the best practice.

There is another way to configure Istio mesh that does not require istio-init init-container - using Istio CNI node agent. This PR configures our e2e tests and code snippets that way. Great blog entry about difference between istio-init and Istio CNI node agent architecture -> https://www.solo.io/blog/traffic-ambient-mesh-istio-cni-node-configuration.

With istio-init:
image

With Istio CNI node agent:
image

⚠️ Init containers execute before the sidecar proxy starts, which can result in traffic loss during their execution. This can be avoided by setting runAsUser: 1337. More info -> https://istio.io/latest/docs/setup/additional-setup/cni/#compatibility-with-application-init-containers

Proof of Work

Passing CI is enough. Since private_gke_code_snippets are not run automatically in CI I've triggered manual patch to test this -> https://spruce.mongodb.com/version/68d50e694baed3000742566d/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

@github-actions
Copy link

github-actions bot commented Sep 24, 2025

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.6.0 Release Notes

New Features

  • MongoDBCommunity: Added support to configure custom cluster domain via newly introduced spec.clusterDomain resource field. If spec.clusterDomain is not set, environment variable CLUSTER_DOMAIN is used as cluster domain. If the environment variable CLUSTER_DOMAIN is also not set, operator falls back to cluster.local as default cluster domain.
  • Helm Chart: Introduced two new helm fields operator.podSecurityContext and operator.securityContext that can be used to configure securityContext for Operator deployment through Helm Chart.

Bug Fixes

  • Fixed parsing of the customEnvVars Helm value when values contain = characters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was unused

@MaciejKaras MaciejKaras added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Sep 24, 2025
@MaciejKaras MaciejKaras marked this pull request as ready for review September 24, 2025 14:32
@MaciejKaras MaciejKaras requested a review from a team as a code owner September 24, 2025 14:32
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Was this accidentally commited into the scripts/release/kubectl-mongodb folder?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, exactly. This was added mistakenly added during kubectl-mongodb plugin refactoring

Copy link
Member

@mircea-cosbuc mircea-cosbuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great if it passes tests. It's currently failing a couple.

@MaciejKaras MaciejKaras marked this pull request as draft October 10, 2025 13:21
@MaciejKaras MaciejKaras marked this pull request as ready for review October 14, 2025 08:21
@m1kola m1kola removed their request for review October 21, 2025 08:42
Copy link
Contributor

@lsierant lsierant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MaciejKaras MaciejKaras merged commit 2b99a7f into master Oct 22, 2025
37 checks passed
@MaciejKaras MaciejKaras deleted the maciejk/istio-cni-node-agent branch October 22, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants