'개발 및 관리/클라우드'에 해당되는 글 15건

  1. 2023.09.01 K8S, Services Command, Services-LoandBalancer
  2. 2023.08.29 K8S, Services Command
  3. 2023.08.28 K8S, Deployment Command
  4. 2023.08.28 K8S, ReplicaSets Command
  5. 2023.08.03 쿠버네티스 KCA 관련 자료 URL
반응형

apiVersion: v1
kind: Service
metadata:
  name: myapp-service

spec:
  type: LoadBalancer
  ports:
   - targetPort: 80
     port: 80
     nodePort: 30008

----------------------------------------------------------------------------------------------

apiVersion: v1
kind: Service
metadata:
  name: webapp-service
spec:
  type: NodePort
  ports:
   - targetPort: 8080
     port: 8080
     nodePort: 30080
  selector:
    name: simple-webapp

kubectl create -f service-definition-1.yaml

----------------------------------------------------------------------------------------------

kubectl get service
kubectl get svc
kubectl describe svc kubernetes
kubectl describe deploy
kubectl describe deploy simple-webapp-deployment

----------------------------------------------------------------------------------------------

반응형

'개발 및 관리 > 클라우드' 카테고리의 다른 글

Container와 Devops, MSA  (0) 2023.09.06
K8S Imperative / Declarative Commands  (0) 2023.09.04
K8S, Services Command  (0) 2023.08.29
K8S, Deployment Command  (0) 2023.08.28
K8S, ReplicaSets Command  (0) 2023.08.28

K8S, Services Command

개발 및 관리/클라우드 2023. 8. 29. 08:59 posted by HighLighter
반응형

service-definition.yml

apiVersion: v1
kind: Service
metadata:
  name: back-end

spec:
  type: ClusterIP
  ports:
   - targetPort: 80
     port: 80

  selector:
    app: myapp
    type: back-end

------------------------------------------------------------------------------------------

kubectl create -f 
service-definition.yml
kubectl get services

------------------------------------------------------------------------------------------

Services-LoandBalancer


apiVersion: v1
kind: Service
metadata:
  name: myapp-service

spec:
  type: LoadBalancer
  ports:
   - targetPort: 80
     port: 80
     nodePort: 30008

----------------------------------------------------------------------------------------------

apiVersion: v1
kind: Service
metadata:
  name: webapp-service
spec:
  type: NodePort
  ports:
   - targetPort: 8080
     port: 8080
     nodePort: 30080
  selector:
    name: simple-webapp

kubectl create -f service-definition-1.yaml

----------------------------------------------------------------------------------------------

kubectl get service
kubectl get svc
kubectl describe svc kubernetes
kubectl describe deploy
kubectl describe deploy simple-webapp-deployment

----------------------------------------------------------------------------------------------

반응형

K8S, Deployment Command

개발 및 관리/클라우드 2023. 8. 28. 23:13 posted by HighLighter
반응형

kubectl create -f deployment-definition.yml

kubectl get deployments

kubectl get replicaset

kubectl get pods

kubectl get all

https://kubernetes.io/docs/reference/kubectl/conventions/

Create an NGINX Pod

kubectl run nginx --image=nginx

Generate POD Manifest YAML file (-o yaml). Don't create it(--dry-run)

kubectl run nginx --image=nginx --dry-run=client -o yaml

Create a deployment

kubectl create deployment --image=nginx nginx

Generate Deployment YAML file (-o yaml). Don't create it(--dry-run)

kubectl create deployment --image=nginx nginx --dry-run=client -o yaml

Generate Deployment YAML file (-o yaml). Don’t create it(–dry-run) and save it to a file.

kubectl create deployment --image=nginx nginx --dry-run=client -o yaml > nginx-deployment.yaml

Make necessary changes to the file (for example, adding more replicas) and then create the deployment.

kubectl create -f nginx-deployment.yaml

OR

In k8s version 1.19+, we can specify the --replicas option to create a deployment with 4 replicas.

kubectl create deployment --image=nginx nginx --replicas=4 --dry-run=client -o yaml > nginx-deployment.yaml

-----------------------------------------------------------------------------------------

kubectl get pods
kubectl get rs
kubectl get deployments

kubectl get rs

kubectl get pods

kubectl describe pod frontend-deployment-xxxxx-xxxx

kubectl create -f deployment-definition-1.yaml

-----------------------------------------------------------------------------------------

kubectl create deployment --help

kubectl create deployment httpd-frontend --image=httpd:2.4-alpine --replicas=3

kubectl get deploy

kubectl get deploy

-----------------------------------------------------------------------------------------

반응형

'개발 및 관리 > 클라우드' 카테고리의 다른 글

K8S Imperative / Declarative Commands  (0) 2023.09.04
K8S, Services Command, Services-LoandBalancer  (0) 2023.09.01
K8S, Services Command  (0) 2023.08.29
K8S, ReplicaSets Command  (0) 2023.08.28
쿠버네티스 KCA 관련 자료 URL  (0) 2023.08.03

K8S, ReplicaSets Command

개발 및 관리/클라우드 2023. 8. 28. 20:45 posted by HighLighter
반응형

ReplicaSets Command

> kubectl create -f replicaset-definition.yml

> kubectl get replicaset

> kubectl delete replicaset myapp-replicaset   *Also deletes all underlying PODs

> kubectl replace -f replicaset-definition.yml

> kubectl scale -replicas=6 replicaset-definition.yml

-----------------------------------------------------------------------------------------

kubectl get pods

kubectl get replicaset

kubectl describe replicaset new-replica-set

kubectl describe pod new-replica-set-7r2qw

-----------------------------------------------------------------------------------------

kubectl get pods

kubectl delete pod new-replica-set-wkzjh

-----------------------------------------------------------------------------------------

ls /root
kubectl create -f /root/replicaset-definition-1.yaml

cat /root/replicaset-definition-1.yaml

kubectl explain replicaset

-----------------------------------------------------------------------------------------

kubectl get rs
kubectl delete rs replicaset-1
kubectl delete rs replicaset-2

-----------------------------------------------------------------------------------------

kubectl get rs
kubectl edit rs new-replica-set
kubectl get pods
kubectl get rs
kubectl describe rs

kubectl delete pod new-replica-set-vpkh8 new-replica-set-tpkh1 new-replica-set-ipkh3 new-replica-set-lpkh5

kubectl get pods
kubectl get rs

-----------------------------------------------------------------------------------------

kubectl scale rs new-replica-set --replicas=5
kubectl get pods
kubectl edit rs new-replica-set

-----------------------------------------------------------------------------------------

kubectl edit rs new-replica-set

반응형

'개발 및 관리 > 클라우드' 카테고리의 다른 글

K8S Imperative / Declarative Commands  (0) 2023.09.04
K8S, Services Command, Services-LoandBalancer  (0) 2023.09.01
K8S, Services Command  (0) 2023.08.29
K8S, Deployment Command  (0) 2023.08.28
쿠버네티스 KCA 관련 자료 URL  (0) 2023.08.03
반응형
반응형

'개발 및 관리 > 클라우드' 카테고리의 다른 글

K8S Imperative / Declarative Commands  (0) 2023.09.04
K8S, Services Command, Services-LoandBalancer  (0) 2023.09.01
K8S, Services Command  (0) 2023.08.29
K8S, Deployment Command  (0) 2023.08.28
K8S, ReplicaSets Command  (0) 2023.08.28