Kubernetes kubectl with YAML

Kubernetes kubectl

YAML parameters for Kubernetes kubectl

NameTypeDescription
action
Required
StringThe name of the action.
type
Required
StringThe type of the action. Should be set to KUBERNETES_CLI.
auth_type
Required
StringAuthorization type. Can be one of BASIC, TOKEN or CERTS.
server
Required
StringThe host for the connection.
execute_commands
Required
String[]The commands that will be executed.
loginStringThe username required when auth_type is set to BASIC.
passwordStringThe password required when auth_type is set to BASIC.
tokenStringThe token required when auth_type is set to TOKEN.
client_caStringThe certificate authority required when auth_type is set to CERTS.
client_certStringThe client certificate required when auth_type is set to CERTS.
client_keyStringThe client key required when auth_type is set to CERTS.
kubectl_versionStringVersion of the kubectl used in the action. Default is “latest”.
shellStringThe name of the shell that will be used to execute commands. Can be one of SH (default) or BASH.

YAML example for Kubernetes kubectl

actions:
- action: "Run kubectl"
type: "KUBERNETES_CLI"
trigger_time: "ON_EVERY_EXECUTION"
auth_type: "BASIC"
server: "$serverAddress"
login: "admin"
password: "qwerty"
kubectl_version: "1.11.1"
shell: "SH"
execute_commands:
- "kubectl --namespace=buddy-tests get pods"
variables:
- key: "serverAddress"
value: "https://123.45.56.89:6443"

GKE kubectl

YAML parameters for GKE kubectl

NameTypeDescription
action
Required
StringThe name of the action.
type
Required
StringThe type of the action. Should be set to KUBERNETES_CLI.
execute_commands
Required
String[]The commands that will be executed.
integration_hash
Required
StringThe ID of the Google or Amazon integration.
zone_id
Required
StringThe ID of the GKE zone.
cluster
Required
StringThe ID of the GKE and Amazon EKS cluster.
application_id
Required
StringThe ID of the GKE application.
kubectl_versionStringVersion of the kubectl used in the action. Default is “latest”.
shellStringThe name of the shell that will be used to execute commands. Can be one of SH (default) or BASH.

YAML example for GKE kubectl

actions:
- action: "Run kubectl"
type: "KUBERNETES_CLI"
cluster: "cluster-1"
application_id: "tokyo-house-138923"
execute_commands:
- "kubectl --namespace=buddy-tests get pods"
shell: "SH"
zone_id: "europe-west1-c"
gke_auth_type: "BASIC"
integration_hash: "5ddb7c180fb38be67bd78a88a"

Amazon EKS

YAML parameters for Amazon EKS

NameTypeDescription
action
Required
StringThe name of the action.
type
Required
StringThe type of the action. Should be set to KUBERNETES_CLI.
execute_commands
Required
String[]The commands that will be executed.
integration_hash
Required
StringThe ID of the Google or Amazon integration.
cluster
Required
StringThe ID of the GKE and Amazon EKS cluster.
region
Required
StringThe Amazon region. Required when Amazon EKS cluster is set.
role_arn
Required
StringContains information about an IAM role. Can be set for Amazon EKS cluster.
kubectl_versionStringVersion of the kubectl used in the action. Default is “latest”.
shellStringThe name of the shell that will be used to execute commands. Can be one of SH (default) or BASH.

YAML example for Amazon EKS

actions:
- action: "Run kubectl"
type: "KUBERNETES_CLI"
cluster: "cluster-1"
role_arn: "SERVICE_ACCOUNT"
region: "us-west-2"
execute_commands:
- "kubectl --namespace=buddy-tests get pods"
shell: "SH"
kubectl_version: "latest"
integration_hash: "5ddb7c180fb38be67bd78a88a"