Create a Kubernetes namespace -The BD-Intel

Namespaces are pivotal to better Kubernetes the board. Figure out how to make another namespace and afterward send a unit to it.

Inside the domain of Kubernetes, a namespace is utilized in specific conditions where various clients are spread across groups or tasks. By utilizing namespaces, it is conceivable to separate assets between clients without running into name impact.

For instance: Within a Kubernetes bunch, you can’t have units of a similar name. In any case, by utilizing namespaces, those units with a similar name can be disconnected inside a namespace, to such an extent that Kubernetes will have no issue with their reality. At the end of the day, namespaces are such a virtual bunch. Along these lines as having various visitor VMs on a host, you can have numerous namespaces on a solitary bunch.

After conveying your Kubernetes group, you’ll find in any event three fundamental namespaces:

default – Used for organizations not given a namespace

kube-framework – Used for everything identified with the Kubernetes framework

kube-open – Readable by everybody, except held for framework utilize as it were

You can see the rundown of current namespaces by giving the order:

kubectl get namespaces

You should see those three namespaces at the very least (Figure A).

Figure A

The fundamental namespaces are recorded with a couple of extra in my test group.

What you’ll require

So as to make another namespace, you’ll need a Kubernetes bunch ready for action. In the event that you’ve not effectively dealt with that, follow the means in: How to send a Kubernetes group on Ubuntu server.

Step by step instructions to make a namespace

How about we make a namespace called organizing. To do that, open a terminal window on your Kubernetes controller and issue the order:

kubectl make namespace organizing

The kubectl order will report back the namespace has been made (Figure B).

Figure B

Our organizing namespace has been made.

Step by step instructions to convey a case to a namespace

Since we’ve made our namespace, how would we convey to it? That is simple. Let’s assume you need to convey a NGINX unit to the new organizing namespace. For that you would give the order:

kubectl run nginx – image=nginx – namespace=staging

The kubectl order will report back that your unit has been made (Figure C).

Figure C

Our NGINX case has been conveyed to the arranging namespace.

To guarantee the case was in certainty sent to the arranging namespace, issue the order:

kubectl get cases – namespace=staging

The kubectl order will report back that the NGINX case is running (Figure D).

Figure D

Our NGINX case is running.

Step by step instructions to set the default namespace

Suppose you’ve made a namespace you expect to consistently use as your default. Rather than utilizing the – namespace= choice in your sending/the executives orders, you could generally set that new namespace as the default.

To do that, you would give the order:

kubectl config set-setting – current – namespace=NAMESPACE

Where NAMESPACE is the name of the namespace you wish to use as the default.

Presently, if you somehow managed to send that NGINX case to the organizing namespace (which we’ve set as our default), the order would essentially be:

kubectl run nginx – image=nginx

What’s more, that is everything to making a Kubernetes namespace. Play around with this component so you’re positive about its use since you will in the long run need namespaces to make your bunches simpler to oversee.

Leave a Reply

Your email address will not be published. Required fields are marked *