강의

멘토링

커뮤니티

Inflearn Community Q&A

mongha's profile image
mongha

asked

Kubernetes Another Class - Sprint 1, 2 (#PracticalBasics #Installation #Deployment #Jenkins #Helm #ArgoCD)

📝 Understanding Objects by Drawing Them 2/2 - Labels, Selector, Naming

Selector의 속성에 대해 질문 드립니다.

Written on

·

45

1

안녕하세요.

먼저 깊은 경험에서 우러나오는 지식이 공유해주셔서 감사를 드립니다.

질문 내용은 아래와 같습니다.

Selector에는 object type 같은 속성이 없던데, 그럼 예를 들어 pvc는 무조건 pv만 select 가능하고 replicaset은 pod만 select가 가능해야 할 것 같아서요.. 예외는 없을까요?

kubernetesdevopsargocdcontainerhelm

Answer 1

0

1pro님의 프로필 이미지
1pro
Instructor

안녕하세요.

맞습니다. 예외는 없어요.

Selector의 경우 하나의 Object의 select는 지정된 Object로만 지정되도록 설계되어 있습니다.

만약 여러 종류의 Object를 지정해야 하는 경우 다른 속성이 쓰이는데

예를 들어 HPA의 경우 Deployment나 ReplicaSet 등을 지정할 수 있고, 그럴 때는 아래와 같은 속성으로 사용이 되요.

  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-app
mongha님의 프로필 이미지
mongha
Questioner

명쾌한 답변 감사합니다!

mongha's profile image
mongha

asked

Ask a question