How to isolate one node from other pod

I’m trying to figure out some way to isolate my pod. I’m building an Android app in one pod and I’m using nodeSelector to specify that node. The problem is isolate the rest of my pods to don’t access the app node. I’m doing this because I need set some configs in my node for app build works fine.

If you know how to help me, I’m really gratefull!

Hi @rafamttz

Network Policies - Kubernetes should help in your case.

1 Like

Thanks for the answer @tomasz.prus,
Can I isolate my nodes with Network Policies? I’m using Oracle Cloud K8S Cluster so I can’t set up Admission Controllers in master.

Here is link how to enable Network Policies on Oracle K8s: https://docs.cloud.oracle.com/iaas/Content/ContEng/Tasks/contengsettingupcalico.htm

But now I’m not sure if I understood your question correctly:

do you mean the network isolation or to not start pods on the app node?

@tomasz.prus, I want to isolate my node from other pods. Just one pod running in one node.

You mentioned that you already use nodeSelector for the one pod, so I guess that other pods should be scheduled on different nodes without modifying their spec. To prepare such setup you can use “node taints”: Taints and Tolerations - Kubernetes.

1 Like