Skip to content

Kubernetes

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

5 modules

ModuleDescription
Manifest Uygulakubectl apply ile bir Kubernetes manifesti uygula
Kaynağı TanımlaBir Kubernetes kaynağını detaylı olarak tanımla
Podları AlBir namespace içindeki Kubernetes podlarını listele
Pod Loglarını AlBir Kubernetes podundan logları al
Dağıtımı ÖlçeklendirBir Kubernetes dağıtımını belirtilen kopya sayısına ölçeklendir

Modules

Manifest Uygula

k8s.apply

kubectl apply ile bir Kubernetes manifesti uygula

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
kindstringKaynak türü (ör. Deployment, Service)
namestringKaynak adı
namespacestringKaynak namespace
actionstringYapılan işlem (oluşturuldu, yapılandırıldı, değişmedi)

Kaynağı Tanımla

k8s.describe

Bir Kubernetes kaynağını detaylı olarak tanımla

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_typestringTanımlanan kaynak türü
namestringKaynak adı
namespacestringKubernetes namespace
descriptionstringTam kubectl describe çıktı metni

Podları Al

k8s.get_pods

Bir namespace içindeki Kubernetes podlarını listele

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
podsarrayDurum bilgisi ile pod listesi
countnumberBulunan toplam pod sayısı

Pod Loglarını Al

k8s.logs

Bir Kubernetes podundan logları al

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 adı
logsstringLog çıktı metni
linesnumberDönen log satır sayısı

Dağıtımı Ölçeklendir

k8s.scale

Bir Kubernetes dağıtımını belirtilen kopya sayısına ölçeklendir

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
deploymentstringDağıtım adı
replicasnumberİstenen kopya sayısı
namespacestringKubernetes namespace
scaledbooleanÖlçeklendirme işleminin başarılı olup olmadığı

Released under the Apache 2.0 License.