assistanz
Assistanz

Steps to create a POD with labels using KUBECTL and YAML

create a POD with labels using KUBECTL and YAML

Steps to create a POD with labels using KUBECTL and YAML

In this blog, we will show you the steps to create a POD with labels using KUBECTL and YAML file in your environment.

REQUIREMENTS

  • 2 Node Cluster ( 1 Master VM with 2 Nodes)
  • Kubernetes Components

INFRASTRUCTURE OVERVIEW

  • We have already installed and configured the 2 Node cluster in our demo environment.

CREATING POD WITH LABELS USING KUBECTL

  • Log into the master server through putty.
Steps to create a POD with labels using KUBECTL and YAML
  • use the below command to create a pod with labels.
Syntax: kubectl run --image= --port= --labels="," --generator=run-pod/v1 Example: kubectl run lab-pod --image=nginx --port=80 --labels="app=web,env=dev" --generator=run-pod/v1 Steps to create a POD with labels using KUBECTL and YAML
  • The command executed successfully.
Steps to create a POD with labels using KUBECTL and YAML
  • After few seconds, the POD will be in running state.
Steps to create a POD with labels using KUBECTL and YAML
  • you can verify the label details using the describe command.
kubectl describe pod lab-pod Steps to create a POD with labels using KUBECTL and YAML Steps to create a POD with labels using KUBECTL and YAML

CREATING POD WITH LABELS USING YAML

  • Create a YAML file and paste the below coding.
Steps to create a POD with labels using KUBECTL and YAML
apiVersion: v1 kind: Pod metadata:     name: new-pod     labels:        app: web        env: test spec:      containers:         - name: test-cont           image: nginx
Steps to create a POD with labels using KUBECTL and YAML
  • Save and close the file.
  • Use the below command to create a POD using the YAML file.
Steps to create a POD with labels using KUBECTL and YAML
  • Command executed successfully.
Steps to create a POD with labels using KUBECTL and YAML
  • After few seconds, the POD will be in running state.
Steps to create a POD with labels using KUBECTL and YAML

LISTING THE POD LABELS

  • We can list the all pod labels using this command.
kubectl get pods --show-labels Steps to create a POD with labels using KUBECTL and YAML
  • We can also use the label selector to filter the required pods.
kubectl get pods -l env=test Steps to create a POD with labels using KUBECTL and YAML

Kubernetes

CREATE A NEW LABEL FOR A POD

  • use the below command to create a new label for a pod.
Syntax: kubectl label

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support