Set up a hosted runtime environment

If you have Codefresh’s Hosted GitOps, set up your hosted environment, and you are all ready to leverage extensive CD Ops capabilities. Read about Hosted GitOps.

Where to start with Hosted GitOps

If you have not provisioned a hosted runtime, Codefresh presents you with the setup instructions in the Home dashboard.

  • In the Codefresh UI, go to Codefresh Home. Codefresh guides you through the three-step setup, as described below.

Hosted GitOps setup

Hosted GitOps setup

You can provision a single hosted runtime for your Codefresh account.

1. Provision hosted runtime

Start installing the hosted runtime with a single-click. Codefresh completes the installation without any further intervention on your part. The hosted runtime is provisioned on the Codefresh cluster, and completely managed by Codefresh with automatic version and security upgrades.

  1. Do one of the following:
    • To set up Hosted GitOps later, click Install later, and continue from step 2.
    • To start setup, click Install, and continue from step 3.

Step 1: Installing hosted runtime

Step 1: Installing hosted runtime
  1. Do the following:
    • In the Codefresh UI, go to Runtimes, and click + Add Runtimes.
    • Select Hosted Runtime and click Add.

      An account can be provisioned with a single hosted runtime. If you have already provisioned a hosted runtime for your account, the Hosted Runtime option is disabled.

    • Continue from step 3.

Install hosted runtime

Install hosted runtime
  1. When complete, to view the components for the hosted runtime, click View Runtime. You are directed to the Runtime Components tab.

Runtime components for hosted runtime

Runtime components for hosted runtime

The Git Sources and the Managed Clusters are empty as they will be set up in the next steps.

If you navigate to Runtimes > List View, you can identify the hosted runtime through the Type column (Hosted ), the Cluster/Namespace column (Codefresh), and the Module column (CD Ops).

Hosted runtimes in List view

Hosted runtimes in List view

Troubleshoot failed hosted runtime installation

Your hosted runtime may fail to install with an error as in the image below. We are closely moinitoring the hosted runtime installation process and activley working to prevent and iron out all installation errors. Follow the instructions to uninstall and reinstall the hosted runtime.

Hosted runtime installation error

Hosted runtime installation error
  1. Download the CLI
    • If you have installed the Codefresh CLI already, make sure you have the latest version:
      cf version
      To compare with the latest version from Codefresh, click here.
    • Download the CLI.
  2. Uninstall the failed hosted runtime:
    cf runtime uninstall hosted-codefresh --force
    where:
    hosted-codefresh is the name of your hosted runtime, automatically assigned by Codefresh.
  3. In the Codefresh UI, return to Codefresh Home.
  4. Refresh the page and start with 1. Provision hosted runtime above.

2. Connect Git provider

Connect your hosted runtime to a Git provider for Codefresh to create the required Git repos. First authorize access to your Git provider through an OAuth token, and then select the Git organizations or accounts in which to create the required Git repos.

Only authorized organizations are displayed in the list. To authorize organizations for the Codefresh application in GitHub, see Authorize organizations/projects.

Step 2: Connect to Git provider

Step 2: Connect to Git provider

Once you authorize access, Codefresh creates two Git repositories, one to store the runtime configuration settings, and the other to store the runtime’s application settings:

  • Shared runtime configuration repo

    The shared runtime configuration repo is a centralized Git repository that stores configuration settings for the hosted runtime. Additional runtimes provisioned for the account can point to this repo to retrieve and reuse the configuration.
    Read about Shared configuration repo.

  • Git Source application repo

    Codefresh creates a Git Source application repo for every hosted runtime.
    Read about Git sources.

Hosted runtimes support only OAuth authentication.

  1. Click Connect.
  2. Click Authorize Access, and enter your OAuth token. If you don’t have an OAuth token, see the instructions on how to generate one in How to update a Git token.

Authorize access to Git

Authorize access to Git
  1. Select the Git Organization for which to create the repos.

    If the organization does not appear in the list, you need to authorize access to it. See Authorize organizations/projects.

  2. Click Create. Codefresh creates the two Git repositories in the paths shown.

Git configuration repos for Git Organization

Git configuration repos for Git Organization
  1. Verify that both repositories have been created in your Git account.

Shared runtime configuration repo

Shared configuration repo in Git

Shared configuration repo in Git

Runtime Git Source repo

Shared configuration repo in Git

Shared configuration repo in Git
  1. Optional. To see your tokens, click View Tokens.

If you return to the Runtimes page and select the Git Source tab, you will now see the Git Source that Codefresh created.
The Sync State may be Unknown for a few moments until it is synced to the Codefresh cluster.

Git Source tab for hosted runtime

Git Source tab for hosted runtime

3. Connect a Kubernetes cluster

Connect a destination cluster to the hosted runtime and register it as a managed cluster. Deploy applications and configuration to the cluster. For managed cluster information and installing Argo Rollouts, see Add and manage external clusters.

Step 3: Connect a K8s cluster for hosted runtime

Step 3: Connect a K8s cluster for hosted runtime

Before you begin

  • Make sure your cluster has internet access

How to

  1. Click Connect.
  2. In the Add Managed Cluster panel, copy the command cf cluster add, and run it in the terminal.
  3. When prompted to select the kube-context, select from the list of available clusters as defined in kubeconfig.

Add Managed Cluster panel

Add Managed Cluster panel
  1. Return to the Runtimes page, and then select Topology View.
    You can see the new K8s cluster you connected.

New K8s cluster in hosted runtime

New K8s cluster in hosted runtime
  1. Configure access to the IP addresses required. See Codefresh IP addresses.

If you could not connect a cluster, you may not have the latest version of the CLI:

  • If you have installed the Codefresh CLI already, make sure you have the latest version:
    cf version
    To compare with the latest version from Codefresh, click here.
  • Download the CLI.

You have completed setting up your hosted runtime. You are ready to create applications, and connect third-party CI tools for image enrichment.

(Optional) Create application

Optional. Create an application in Codefresh, deploy it to the cluster, and track deployment and performance in the Applications dashboard.

  1. Follow our quick-start to create and deploy the codefresh-guestbook application. Start with Create application resources.
    OR
    Create your own application. See Create an application
  1. In the Codefresh UI, view your application in the Applications dashboard.

(Optional) Connect CI

Optional. Integrate Codefresh with the third-party tools you use for CI to enrich image information in deployments.

Image enrichment with integrations

Manage provisioned runtimes
Add Git Sources to runtimes
Home dashboard
DORA metrics