Run kubectl command
step
This Kubectl step container allows general kubectl
use and can take kubectl
commands.
Specification
cluster
Required
object
A map of configuration and credentials for accessing a Kubernetes cluster.
cluster.
name
Required
string
A name for the Kubernetes cluster. Used for referencing it via kubectl contexts.
cluster.
connection
Required
A Relay Kubernetes connection to useConnection docs
!Connection {type: kubernetes, name: my-kubernetes-connection}
command
Required
string
The command to pass to kubectl. For example, `apply`.
args
Optional
string
A string of arguments for commands other than `apply`.
file
Optional
string
A resource file to use when command is `apply`.
namespace
Optional
string
The namespace to run the command under.
git
Optional
object
A map of git configuration. If you're using HTTPS, only name and repository are required.
git.
ssh_key
Required
string
The SSH key to use when cloning the git repository. You can pass the key to Relay as a secret. See the example below.
git.
known_hosts
Optional
string
SSH known hosts file. Use a Relay secret to pass the contents of the file into the workflow as a base64-encoded string. See the example below.
git.
name
Required
string
A directory name for the git clone.
git.
branch
Optional
string
The Git branch to clone.
git.
repository
Required
string
The git repository URL.
kubernetes-step-kubectl
This Kubectl step container allows general kubectl
use and can take kubectl
commands.
Example step configuration
1name: kubectl-command2image: relaysh/kubernetes-step-kubectl3spec:4 command: apply5 args:6 - -k7 file: !Parameter file8 namespace: !Parameter namespace9 cluster:10 name: my-cluster11 connection: !Connection { type: kubernetes, name: my-cluster }12 git:13 ssh_key: !Secret ssh_key14 known_hosts: !Secret known_hosts15 name: !Parameter my-repo16 branch: !Parameter branch17 repository: !Parameter repository18
1name: kubectl-command2image: relaysh/kubernetes-step-kubectl3spec:4 command: get nodes5 namespace: !Parameter namespace6 cluster:7 name: my-cluster8 connection: !Connection { type: kubernetes, name: my-cluster }9