k8s-service-show
Kubernetes services provide a stable virtual IP addresses for a group of Pods. Unlike Pods, which are non-permanent resources that can be created, and destroyed dynamically, services remain consistent. Services act as loadbalancers, and are based on Linux IPTable or IPVS table. This command is used to display Kubernetes service information.
Syntax k8s-service-show
cluster-name cluster-name-string |
Name of the Kubernetes cluster. |
Specify one or more of the following options: |
|
start-time date/time: yyyy-mm-ddTHH:mm:ss |
The start time of statistics collection. |
end-time date/time: yyyy-mm-ddTHH:mm:ss |
The end time of statistics collection. |
duration duration: #d#h#m#s |
The duration of statistics collection. |
interval duration: #d#h#m#s |
The interval between statistics collection. |
since-start |
Statistics collected since start time. |
older-than duration: #d#h#m#s |
Display statistics older than the specified duration. |
within-last duration: #d#h#m#s |
Display statistics within the last specified duration. |
name name-string |
Name of the daemonset. |
namespace namespace-string |
Name of the namespace. |
type type-string |
The service type. |
service-ip service-ip-string |
The service IP address. |
external-ip external-ip-string |
The external IP address for services of type load balancer. |
selector selector-string |
The label selector for the service. |
ports ports-string |
The ports for the service. |
target-ports target-ports-string |
The ports targeted on pods. |
action none|add|remove|update |
The last action performed. |
Defaults None.
Access CLI
History
Version 7.0.0 |
Command introduced. |
Usage Use this command to display Kubernetes service information.
Examples Use the following syntax to display Kubernetes service information.
CLI (network-admin@switch) > k8s-service-show layout vertical
cluster-name: k8s02
name: kubernetes
namespace: default
type: ClusterIP
service-ip: 10.96.0.1
ports: 443/TCP
last-changed: 01-30,23:25:21
cluster-name: k8s02
name: my-service
namespace: default
type: ClusterIP
service-ip: 10.98.20.142
ports: 71/TCP
last-changed: 01-30,23:25:21
cluster-name: k8s02
name: kube-dns
namespace: kube-system
type: ClusterIP
service-ip: 10.96.0.10
ports: 53/UDP,53/TCP,9153/TCP
last-changed: 01-30,23:25:23