Codefresh Kubernetes Integration
Easily add Kubernetes Clusters in Codefresh
The “administrator” permission on Codefresh is required to carry out these steps. Ask your Codefresh administrator to grant these permissions on the collaborators page on Codefresh or to carry out the following steps on your behalf.
Login to Codefresh and navigate to the Kubernetes Integration under account settings.
Click “Add Provider” and select the relevant cloud platform.
Then click “Add Cluster”. For
kops based clusters, select the “Custom Providers” option.
Next, you’ll be presented a form. In Geodesic Overview we provide a script to make this integration a little bit easier. Run the
codefresh-settings script to output all the necessary information you need in order to setup the Kubernetes integration.
Enter the outputs of the script into the form and click save.
We recommend naming the configuration after the cluster name (e.g.
Enter Kubernetes Credentials
The complete docs for configuring Codefresh with Kubernetes can be found on their documentation portal.
Once you’ve setup the Kubernetes integration with Codefresh, you can leverage it in your
codefresh.yaml pipelines by setting the
KUBE_CONTEXT environment variable to the name of the connection.
For example, here’s how you could create a namespace in a build step by using the
create_namespace: title: Create an Example Namespace image: cloudposse/build-harness:0.5.4 environment: - KUBE_CONTEXT=us-west-2-staging-example-com commands: - "kubectl create namespace example"