-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ECK. Reorganize ./extras dependencies, seperate concerns. Add REA…
…DMEs. Start supporting Ingress (Ambassador for now).
- Loading branch information
1 parent
c88520d
commit 2385e49
Showing
11 changed files
with
198 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
. ./lib/create-cluster.sh | ||
|
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,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
. ./lib/dashboard.sh | ||
|
||
# Install Elasticsearch ECK, and add necessary glue to Prometheus | ||
helm repo add elastic https://helm.elastic.co | ||
helm repo update | ||
|
||
helm install --atomic elastic-operator elastic/eck-operator -n elastic-system --create-namespace \ | ||
--set podMonitor.enabled=true \ | ||
--set config.metricsPort="8080" |
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,24 +1,13 @@ | ||
. ./lib/dashboard.sh | ||
|
||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm repo update | ||
#helm install --atomic my-metrics-server bitnami/metrics-server --version 5.9.2 | ||
#helm upgrade --atomic my-metrics-server bitnami/metrics-server --set apiService.create=true | ||
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/ | ||
helm repo update | ||
kubectl create namespace monitor | ||
helm install --atomic my-metrics-server metrics-server/metrics-server --version 3.6.0 --set apiService.create=true --set args={--kubelet-insecure-tls} -n monitor | ||
helm install --atomic my-kube-state-metrics bitnami/kube-state-metrics --version 2.1.1 | ||
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | ||
helm repo update | ||
helm install --atomic my-prometheus-stack prometheus-community/kube-prometheus-stack --create-namespace -n monitor \ | ||
--set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false \ | ||
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false | ||
sleep 30 | ||
kubectl port-forward -n monitor prometheus-my-prometheus-stack-kube-p-prometheus-0 9090 --address 0.0.0.0 >> /dev/null & | ||
my_ip=$(ip -j -p addr show eth1 | jq -r .[].addr_info[0].local) | ||
#my_ip=$(ip -j -p addr show eth1 | jq -r .[].addr_info[0].local) | ||
echo "Prometheus UI: http://kind.test:9090/ or http://$my_ip:9090/" | ||
kubectl --namespace monitor port-forward svc/my-prometheus-stack-grafana 3000:80 --address 0.0.0.0 >> /dev/null & | ||
echo "Grafana: http://kind.test:3000/ or http://$my_ip:9090/ user: admin password: prom-operator" | ||
|
||
|
||
echo "Grafana: http://kind.test:3000/ or http://$my_ip:3000/ user: admin password: prom-operator" |
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,80 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Deploy example app from KinD Ingress documentation, but add relevant Ambassador ingress annotations | ||
|
||
|
||
kubectl apply -f - <<EOF | ||
kind: Pod | ||
apiVersion: v1 | ||
metadata: | ||
name: foo-app | ||
labels: | ||
app: foo | ||
spec: | ||
containers: | ||
- name: foo-app | ||
image: hashicorp/http-echo:0.2.3 | ||
args: | ||
- "-text=foo" | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: foo-service | ||
spec: | ||
selector: | ||
app: foo | ||
ports: | ||
# Default port used by the image | ||
- port: 5678 | ||
--- | ||
kind: Pod | ||
apiVersion: v1 | ||
metadata: | ||
name: bar-app | ||
labels: | ||
app: bar | ||
spec: | ||
containers: | ||
- name: bar-app | ||
image: hashicorp/http-echo:0.2.3 | ||
args: | ||
- "-text=bar" | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: bar-service | ||
spec: | ||
selector: | ||
app: bar | ||
ports: | ||
# Default port used by the image | ||
- port: 5678 | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: example-ingress | ||
annotations: | ||
kubernetes.io/ingress.class: ambassador | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- pathType: Prefix | ||
path: "/foo" | ||
backend: | ||
service: | ||
name: foo-service | ||
port: | ||
number: 5678 | ||
- pathType: Prefix | ||
path: "/bar" | ||
backend: | ||
service: | ||
name: bar-service | ||
port: | ||
number: 5678 | ||
--- | ||
EOF |
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 @@ | ||
NOTE: Every script must inherit this file, so that variables set here are set in those scripts as well. |
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,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "vagrant-kind: Create a 10 node, 9 worker cluster, ready for ingress use" | ||
kind create cluster --config=- <<EOF | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: worker | ||
- role: control-plane | ||
kubeadmConfigPatches: | ||
- | | ||
kind: InitConfiguration | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
node-labels: "ingress-ready=true" | ||
extraPortMappings: | ||
- containerPort: 80 | ||
hostPort: 80 | ||
protocol: TCP | ||
- containerPort: 443 | ||
hostPort: 443 | ||
protocol: TCP | ||
- role: worker | ||
- role: worker | ||
- role: worker | ||
- role: worker | ||
- role: worker | ||
- role: worker | ||
- role: worker | ||
- role: worker | ||
EOF | ||
|
||
echo "vagrant-kind: KinD cluster info" | ||
kubectl cluster-info --context kind-kind | ||
|
||
echo "vagrant-kind: Install some utilities" | ||
sudo apt-get install jq --yes | ||
|
||
echo "vagrant-kind: Prepare for helm use" | ||
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add - | ||
sudo apt-get install apt-transport-https --yes | ||
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list | ||
sudo apt-get update | ||
sudo apt-get install helm | ||
|
||
echo "vagrant-kind: Cluster creation complete." | ||
|
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,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
. ./lib/dashboard.sh | ||
|
||
# Tried: | ||
# NGINX Ingress: Failed | ||
# Ambassador: Success | ||
|
||
kubectl apply -f https://github.com/datawire/ambassador-operator/releases/latest/download/ambassador-operator-crds.yaml | ||
|
||
kubectl apply -n ambassador -f https://github.com/datawire/ambassador-operator/releases/latest/download/ambassador-operator-kind.yaml | ||
kubectl wait --timeout=180s -n ambassador --for=condition=deployed ambassadorinstallations/ambassador | ||
|
||
echo "NOTE: You will need to annotate any ingress resources you wish to expose via Ambassador" | ||
echo "with the following *after* the resources are created:" | ||
echo | ||
echo "kubectl annotate ingress example-ingress kubernetes.io/ingress.class=ambassador" |
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,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
. ./lib/ingress.sh | ||
|