Move pods from default system pool to user pool

JMN-2253 636 Reputation points
2023-05-12T04:40:12.7166667+00:00

Hi there,

I'm new one to this infinite game, and looking for your help.

Did much research on how to move pods from the default system pool to the user pool, and all the results recommend deleting the containers and recreating them.

How can I achieve it with 0 downtime?

What is the command to build a new one on the node pool called linuxdev while keeping the internal IP?

What is the command to delete the old one?

Thanks

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,459 questions
0 comments No comments
{count} votes

Accepted answer
  1. Prrudram-MSFT 28,366 Reputation points Microsoft Employee Moderator
    2023-05-12T07:14:18.8566667+00:00

    @JMN-2253

    Hello! I'd be happy to help you with your questions.

    To move pods from the default system pool to a user pool, you can use the kubectl cordon command to mark the node as unschedulable, then use the kubectl drain command to evict the pods from the node. Once the pods are evicted, you can delete the node pool and create a new one with the desired configuration.

    To minimize downtime, you can create the new node pool before evicting the pods, and then use the kubectl uncordon command to mark the new node pool as schedulable once it is ready.

    To build a new container on a node pool called linuxdev while keeping the internal IP, you can use the kubectl apply command with a YAML file that specifies the new pod configuration. Here's an example YAML file:

    apiVersion: v1
    kind: Pod
    metadata:
      name: my-pod
    spec:
      nodeName: linuxdev
      containers:
      - name: my-container
        image: my-image
    

    You can save this YAML file to a file called my-pod.yaml, and then apply it to your cluster with the following command:

    kubectl apply -f my-pod.yaml
    

    To delete the old container, you can use the kubectl delete command with the name of the pod**1**. Here's an example command:

    kubectl delete pod <pod-name>
    

    This command will delete the specified pod, which will cause it to be recreated on a different node if necessary.

    If the answer provided has helped, please "Accept Answer" and click on Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.