Getting started
This guide takes you from a new workspace to your first release. It takes about 45 minutes with an app you already have as Docker images or a Helm chart.
Words used in Shipfast
| Term | What it is |
|---|---|
| Workspace | Your organisation's own Shipfast address. Everyone you invite signs in there. |
| Cluster | A Kubernetes cluster that Shipfast created or that you connected. |
| Template | The recipe for an app: its services, charts, YAML and variables. |
| Application | One running copy of a template on a cluster, with its own values. |
| Version | A set of image references for a template's services, usually registered by your CI. |
Steps
- Sign in to your workspace and invite your team from Users. Give each person a role.
- Add a cluster. Connect one you have (see Connect a cluster) or create one in your cloud account (see Create a cluster).
- Create a template. Add your services as Docker images, Helm charts or Kubernetes YAML, and set variables with defaults.
- Create an application from the template, choose the cluster, and override the values that differ for this environment.
- Approve it. Once an application is approved and enabled, Shipfast creates its namespace on the cluster and the agent applies it.
- Wire your CI so new images are registered automatically (see Releases from CI).
Connect a cluster
Connect any conformant Kubernetes cluster: AKS, k3s, open-source Kubernetes on-prem, or an EKS, GKE or VKE cluster you created yourself.
- In Clusters, add a cluster and choose to connect an existing one.
- Open its Installation tab. Shipfast shows a command with a one-time token, valid for 15 minutes.
- Run it with access to the cluster:
$ kubectl apply -f https://<your-workspace>/k8s/apply/<token>
This installs Metacontroller, a small custom resource and the Shipfast agent in their own namespace, with a service account and the role bindings they need.
How the connection works
- The controller in the cluster polls your workspace over HTTPS for what to apply.
- The agent opens a WebSocket from the cluster to your workspace for live data: events, logs, metrics and the browser terminal.
- Every connection starts from the cluster. No inbound port, VPN or bastion host is needed.
The cluster's status changes to configured after its first sync. You can deploy to it from then on.
Create a cluster
Shipfast can create EKS clusters on AWS, GKE on Google Cloud and VKE on Vultr with Terraform, in your own account.
- Add the cloud account's credentials once. They are stored encrypted.
- Choose the provider, region, Kubernetes version and node size.
- Shipfast runs the Terraform job and streams its log. When it finishes, the agent is installed and the cluster is ready.
Shipfast installs the platform tools your apps need: ingress, cert-manager, KEDA, VPA, Karpenter where supported, and OpenCost.
Releases from CI
Your CI keeps building and pushing images. As its last step it tells Shipfast about the new image, and applications that follow that version are updated on their next sync.
1. Create an API key for the template
Open the template's CI/CD tab and create an API key. Store it as a secret in your CI, for example SHIPFAST_API_KEY. You also need the template's ID, shown on the same tab.
2. Call the versions endpoint
curl --user "project${TEMPLATE_ID}:${SHIPFAST_API_KEY}" \ --data-urlencode "projectId=${TEMPLATE_ID}" \ --data-urlencode "title=${COMMIT_TITLE}" \ --data-urlencode "message=${COMMIT_MESSAGE}" \ "${SHIPFAST_URL}/api/versions/update?channel=Prod&name=${BRANCH}&build=${BUILD_ID}&image=api&url=${IMAGE}"
Authentication is HTTP Basic: the user is project followed by the template ID, and the password is the template's API key. projectId must be sent in the request body.
| Field | Required | Meaning |
|---|---|---|
url | Yes | The full image reference, for example registry.example.com/team/api:2.15.0 |
image | Yes | The name of the service in the template that uses this image |
channel | Yes | The release channel, for example Prod |
name | No | The branch name. main is treated as master |
build | No | Your CI's build or pipeline number |
title, message | No | Shown in the version history, usually the commit title and message |
GitHub Actions
# .github/workflows/release.yml (last step)
- name: Register version with Shipfast
run: |
curl --fail --user "project${{ vars.TEMPLATE_ID }}:${{ secrets.SHIPFAST_API_KEY }}" \
--data-urlencode "projectId=${{ vars.TEMPLATE_ID }}" \
--data-urlencode "title=${{ github.event.head_commit.message }}" \
"${{ vars.SHIPFAST_URL }}/api/versions/update?channel=Prod&name=${{ github.ref_name }}&build=${{ github.run_number }}&image=api&url=${{ env.IMAGE }}"
GitLab CI
register_version:
stage: deploy
script:
- curl --fail --user "project${TEMPLATE_ID}:${SHIPFAST_API_KEY}"
--data-urlencode "projectId=${TEMPLATE_ID}"
--data-urlencode "title=${CI_COMMIT_TITLE}"
"${SHIPFAST_URL}/api/versions/update?channel=Prod&name=${CI_COMMIT_BRANCH}&build=${CI_PIPELINE_ID}&image=api&url=${IMAGE}"
GraphQL API
Shipfast has a public GraphQL API for automation, for example creating an application for each new customer from your own systems.
Access
- An administrator turns on API access for the user in Users.
- That user then has a personal API key. Keys start with
UNI. Treat them like passwords. - Send the key in the
x-auth-tokenheader. Requests run as that user, with that user's role.
curl "${SHIPFAST_URL}/unifie-api/graphql/v1" \ -H "x-auth-token: ${SHIPFAST_USER_API_KEY}" \ -H "content-type: application/json" \ -d '{"query":"{ Application_getApplicationsList { id name domain isLive } }"}'
The endpoint serves an interactive explorer with the full schema when you open it in a browser.
Applications
Application_getApplicationsListLists the applications in your workspace.Application_createFromTemplateCreates an application from a template on a cluster.extUuidis your own ID for it. Arguments: templateId, name, clusterId, extUuid, extData.Application_getApplicationByExtUuidReturns one application by your ID. Arguments: extUuid.Application_updateByExtUuidUpdates an application's settings. Arguments: extUuid, fields.Application_approveToRunByExtUuidApproves an application to run. Arguments: extUuid, approve.Application_getPodsStatusByExtUuidReturns the current pod status. Arguments: extUuid.Application_getPodsMetricsByExtUuidReturns pod CPU and memory use. Arguments: extUuid.Application_deleteByExtUuidDeletes an application. Arguments: extUuid.
Example: create an application per customer
mutation {
Application_createFromTemplate(
templateId: 12, name: "customer-4821", clusterId: 3,
extUuid: "cust-4821"
) { id name domain }
}
Troubleshooting
- The cluster never reaches configured. Check that the cluster can reach your workspace over HTTPS, including through any proxy, and that the install token had not expired.
- An application stays pending. Applications run once they are approved and enabled. Check the approval, then the cluster's capacity.
- The CI call returns 401. Check that the user is
projectplus the template ID, that the key belongs to that template, and thatprojectIdis in the request body. - A new version did not deploy. Check that
imagematches a service name in the template, and that the application follows that version.
Still stuck? Email hello@shipfast.app.
Ready to ship faster?
Bring one app. We'll connect a cluster and ship a release with you.