mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
waypoint wip
This commit is contained in:
parent
60c5f6062c
commit
b40c6bde5c
3
.gitignore
vendored
3
.gitignore
vendored
@ -9,3 +9,6 @@ __pycache__/
|
|||||||
*.tfstate
|
*.tfstate
|
||||||
*.tfstate.*
|
*.tfstate.*
|
||||||
security/letsencrypt/introduction/certs/**
|
security/letsencrypt/introduction/certs/**
|
||||||
|
|
||||||
|
hashicorp/waypoint/*/data.db*
|
||||||
|
hashicorp/waypoint/*/.waypoint
|
58
hashicorp/waypoint/README.md
Normal file
58
hashicorp/waypoint/README.md
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
# Introduction to Waypoint
|
||||||
|
|
||||||
|
I will do the following: <br/>
|
||||||
|
|
||||||
|
* Run a local Kubernetes cluster with [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/)
|
||||||
|
* Run a container to extract the windows `waypoint` binary + move it to $PATH
|
||||||
|
|
||||||
|
|
||||||
|
## We need a Kubernetes cluster
|
||||||
|
|
||||||
|
Lets create a Kubernetes cluster to play with using [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/)
|
||||||
|
|
||||||
|
```
|
||||||
|
kind create cluster --name waypoint --image kindest/node:v1.19.1
|
||||||
|
```
|
||||||
|
|
||||||
|
## Get the Waypoint binary for Windows
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
Feel free to follow the official install guide using the [docs](https://learn.hashicorp.com/tutorials/waypoint/get-started-install) <br/>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
Use a container to download and extract the binary:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -it --rm -v ${PWD}:/work -w /work alpine sh -c 'apk add --no-cache curl unzip && curl -LO https://releases.hashicorp.com/waypoint/0.1.3/waypoint_0.1.3_windows_amd64.zip && unzip waypoint_0.1.3_windows_amd64.zip && rm waypoint_0.1.3_windows_amd64.zip'
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
I've setup my Windows $PATH environment to point to a folder `C:\kubectl\`
|
||||||
|
|
||||||
|
```
|
||||||
|
mv waypoint.exe C:\kubectl\waypoint.exe
|
||||||
|
|
||||||
|
#open new powershell terminal
|
||||||
|
|
||||||
|
waypoint --help
|
||||||
|
```
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
## Install Waypoint server
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl port-forward svc/waypoint 9701:9701
|
||||||
|
waypoint install --platform=kubernetes -accept-tos
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Waypoint Kubernetes + Python example
|
||||||
|
|
||||||
|
```
|
||||||
|
cd hashicorp/waypoint/python/
|
||||||
|
|
||||||
|
waypoint init
|
||||||
|
waypoint up
|
||||||
|
```
|
12
hashicorp/waypoint/python/dockerfile
Normal file
12
hashicorp/waypoint/python/dockerfile
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
FROM python:3.7.3-alpine3.9 as base
|
||||||
|
|
||||||
|
RUN mkdir /work/
|
||||||
|
WORKDIR /work/
|
||||||
|
|
||||||
|
COPY requirements.txt /work/requirements.txt
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
COPY server.py /work/server.py
|
||||||
|
|
||||||
|
ENV FLASK_APP=server.py
|
||||||
|
CMD flask run -h 0.0.0.0 -p 5000
|
1
hashicorp/waypoint/python/requirements.txt
Normal file
1
hashicorp/waypoint/python/requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Flask == 1.0.3
|
6
hashicorp/waypoint/python/server.py
Normal file
6
hashicorp/waypoint/python/server.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
from flask import Flask
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
def hello():
|
||||||
|
return "Hello World!"
|
31
hashicorp/waypoint/python/waypoint.hcl
Normal file
31
hashicorp/waypoint/python/waypoint.hcl
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
project = "example-nodejs"
|
||||||
|
|
||||||
|
app "example-nodejs" {
|
||||||
|
labels = {
|
||||||
|
"service" = "example-nodejs",
|
||||||
|
"env" = "dev"
|
||||||
|
}
|
||||||
|
|
||||||
|
build {
|
||||||
|
use "pack" {}
|
||||||
|
registry {
|
||||||
|
use "docker" {
|
||||||
|
image = "aimvector/waypoint-python-example"
|
||||||
|
tag = "1"
|
||||||
|
local = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
deploy {
|
||||||
|
use "kubernetes" {
|
||||||
|
probe_path = "/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
release {
|
||||||
|
use "kubernetes" {
|
||||||
|
port = 5000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user