14 Eylül 2022 Çarşamba

kubectl get endpoints seçeneği - Checking services and endpoints

Giriş
Bir servisin hangi pod'a erişimi sağladığını gösterir. Açıklaması şöyle
A service with no endpoints may indicate that the backend pods are failing or unavailable.

Örnek
Şöyle yaparız
kubectl get endpoints
Örnek
Şöyle yaparız
# Get the kubernetes service
> kubectl get svc kubernetes -n default
--------------------------------------------------------------------
NAME         TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)        
kubernetes   ClusterIP      10.96.0.1       <none>           443/TCP
--------------------------------------------------------------------

# List the endpoints of the kubernetes service
> kubectl get endpoints -n default kubernetes
--------------------------------------------------------------------
NAME         ENDPOINTS         AGE
kubernetes   10.25.96.3:6443   24d
--------------------------------------------------------------------

# Get local endpoint of the k8s cluster from the Kubernetes service
> ENDPOINT=https://$(kubectl get endpoints kubernetes -n default \
  -o jsonpath='{.subsets[0].addresses[0].ip}'):6443/
> echo $ENDPOINT
--------------------------------------------------------------------
https://10.25.96.3:6443/      # (This will vary in your case)
--------------------------------------------------------------------


Hiç yorum yok:

Yorum Gönder

Kubernetes kind: Cluster

Örnek Şöyle yaparız apiVersion: cluster.k8s.io/v1alpha1 kind: Cluster metadata: name: my-cluster spec: autoscaler: enabled: true ...