Skip to content

Instantly share code, notes, and snippets.

@erangaeb
Created December 3, 2022 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erangaeb/d041f3b23435d3c373a55c588361c2da to your computer and use it in GitHub Desktop.
Save erangaeb/d041f3b23435d3c373a55c588361c2da to your computer and use it in GitHub Desktop.
k8s endpoints
# create endpoints
kubectl apply -f endpoint1.yaml
kubectl apply -f endpoint2.yaml
# create two services
❯❯ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
bassa ClusterIP None <none> 5432/TCP 10m
rahasak ClusterIP None <none> 5432/TCP 12m
# create two endpoints
❯❯ kubectl get endpoints
NAME ENDPOINTS AGE
bassa 10.1.212.16:25432 11m
rahasak 10.1.212.15:15432 12m
❯❯ kubectl describe endpoints rahasak
Name: rahasak
Namespace: default
Labels: app.kubernetes.io/component=blackbox
app.kubernetes.io/name=rahasak
Annotations: <none>
Subsets:
Addresses: 10.1.212.15
NotReadyAddresses: <none>
Ports:
Name Port Protocol
---- ---- --------
db 15432 TCP
Events: <none>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment