Questions tagged [kubernetes-namespace]

Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces.

Namespaces provide a scope for names. Names of resources need to be unique within a namespace, but not across namespaces. Namespaces are a way to divide cluster resources between multiple users.

Namespaces in Kubernetes Docs

33 questions
44
votes
13 answers

How to create Kubernetes Namespace if it does not Exist?

It's a simple question, but I could not find a definite answer for it. Question Is it possible to create a namespace only if it doesn't exist. My objective is to create some service accounts without caring if their namespaces exist or not (if not,…
Rad
  • 4,292
  • 8
  • 33
  • 71
44
votes
7 answers

How to force delete a Kubernetes Namespace?

How do I force delete Namespaces stuck in Terminating? Steps to recreate: Apply this YAML apiVersion: v1 kind: Namespace metadata: name: delete-me spec: finalizers: - foregroundDeletion kubectl delete ns delete-me It is not possible to…
Will Beason
  • 3,417
  • 2
  • 28
  • 46
44
votes
1 answer

Can I connect one service account to multiple namespaces in Kubernetes?

I have couple of namespaces - assume NS1 and NS2. I have serviceaccounts created in those - sa1 in NS1 and sa2 in NS2. I have created roles and rolebindings for sa1 to do stuff within NS1 and sa2 within NS2. What I want is give sa1 certain access…
rahul
  • 3,018
  • 4
  • 29
  • 28
25
votes
8 answers

Keep running into "exceeded its progress dead line" despite changing progressDeadlineSeconds

I'm new AKS, ACR, and DevOps Pipelines and I'm trying to setup a CI/CD pipeline. I have a resource group setup that has both AKS and ACR in it. AKS is using Standard_B2s and only one node at this point since I'm just playing around. Images are being…
cjones
  • 8,384
  • 17
  • 81
  • 175
22
votes
2 answers

What is the "kube-node-lease" namespace for?

I know the purpose of other Kubernetes default namespaces such as: kube-system, default & kube-public, but there is no official document about the kube-node-lease. The only official explanation I've found is: Heartbeats, sent by Kubernetes nodes,…
Ivan Aracki
  • 4,861
  • 11
  • 59
  • 73
13
votes
3 answers

What's the maximum number of Kubernetes namespaces?

Is there a maximum number of namespaces supported by a Kubernetes cluster? My team is designing a system to run user workloads via K8s and we are considering using one namespace per user to offer logical segmentation in the cluster, but we don't…
Brannon
  • 1,286
  • 2
  • 21
  • 36
11
votes
2 answers

How to import a generated Kubernetes cluster's namespace in terraform

In my terraform config files I create a Kubernetes cluster on GKE and when created, set up a Kubernetes provider to access said cluster and perform various actions such as setting up namespaces. The problem is that some new namespaces were created…
user1384377
  • 147
  • 1
  • 8
11
votes
5 answers

How to exclude namespace from fluent-bit logging

Is there a way to exclude certain namespaces in fluent-bit? I would like to exclude certain namespaces, so that fluent-bit doesn't forward all logs created in those namespaces to ELK. Is there a way to do it besides adding annotation to each pod in…
Oren
  • 113
  • 1
  • 1
  • 7
6
votes
1 answer

Priorities in Pods in Kubernetes

I have some burstable pods running in cluster, which I do not want to be killed in case of memory/cpu pressure. Is there any way to increase it's priority or something, so that we do not have to change it's namespace (kube-system for making it…
4
votes
1 answer

Kubernetes, Automatic Service fallback to another namespace

I have multiple environments represented by multiple namespaces in my kubernetes. All application has its service endpoints defined in each namespace. And we have three environments, dev, alpha, and beta. (Which is equivalent of dev, test, and…
Ysak
  • 2,601
  • 6
  • 29
  • 53
3
votes
1 answer

Is there a way to cancel namespace termination in kubernetes?

One of my namespace is in Terminating state. While there are many posts that explain how to forcefully delete such namespaces. The ultimate result is that everything in your namespace will be gone. Which is not what you might want especially if that…
Piotr
  • 317
  • 1
  • 13
3
votes
2 answers

Difference between Kubernetes namespace and Linux namespaces?

What exactly is Kubernetes namespace and how is it different from linux namespaces (mnt,pid,net,ipc,uts,user,cgroup)?
karthik v
  • 1,104
  • 1
  • 14
  • 22
3
votes
2 answers

How to assign cluster, namespace and pod name in kubernetes yaml file's environment variable

I have a requirement to pass cluster, namespace and pod name to AppDynamics agent from my container deployed in Kubernetes cluster. I tried something as below, but that does not work. containers: - env: - name: JAVA_OPTS …
2
votes
2 answers

CKA Network Policy question for ingress traffic

Create an NetworkPolicy named cka-netpol in the namespace netpol. 1] Allow the pods to communicate if they are running on port 8080 within the namespace. 2] Ensure the NetworkPolicy doesn’t allow other pods that are running other than port 8080. 3]…
2
votes
2 answers

Kubernetes: Having same host name but different paths in ingresses in different namespaces in Kubernetes

I want to use the same hostname e.g. example.com in two different namespaces with different paths. e.g. in namespace A I want example.com/clientA and in namespace B I want example.com/clientB. Any ideas on how to achieve this?
devcloud
  • 391
  • 5
  • 18
1
2 3