Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
16

krucible/create-cluster krucible/create-cluster

Create a new Kubernetes cluster and add it to your Codefresh account. For more information see https://usekrucible.com.

arguments

  • CODEFRESH_API_KEY - API key for Codefresh
  • KRUCIBLE_ACCOUNT_ID - ID of your Krucible account
  • KRUCIBLE_API_KEY_ID - ID of your Krucible API key
  • KRUCIBLE_API_KEY_SECRET - Secret of your Krucible API key
  • KRUCIBLE_CLUSTER_DURATION - Desired duration for the Krucible cluster. Omit for a permanent cluster.
  • KRUCIBLE_CLUSTER_NAME - Desired display name for the Krucible cluster

returns

  • CLUSTER_NAME - The name of the created cluster in Codefresh
    version: '1.0'
steps:
  create_cluster:
    title: Create Cluster
    type: krucible/create-cluster
    arguments:
      CODEFRESH_API_KEY: '${{CODEFRESH_API_KEY}}'
      KRUCIBLE_ACCOUNT_ID: '${{KRUCIBLE_ACCOUNT_ID}}'
      KRUCIBLE_API_KEY_ID: '${{KRUCIBLE_API_KEY_ID}}'
      KRUCIBLE_API_KEY_SECRET: '${{KRUCIBLE_API_KEY_SECRET}}'
      KRUCIBLE_CLUSTER_NAME: my-live-cluster
  deploy:
    type: helm
    arguments:
      action: install
      chart_name: test_chart
      release_name: first
      helm_version: 3.0.1
      kube_context: '${{CLUSTER_NAME}}'

  
github.com
Ben Elgar
May 21, 2020