Deploying a Retro Arcade
Introduction
In previous tutorials, we learned how to create a package, initialize a cluster, and deploy a package. In this tutorial, we will leverage all that past work and deploy a fun application onto your cluster.
System Requirements
- You'll need an internet connection to grab the Zarf Package for the games example.
Prerequisites
Before beginning this tutorial you will need the following:
- The Zarf repository cloned: (git clone instructions)
- Zarf binary installed on your $PATH: (Installing Zarf)
- An initialized cluster
YouTube Tutorial
Deploying the Arcade
- The
dos-games
package is easily deployable viaoci://
by runningzarf package deploy oci://ghcr.io/defenseunicorns/packages/dos-games:1.0.0-$(uname -m) --key=https://zarf.dev/cosign.pub
.
You can publish your own packages for deployment too via oci://
. See the Store and Deploy Packages with OCI tutorial for more information.
- If you did not use the
--confirm
flag to automatically confirm that you want to deploy this package, pressy
for yes. Then hit theenter
key.
Connecting to the Games
When the games package finishes deploying, you should get an output that lists a couple of new commands that you can use to connect to the games. These new commands were defined by the creators of the games package to make it easier to access the games. By typing the new command, your browser should automatically open up and connect to the application we just deployed into the cluster, using the zarf connect
command.
If your browser doesn't automatically open up, you can manually go to your browser and copy the IP address that the command printed out into the URL bar.
The zarf connect games
will continue running in the background until you close the connection by pressing the ctrl + c
(control + c
on a mac) in your terminal to terminate the process.
Removal
- Use the
zarf package list
command to get a list of the installed packages. This will give you the name of the games package to remove it.
- Use the
zarf package remove
command to remove thedos-games
package. Don't forget the--confirm
flag. Otherwise you'll receive an error.
- You can also use the
zarf package remove
command with the zarf package file, to remove the package. Again don't forget the--confirm
flag.
The dos-games package has now been removed from your cluster.
Troubleshooting
Unable to connect to the Kubernetes cluster
If you receive this error, either you don't have a Kubernetes cluster, your cluster is down, or your cluster is unreachable.
- Check your kubectl configuration, then try again. For more information about kubectl configuration see Configure Access to Multiple Clusters from the Kubernetes documentation.
If you need to setup a cluster, you can perform the following.
- Deploy a Kubernetes cluster with the Creating a K8s Cluster with Zarf tutorial.
- Perform the Initialize a cluster tutorial.
After that you can try deploying the package again.
Secrets "zarf-state" not found
If you receive this error when zarf is attempting to deploy the BASELINE COMPONENT
, this means you have not initialized the kubernetes cluster. This is one of the prerequisites for this tutorial. Perform the Initialize a cluster tutorial, then try again.
Credits
✨ Special thanks to these fine references! ✨