-
레플리카셋kubernetes 2023. 10. 30. 11:13
https://kubernetes.io/ko/docs/concepts/workloads/controllers/replicaset/(참고사이트)
레플리카셋
레플리카셋의 목적은 레플리카 파드 집합의 실행을 항상 안정적으로 유지하는 것이다. 이처럼 레플리카셋은 보통 명시된 동일 파드 개수에 대한 가용성을 보증하는데 사용한다. 레플리카셋의
kubernetes.io
kubectl create secret docker-registry secretdoc --docker-username=myoungseok --docker-password=dyaus1102
(실습중 오류로 인해 입력을 해주었다 Docker 레지스트리에 로그인하는 데 필요한 사용자 이름과 비밀번호를 사용하여 "secretdoc"라는 이름의 시크릿을 생성합니다. 이 시크릿은 이후에 Kubernetes Pod에서 이미지를 가져올 때 사용될 수 있습니다)
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: rs-nginx
spec:
replicas: 3
selector:
matchLabels:
app: rs-nginx
template:
metadata:
labels:
app: rs-nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
imagePullSecrets:
- name: secretdoc
# 케이스에 따라 레플리카를 수정한다.
nginx를 3개 생성하는 rs-nginx repilcas 생성 --> 10개로kubectl edit rs rs-nginx -> 텍스트 편집기 실행
kubectl get pod -o wide -> 확인잘 작동이 된다