Kubernetes kubectl with YAML

Table of Contents

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 kubectl on GKE cluster

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 integration.
zone_id
Required
StringThe ID of the GKE zone.
cluster
Required
StringThe ID of the GKE cluster.
application_id
Required
StringThe ID of the GKE application.
gke_auth_type
Required
StringAuthorization type. Set to SERVICE_ACCOUNT.
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 kubectl on GKE cluster

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

Amazon EKS

YAML parameters for kubectl Amazon EKS cluster

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 Amazon integration.
cluster
Required
StringThe ID of the 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 kubectl on Amazon EKS cluster

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"
  integartion_hash: "5ddb7c180fb38be67bd78a88a"
  cluster: "cluster-1"
  region: "us-west-2"
  role_arn: arn:aws:iam::344123456789:role/EKS_TESTS

Azure AKS

YAML parameters for kubectl on Azure AKS cluster

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 Azure integration.
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.
subscription_idStringThe ID of Azure subscription.
resource_group_nameStringThe Azure resource group name in which the AKS cluster is set.
resource_nameStringThe name of the Kubernetes service in Azure.

YAML example for kubectl on Azure AKS cluster

actions:
- action: "Run kubectl"
  type: "KUBERNETES_CLI"
  trigger_time: "ON_EVERY_EXECUTION"
  kubectl_version: "1.11.1"
  shell: "SH"
  execute_commands:
  - "kubectl --namespace=buddy-tests get pods"
  integration_hash: "5ddb7c180fb38be67bd78a88a"
  subscription_id: "d4fd0732-1b7f-47ff-8ca9-8b003428dcd8"
  resource_group_name: "test-buddy_group"
  resource_name: "buddy-tests"

Digital Ocean

YAML parameters for kubectl on Digital Ocean cluster

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 Digital Ocean integration.
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.
digital_ocean_clusterStringThe ID of the Digital Ocean cluster.

YAML example for kubectl on Digital Ocean cluster

actions:
- action: "Run kubectl"
  type: "KUBERNETES_CLI"
  trigger_time: "ON_EVERY_EXECUTION"
  kubectl_version: "1.11.1"
  shell: "SH"
  execute_commands:
  - "kubectl --namespace=buddy-tests get pods"
  integration_hash: "5ddb7c180fb38be67bd78a88a"
  digital_ocean_cluster: "0ec55079-0398-4cfc-9b51-97e07cb07ae7"

Last modified on December 22, 2022

Get Started

Sign up for free and deploy your project in less than 10 minutes.