Skip to content

Kubernetes

Apply manifests, describe resources, get pods, logs, and scale deployments.

5 modules

ModuleDescription
매니페스트 적용kubectl apply를 통해 Kubernetes 매니페스트 적용
자원 설명Kubernetes 자원을 상세히 설명
Pod 가져오기네임스페이스 내 Kubernetes pod 목록
Pod 로그 가져오기Kubernetes pod에서 로그 가져오기
배포 확장지정된 복제본 수로 Kubernetes 배포 확장

Modules

매니페스트 적용

k8s.apply

kubectl apply를 통해 Kubernetes 매니페스트 적용

Parameters:

NameTypeRequiredDefaultDescription
manifeststringYes-Kubernetes manifest as YAML string or JSON object
namespacestringNo-Override namespace for the resource (optional)
kubeconfigstringNo-Path to kubeconfig file (uses default if not set)

Output:

FieldTypeDescription
kindstring자원 종류 (예: Deployment, Service)
namestring자원 이름
namespacestring자원 네임스페이스
actionstring수행된 작업 (생성됨, 구성됨, 변경 없음)

자원 설명

k8s.describe

Kubernetes 자원을 상세히 설명

Parameters:

NameTypeRequiredDefaultDescription
resource_typestringYes-Kubernetes resource type (e.g. pod, deployment, service)
namestringYes-Name of the resource to describe
namespacestringNodefaultKubernetes namespace (ignored for cluster-scoped resources)
kubeconfigstringNo-Path to kubeconfig file (uses default if not set)

Output:

FieldTypeDescription
resource_typestring설명된 자원 유형
namestring자원 이름
namespacestringKubernetes 네임스페이스
descriptionstring전체 kubectl describe 출력 텍스트

Pod 가져오기

k8s.get_pods

네임스페이스 내 Kubernetes pod 목록

Parameters:

NameTypeRequiredDefaultDescription
namespacestringNodefaultKubernetes namespace to list pods from
label_selectorstringNo-Filter pods by label selector (e.g. app=nginx)
kubeconfigstringNo-Path to kubeconfig file (uses default if not set)

Output:

FieldTypeDescription
podsarray상태 정보가 포함된 pod 목록
countnumber발견된 pod의 총 수

Pod 로그 가져오기

k8s.logs

Kubernetes pod에서 로그 가져오기

Parameters:

NameTypeRequiredDefaultDescription
podstringYes-Name of the pod to retrieve logs from
namespacestringNodefaultKubernetes namespace
containerstringNo-Specific container name (for multi-container pods)
tailnumberNo100Number of recent log lines to retrieve
previousbooleanNoFalseGet logs from the previous terminated container instance
kubeconfigstringNo-Path to kubeconfig file (uses default if not set)

Output:

FieldTypeDescription
podstringPod 이름
logsstring로그 출력 텍스트
linesnumber반환된 로그 줄 수

배포 확장

k8s.scale

지정된 복제본 수로 Kubernetes 배포 확장

Parameters:

NameTypeRequiredDefaultDescription
deploymentstringYes-Name of the deployment to scale
replicasnumberYes-Desired number of replicas
namespacestringNodefaultKubernetes namespace
kubeconfigstringNo-Path to kubeconfig file (uses default if not set)

Output:

FieldTypeDescription
deploymentstring배포 이름
replicasnumber요청된 복제본 수
namespacestringKubernetes 네임스페이스
scaledboolean확장 작업이 성공했는지 여부

Released under the Apache 2.0 License.