DMCA.com Protection Status Trending Topics About Devops: ReplicationController Kubernetes

Wednesday, 2 June 2021

ReplicationController Kubernetes

 

vi moon.yml

***************************************************

apiVersion: v1

kind: ReplicationController

metadata:

  name: nginx

spec:

  replicas: 7

  selector:

    type: nginx

  template:

    metadata:

      name: nginx

      labels:

        type: nginx

    spec:

      containers:

      - name: nginx

        image: nginx

*************************************************************

create service 

vi service123.yml
*********************************

apiVersion: v1
kind: Service
metadata:
 name: mysvc
spec:
 type: NodePort
 ports:
  - targetPort: 80
    port: 1234
    nodePort: 30008
 selector:
  type: nginx

********************************************************


check service 

*******************
kubectl describe svc mysvc 

**************************

check endpoints also 


kubectl get pods -o wide

******************************

DELETE POD


kubectl delete pod <podname>

*********************************************

REMOVE LABEL 


*****************************
kubectl label pod <podename> type-


*******************************************************


I want to delete ReplicationController but not pods 


kubectl delete rc --cascade=false podname





***************************************************








No comments: