Use kubectl as part of Freestyle step

Kubernetes in Freestyle step

Running Kubernetes cmd in Codefresh as part of the workflow is easy. Codefresh adding all you clusters into the workflow to be used as part of your CI/CD pipeline. The context remains the same as it appears in Codefresh

  • Use image: codefresh/kubectl
  • Add your commands
    • kubectl config get-contexts. Will print the cluster that we added to the workflow
    • kubectl config use-context {cluster-name}. The name is the same as in Account settingsIntegrationsKubernetes
    • kubectl get po -owide
    • kubectl get nodes

Follow the example

  • Add this repo to your account
  • Change the pipeline configuration to use codefresh.yml.
  • Build.