Skip to main content

Kubernetes (deprecated)

The kubernetes deploy-type uses helm to deploy the app to a Kubernetes cluster.

It was the first catladder deploy type, highly opinionated and has many features, but is only recommended for certain types of apps. If possible, use serverless deployment types like google-cloudrun.

note

This page only covers the setup. The full option reference — values (application, autoscaling, probes, resources), cloudsql, mongodb, jobs, cronjobs, mapServiceUrlToEnv — lives in the deploy types reference.

Swiss Cluster Deployments (Panter specific)

Requirements

  1. Basic setup and understanding of Kubernetes administration
  2. Access rights to cluster skynet-swiss (ask #technik if this is missing)
  3. Switch to project skynet-swiss in Google Cloud Console (https://console.cloud.google.com/)
  4. Copy command for connecting to cluster ch-staging (e.g. gcloud container clusters get-credentials...)

Deployment files

The catladder.ts file defines the whole deployment for Kubernetes.

Here's a short example file:

catladder.ts
import type { Config, DeployConfigKubernetesCluster } from "@catladder/cli";

const PROD_CLUSTER: DeployConfigKubernetesCluster = {
type: "gcloud",
name: "ch-production",
projectId: "skynet-swiss",
region: "europe-west6-a",
domainCanonical: "panter.swiss",
};

const DEV_CLUSTER: DeployConfigKubernetesCluster = {
type: "gcloud",
name: "ch-staging",
projectId: "skynet-swiss",
region: "europe-west6-a",
domainCanonical: "panter.dev",
};
const config = {
customerName:
"EXAMPLE CUSTOMER NAME (always 3 letters, lowercase. e.g.: ihz, pvl, vps etc.)",
appName:
"EXAMPLE APP NAME (always separated by dashes, lowercase, e.g.: ihz-member-app, pvl-cyclomania-web etc.)",
components: {
// 👉 here you define all the needed, components
web: {
// 👉 define the location for the app to build
dir: ".",
build: {
type: "node",
},
deploy: {
type: "kubernetes",
cluster: DEV_CLUSTER,
},
env: {
prod: {
deploy: {
type: "kubernetes",
cluster: PROD_CLUSTER,
},
},
},
vars: {
// 👉 define public vars
public: {},
// 👉 define the secrets, whose values are set afterwards with
// `catladder project config-secrets`
secret: ["HUB_API_URL"],
},
},
api: {
dir: "./api",
build: {
// ...
},
// ...
},
},
} satisfies Config;

export default config;