Waypoint is a tool for deploying applications and services to any target. With Waypoint's predictable and uncomplicated workflow, you can deploy your code without spending days understanding how to interface with various endpoints.
- Install and configure Docker Desktop for Kubernetes.
- Download and install Docker Desktop for Mac: https://docs.docker.com/docker-for-mac/install/
- Enable Kubernetes in Docker Desktop. It may take up to 5 minutes for Docker to apply your changes. Docker will restart and create a Kubernetes cluster.
- Configure Kubernetes to access the GitHub Docker registry.
- Create a personal access token on GitHub: https://github.com/settings/tokens/new
- Configure Docker to authenticate to GitHub Packages: https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-to-github-packages
- Add your personal access token to the Docker:
kubectl create secret docker-registry github --docker-server=docker.pkg.github.com --docker-username=my-github-username --docker-password=my-github-personal-access-token --docker-email=my-github-email-address
- Download or build Waypoint.
Note: Be sure to add Waypoint to your $PATH.
- To use the compiled version:
- Clone the Waypoint repository by using http. You will need to use configuration files and a test app from the Waypoint repository to complete this tutorial.
- Download the binary here: https://github.com/hashicorp/waypoint/releases/download/v0.1.0/waypoint-darwin-0.1.0.zip
- Extract the binary to a location outside of Downloads, such as ~/enlistments/waypoint/.
- To build Waypoint:
- Clone the Waypoint repository by using http.
- In the Terminal, navigate to the waypoint folder and run
make bin
- To use the compiled version:
- Install the Waypoint server into your Kubernetes cluster.
- Install the Waypoint server:
waypoint install
The installation will download the server's Docker image. - Once the installation is complete, verify that the server is running:
kubectl get pod -l app=waypoint-server
- The server's pod status should be Running.
- If the pod status is ImagePullBackOff, your Docker registry access token is incorrect. Review step 2 to verify that you have properly set up your registry secret.
- Install the Waypoint server:
- In the Terminal, navigate to the test-apps/wpmini Waypoint directory.
- Initialize the wpmini app with Waypoint:
waypoint init
- Use Waypoint to build the wpmini app:
waypoint build
- Deploy the app with Waypoint:
waypoint deploy
- TODO: Make Ctrl-C cancel the deploy properly if waiting on the pods to start.
- Verify that the app is running:
curl localhost:8080
- The output should read, Welcome to Waypoint!
- View the Waypoint logs to see requests for the app and the app's heartbeat:
waypoint logs
- Update the app's config to learn how it is constructed.
- Run
waypoint config set NAME=my-name
Note: NAME must be capitalized. - Run
waypoint deploy
- Run
curl localhost:8080
- The new response will read: "Hello your-selected-name, Welcome to Waypoint!"
- Run
- Access the app with the Waypoint URL Service.
- Register a hostname by executing
waypoint hostname register
(no args or flags) - Access the domain that is output in the previous step
curl https://<domain>
- Register a hostname by executing
You will want to add Waypoint to your $PATH to use the waypoint
command
without always needing to include the full directory path.
- Run
echo $PATH
to see what is in your current $PATH definition. If you do not have an entry for the Waypoint binary, add the following line to your shell profile:export PATH=$PATH:my-directory-path-to-waypoint-binary
For example:export PATH=$PATH:~/enlistments/waypoint
- To determine which shell you use, run
echo $SHELL
- If using Bash, use
nano ~/.bash_profile
to edit your Bash profile. - If using ZSH, use
nano ~/.zshrc
to edit your ZSH profile.