Skip to content

k8s get-service

describe service

Description

describes k8s service

Synopsis

k8s get-service
    [--site <site>]
    [--cluster <cluster>]
    [--namespace|-n <namespace>]
    <name>

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

cluster - (string)

     Cluster where this command will be executed
     Example: --cluster "in-cluster"
     Default: in-cluster      Attributes: optional

namespace - (string)

     Kubernetes namespace
     Example: --namespace "namespace-1"
     Default: default      Attributes: optional

name - (string)

     Name of the service
     Example: "name-1"
     Default: _None_      Attributes: required

Examples

Input:

!k8s get-service --namespace "customer1" "maira-agent-service"
Output:
{
    "cluster": "in-cluster",
    "namespace": "customer1",
    "name": "maira-agent-service",
    "type": 4,
    "annotations": {
        "cloud.google.com/neg": "{\"ingress\":true}",
        "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"name\":\"maira-agent-service\",\"namespace\":\"customer1\"},\"spec\":{\"ports\":[{\"port\":8081,\"protocol\":\"TCP\",\"targetPort\":8080}],\"selector\":{\"app\":\"maira-agent\"},\"type\":\"LoadBalancer\"}}\n"
    },
    "selector": {
        "app": "maira-agent"
    }
}

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "k8s"
Service Instance cluster
Namespace namespace
Object Type "service"
Object ID name

Please see Access Control for details.