How to use Skaffold with APPUiO Cloud

Skaffold logo Skaffold Skaffold handles the workflow for building, pushing and deploying your application, allowing you to focus on what matters most: writing code.

This page will describe the required steps to use Skaffold successfully with APPUiO Cloud.

This information is provided as a courtesy for APPUiO Cloud users. We don’t provide support for Skaffold, and in case of issues, you are invited to contact the developers of Skaffold at their GitHub project.


To follow this guide, please make sure that you have the following tools installed:


The Skaffold documentation explains how to install it in your operating system of choice.


You can download the OpenShift command directly from APPUiO Cloud, selecting the help menu (marked as a question mark) and selecting the "Command line tools" entry.


You can download it from


This section explains the steps required to use Skaffold with APPUiO Cloud.

1. Login to APPUiO Cloud

Follow these steps to login to APPUiO Cloud on your terminal:

  1. Login to the APPUiO Cloud console:

    oc login --server=https://api.${zone}

    You can find the exact URL of your chosen zone in the APPUiO Cloud Portal.

    This command displays a URL on your terminal:

    You must obtain an API token by visiting
  2. Click on the link above and open it in your browser.

  3. Click "Display token" and copy the login command shown as "Log in with this token"

  4. Paste the oc login command on the terminal:

    oc login --token=sha256~_xxxxxx_xxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxx-X \
  5. Create a new project called "[YOUR_USERNAME]-fortune-go"

    oc new-project [YOUR_USERNAME]-fortune-go

2. Login to the APPUiO Cloud Container Registry

Skaffold uses Docker to build the container image, and to publish to a container registry. In this example we’re going to use the APPUiO Cloud integrated container registry.

  1. Login to the APPUiO Cloud container registry (as explained in this page):

    oc whoami -t | docker login registry.${zone} -u $(oc whoami) --password-stdin

3. Clone the sample "Fortune in Go" project

The "Fortune in Go" project provides a very simple Go application to start with. You can clone it from GitLab:

git clone

And then cd into it:

cd fortune-go

4. Add a Deployment File

Add a file named deployment.yaml at the root of the project with the following information:

apiVersion: apps/v1
kind: Deployment
  name: fortune-go
      containers: (1)
      - image: registry.[YOUR_CHOSEN_ZONE][YOUR_USERNAME]-fortune-go/fortune-go:latest
        imagePullPolicy: Always
        name: fortune-container
        - containerPort: 8080
        app: fortune-go
      app: fortune-go
    type: Recreate
apiVersion: v1
kind: Service
  name: fortune-go
    - port: 8080
      targetPort: 8080
    app: fortune-go
  type: ClusterIP
kind: Ingress
  annotations: letsencrypt-production
  name: fortune-go-ingress
  - host: [YOUR_USERNAME]-fortune-go.apps.[YOUR_CHOSEN_ZONE] (1)
      - pathType: Prefix
        path: /
            name: fortune-go
              number: 8080
  - hosts:
    - [YOUR_USERNAME]-fortune-go.apps.[YOUR_CHOSEN_ZONE]
    secretName: fortune-go-cert
1 Remember to customize the parts marked as [YOUR_USERNAME] and [YOUR_CHOSEN_ZONE] to your liking (and according to the Zones documentation page).
About URL lengths

Make sure that the total length of the prefix string [YOUR_USERNAME]-fortune-[LANGUAGE] used in the Ingress YAML above isn’t longer than 63 characters. This is due for two reasons:

  1. As per the DNS RFC, each label (for example the prefix in this case) must be equal or less than 63 characters long (octets to be exact), and the whole domain name must be equal or shorter than 255 octets.

  2. These limits also apply to most Kubernetes resource names.

If your Ingress doesn’t generate a route after deploying your application, shorten the URL in your YAML and redeploy.

5. Initialize Skaffold

Initialize the project to use Skaffold:

skaffold init

Reply to the questions interactively as follows:

  1. Choose the builder to build image registry.$APPUiO[YOUR_USERNAME]-fortune-go/fortune-go

    • Docker (Dockerfile)

  2. Which builders would you like to create kubernetes resources for?

    • Hit enter

  3. Do you want to write this configuration to skaffold.yaml?

    • y

And it’s ready! The file skaffold.yaml will contain the following information:

apiVersion: skaffold/v2beta26
kind: Config
  name: fortune-go
  - image: registry.[YOUR_CHOSEN_ZONE][YOUR_USERNAME]-fortune-go/fortune-go
      dockerfile: Dockerfile
    - deployment.yaml
Skaffold reads the URL of the container image from the deployment YAML created in the previous step, so make sure that you are properly logged in to both OpenShift and to the container registry.

6. Launch Skaffold

Launch Skaffold on the terminal:

skaffold dev

Skaffold should build your container image, push it to the APPUiO Cloud registry, and deploy your application to the cluster in a few seconds.

Now you can edit any file in your project, and as soon as you save it, Skaffold will automatically rebuild your image, push it, and redeploy it, increasing your productivity.

Tips & Tricks

Here go some ideas to use Skaffold efficiently:

  • Skaffold rebuilds your Docker image every time you save a file in your project, which depending on your setup can take a long time to finish. In that case you might want to use a separate Dockerfile for development, and another for production builds, where you turn on all optimizations, and strip all debug symbols away.

  • Help your team adopt Skaffold by following the getting started guide and adding the appropriate information in your project’s README file.