How to add namespace and my next steps in Azure AKS cluster

Girish Prajwal 706 Reputation points
2020-10-16T09:13:03.977+00:00

Hi Team,

I am new to Azure AKS service.

WE have existing AKS cluster configured in the environment. We now need to add new namespace and configure the next course of steps accordingly.

Could you please suggest my step by step activities as this would help me understand the service better.

As per my understanding,

AKS Namespace
Create a service connection to the namespace
persistent storage or create disk volumes for new namespace or can we use existing storage/disks
download/import the container images
Manifest for the container images

Correct me if I am wrong on the above list.

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,447 questions
{count} votes

3 answers

Sort by: Most helpful
  1. prmanhas-MSFT 17,946 Reputation points Microsoft Employee Moderator
    2020-10-16T09:30:10.74+00:00

    @Girish Prajwal Thank you for your query!!!

    Kubernetes resources, such as pods and Deployments, are logically grouped into a namespace. These groupings provide a way to logically divide an AKS cluster and restrict access to create, view, or manage resources. You can create namespaces to separate business groups, for example. Users can only interact with resources within their assigned namespaces.

    You can read more about it here

    Steps to create new namespace are as below:

    Create a new YAML file called my-namespace.yaml with the contents:

    apiVersion: v1  
    kind: Namespace  
    metadata:  
      name: <insert-namespace-name-here>  
    

    Then run:

    kubectl create -f ./my-namespace.yaml  
    

    Alternatively, you can create namespace using below command:

    kubectl create namespace <insert-namespace-name-here>  
    

    The name of your namespace must be a valid DNS label.

    You can find more info here.

    To know more about namespace scenarios refer to this article.

    Moreover since you mentioned that you are new to Azure AKS I will recommend you refer to our official doc which might be handy in your scenario and have really good insights :)

    Hope it helps!!!

    Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics


  2. Kasun Rajapakse 431 Reputation points
    2020-10-16T19:17:03.143+00:00

    Adding to @prmanhas-MSFT answer for your scenario, we can help you to achieve the task but it's not possible for us to provide the config YAML. What you can do is try out and if you have some blockers post on here so we can answer them.

    You may need to check the following documentations

    1. Deployments
    2. Namespaces
    3. Persistent Volumes & PVC
    0 comments No comments

  3. Kasun Rajapakse 431 Reputation points
    2020-10-20T03:55:22.9+00:00

    Hi,

    You can use the existing PV as its not a namespace wise resource. But for the PVC you have to remove the existing one and create a PVC in the namespace


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.