Overview
As part of your pipeline, you create a new cluster and want to add it to Codefresh
Details
- Note the name of the cluster in a variable, such as
$K8S_NAME
. - After the cluster is created, run the following API call, replacing all with your values or variables:
add_new_cluster:
image: <your-image>
commands:
- curl -s --fail \
-H "Authorization: <CF_API_KEY>" \
-H "content-type: application/json;charset=UTF-8" \
-d \
"{
\"type\": \"sat\",
\"selector\": \"<K8S_NAME>\",
\"host\": \"<K8S_HOST>\",
\"clientCa\": \"<K8S_CA>\",
\"serviceAccountToken\": \<$K8S_TOKEN\>,
\"provider\": \"local\",
\"providerAgent\": \"eks\"
}" \
"$CF_API_HOST/api/clusters/local/cluster"
Note: A more detailed EKS workflow can be found here.