Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate “Containers sharing the host IPC namespace” (
3. Identify Pods/Workloads using
From Cloud Shell (still in the console):indicates a misconfiguration.Note the namespace and name of the workload where you see
4. Edit each workload and remove
For each Deployment/StatefulSet/DaemonSet found:If you have naked Pods (not managed by a controller):Note: if the pod is part of a Deployment/Set, always edit the controller, not the individual pod.
5. Confirm
Run again from Cloud Shell:No output means no pod is currently configured with
6. (Optional) Add a policy to prevent
OKE doesn’t manage this directly in the OCI Console UI; you use Kubernetes admission controls from the console via Cloud Shell.
If you share a specific OKE version and example YAML with
hostIPC: true) in OCI OKE via the OCI Console, you essentially need to:- Find workloads using
hostIPC: true. - Update their Pod/Deployment specs to remove it.
- Optionally enforce a policy so it doesn’t reappear.
1. Open your OKE cluster from the OCI Console
- Sign in to the OCI Console.
- In the left-hand menu, go to:
Developer Services → Containers & Artifacts → Kubernetes Clusters (OKE). - Select the Compartment where your cluster lives.
- Click your OKE cluster name to open its details page.
2. Connect to the cluster using Cloud Shell from the Console
- On the cluster details page, find the “Access Cluster” or “Cluster Access” section.
- Click “Cloud Shell” (or the Cloud Shell icon in the top-right of the console).
- This opens a terminal at the bottom of the console.
- In the cluster page, click “Copy kubeconfig” or follow the “Access Cluster” instructions:
- Usually:
- Then verify:
- If nodes are shown, you are connected.
- Usually:
3. Identify Pods/Workloads using hostIPC: true
From Cloud Shell (still in the console):- List all pods (all namespaces) including their full spec:
- Or search at deployment level:
hostIPC: true.4. Edit each workload and remove hostIPC: true
For each Deployment/StatefulSet/DaemonSet found:- Edit a Deployment (example):
- In the editor that opens, look for:
- Remove the line
hostIPC: trueentirely (or change tofalse): - Save and exit (in
vi: pressEsc, then:wqand Enter). - Kubernetes will roll out a new ReplicaSet without
hostIPC.
5. Confirm hostIPC is no longer used
Run again from Cloud Shell:hostIPC: true.6. (Optional) Add a policy to prevent hostIPC in the future
OKE doesn’t manage this directly in the OCI Console UI; you use Kubernetes admission controls from the console via Cloud Shell.6.1 Enable Pod Security Admission (recommended on new/newer clusters)
If your cluster uses Kubernetes ≥1.25 and you can label namespaces:-
Choose a Pod Security Standard level, e.g.,
restricted(which disallows host namespaces like hostIPC). -
From Cloud Shell, label your namespaces, for example:
restricted policy will block pods using hostIPC: true.6.2 Or use OPA Gatekeeper / Kyverno (if you already have it)
If Gatekeeper is installed, create a ConstraintTemplate/Constraint that forbidsspec.hostIPC: true. (Ask if you want the exact YAML.)7. If the misconfiguration came from Helm or CI/CD
If workloads are redeployed by Helm or pipelines, you must also:- Update the Helm chart values or YAML manifests in your repo:
- Remove or set
hostIPC: falsein the template:
- Remove or set
- Re‑deploy from your pipeline/Helm to ensure it doesn’t reintroduce the setting.
If you share a specific OKE version and example YAML with
hostIPC: true, I can give an exact patch command or manifest to apply from Cloud Shell.Using CLI
Using CLI
In OKE this is a Kubernetes-level setting (
hostIPC: true in pod specs). Remediation is:-
Make sure you can talk to the cluster via CLI
-
Find workloads using
hostIPC: trueThis flag can be set at pod or pod-template level. -
Edit the manifests to disable host IPC
For each object you found (Deployment, StatefulSet, DaemonSet, Pod):
In the resulting YAML, locate the pod spec and remove or set:Save and exit. Kubernetes will roll out new pods without host IPC. Repeat for any StatefulSets, DaemonSets, or standalone Pods:
-
Verify that host IPC is no longer used
-
(Recommended) Enforce policy so hostIPC cannot be re-enabled
Use Kubernetes Pod Security Admission (if 1.25+) or Gatekeeper.
Option A – Pod Security Admission (namespace labels)
For “restricted” policy level (blocks host IPC):
This will reject new pods with
hostIPC: truein those namespaces. Option B – Gatekeeper constraint (if you have Gatekeeper installed) ExampleK8sPSPHostIPCconstraint:Apply:
- Use
oci ce cluster create-kubeconfigto set kubeconfig. - Use
kubectlto:- discover pods with
hostIPC: true, - edit workloads to remove
hostIPC, - optionally enforce namespace-level Pod Security labels or Gatekeeper constraints.
- discover pods with
Using Python
Using Python
To minimize containers sharing the host IPC namespace in OKE, you need to:
Make sure your local kubeconfig is set to point to your OKE cluster:
2. Python: Find all workloads with
This scans Deployments, StatefulSets, DaemonSets, ReplicaSets, and Pods.
3. Python: Patch workloads to disable
This sets Run this, then verify:
4. Optional: Enforce policy (prevent future
In OKE you can use:
- Detect all workloads using
hostIPC: true. - Patch them to remove or disable
hostIPC. - Optionally enforce a policy so it can’t be reintroduced.
1. Prerequisites
2. Python: Find all workloads with hostIPC: true
This scans Deployments, StatefulSets, DaemonSets, ReplicaSets, and Pods.3. Python: Patch workloads to disable hostIPC
This sets hostIPC: false on matching workloads.4. Optional: Enforce policy (prevent future hostIPC)
In OKE you can use:- OPA Gatekeeper or Kyverno to deny workloads with
hostIPC: true, e.g. a Gatekeeper ConstraintTemplate that rejects.spec.template.spec.hostIPC == true.
Using Terraform
Using Terraform
This setting cannot be controlled on the
oci_containerengine_cluster resource itself. OKE does not expose a cluster‑level Terraform argument to block hostIPC: true; you must enforce this via Kubernetes admission controls (e.g., Pod Security Admission / Pod Security Policies for older versions, or OPA Gatekeeper constraints) applied inside the cluster using kubectl or a Kubernetes‑oriented Terraform provider, or via the OKE Console’s admission policy / security profile configuration.terraform plan for the oci_containerengine_cluster resource alone will show no changes related to hostIPC because that knob is not available on this resource.
