Install onto a cluster that you already run¶
If you already have a Kubernetes context, 1.30 or newer, that you prefer,
point the script at it. That can be your own cluster, a cluster in a Linux
VM, or anything that kubectl can already reach. The mode question is then
skipped.
Add the cluster in the console first, as step 1 of the install guide describes. Then save the script, instead of a pipe, so that you can pass flags. Run it with the variables from the console's command. Add these 2 flags:
curl -fsSL https://console.mesopod.cloud/api/v1/install.sh -o install.sh
chmod +x install.sh
MESOPOD_CLUSTER=<your-slug> MESOPOD_CLAIM=mpc_… ./install.sh \
--skip-k3s \
--kube-context my-cluster
If the console's command carries --data-dir or --share, add those flags
too.
This path does not use root. It uses only a kubeconfig that can create the
objects, which include cluster-scoped roles and admission policies. On a Mac,
--kube-context also skips the k3d cluster. You already said where Mesopod
goes.
Do not combine it with --k3d, or with a leftover MESOPOD_INSTALL_MODE in
your environment. --k3d names a cluster to find or create, and
--kube-context names a cluster that exists. The script refuses the 2 together,
instead of a guess at which one you meant.
App data stays in the cluster's own storage. The volumes cell of the
cluster's row on the Clusters page shows in the cluster's own storage. The
script still registers the directories that you name. See
Your directories, from the command.
Flags lists every flag that the script takes.
Run the install again¶
Run the saved script with the cluster's name and the same flags as the first time. The console's command cannot carry the flags:
MESOPOD_CLUSTER=<your-slug> ./install.sh --skip-k3s --kube-context my-cluster
With no claim, the script reads the outpost token from the cluster's own Secret. The platform confirms that the token belongs to the named cluster. If the first install stopped before it finished, the name lets the script find the token that it kept for that cluster. See Run the install again.
An earlier version of this page added --token-file ~/.mesopod/outpost-token
to the command. A saved command with that flag still works, and the script
keeps that file up to date. Without the flag, the next run deletes the file.
Remove Mesopod from a cluster that you already run¶
Uninstall your apps in the console first. That removes their workloads cleanly and keeps their data.
When you remove the cluster from the console, the outpost runs its
decommission_cluster command. That command deletes everything in
mesopod-system, the cluster-scoped GatewayClass, and the k3s
HelmChartConfig. What remains, the outpost has no permission to delete.
Delete it yourself with the list below. <ctx> is the context that you
passed to --kube-context, or orbstack for an install made in the retired
OrbStack mode.
Caution: Before you run the 2 delete crd lines, make sure that no other
workload uses those CRDs. Those lines delete every object of those kinds on
the cluster.
# The outpost itself lives in mesopod-system — already gone if you removed
# the cluster from the console, since decommission_cluster deletes it. Do it
# first here, so the outpost is not still running while its permissions go.
kubectl --context <ctx> delete namespace mesopod-system
kubectl --context <ctx> delete clusterrolebinding mesopod-outpost
kubectl --context <ctx> delete clusterrole mesopod-outpost-cluster mesopod-outpost-runtime mesopod-outpost-helm
kubectl --context <ctx> -n kube-system delete rolebinding mesopod-outpost-helm
kubectl --context <ctx> delete validatingadmissionpolicybinding \
mesopod-outpost-rolebinding-cage-binding mesopod-outpost-namespace-cage-binding \
mesopod-outpost-workload-cage-binding mesopod-outpost-volume-cage-binding \
mesopod-outpost-pv-create-cage-binding mesopod-outpost-pv-roots-cage-binding
kubectl --context <ctx> delete validatingadmissionpolicy \
mesopod-outpost-rolebinding-cage mesopod-outpost-namespace-cage \
mesopod-outpost-workload-cage mesopod-outpost-volume-cage \
mesopod-outpost-pv-create-cage mesopod-outpost-pv-roots-cage
kubectl --context <ctx> delete crd outpostnodedirectoryroots.mesopod.io
# The retired OrbStack mode only — Traefik's ClusterRole/ClusterRoleBinding,
# applied at install time because the caged outpost has no verb to author them:
kubectl --context orbstack delete clusterrolebinding mesopod-traefik
kubectl --context orbstack delete clusterrole mesopod-traefik
# The retired OrbStack mode only — the Traefik CRDs the install applied, and
# the Gateway API CRDs provision_cluster shipped there; decommission leaves
# both on purpose. On k3s and k3d Mesopod installs neither set (k3s's own
# Traefik chart owns them). Another workload may use them: see the caution.
kubectl --context orbstack delete crd \
ingressroutes.traefik.io ingressroutetcps.traefik.io ingressrouteudps.traefik.io \
middlewares.traefik.io middlewaretcps.traefik.io serverstransports.traefik.io \
serverstransporttcps.traefik.io tlsoptions.traefik.io tlsstores.traefik.io \
traefikservices.traefik.io
kubectl --context orbstack delete crd \
gatewayclasses.gateway.networking.k8s.io gateways.gateway.networking.k8s.io \
grpcroutes.gateway.networking.k8s.io httproutes.gateway.networking.k8s.io \
referencegrants.gateway.networking.k8s.io
If you installed with an earlier version of the install script, also delete the files that it kept:
rm -f "$HOME/.mesopod/outpost-token" "$HOME/.mesopod/cluster-slug" \
"$HOME/.mesopod/install-mode" "$HOME/.mesopod/data-dir" \
"$HOME/.mesopod/volumes-path"
If you force-removed the cluster while its node was offline, mesopod-system
and your app namespaces are still there. Delete mesopod-system first. A new
Mesopod cluster refuses to provision over another cluster's ownership marker.
A force never ran decommission_cluster, so nothing was deleted for you. Also
run the whole kubectl list above, plus the 2 objects that
decommission_cluster would otherwise have deleted itself.
Those 2 objects are the cluster-scoped GatewayClass named mesopod-traefik
and, on k3s only, the HelmChartConfig named traefik in kube-system.
k3s's own Traefik chart owns that object. The retired OrbStack mode's Traefik
profile has no HelmChartConfig at all. It is a plain Service, Deployment and
ServiceAccount inside mesopod-system, so the namespace deletion above
already took it:
kubectl --context <ctx> delete namespace mesopod-system
kubectl --context <ctx> delete gatewayclass mesopod-traefik
# k3s only — an OrbStack-mode install has no HelmChartConfig to delete:
kubectl --context <ctx> -n kube-system delete helmchartconfig traefik
App namespaces and the data under them stay. Remove them yourself if you want the cluster clean.