-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding kind configs Signed-off-by: gar <[email protected]> * Adding kind env Signed-off-by: gar <[email protected]> * updating kind nodeport Signed-off-by: gar <[email protected]> * Adding namespace file Signed-off-by: gar <[email protected]> * Separating out the pod afinity rules for controller and default-backend Signed-off-by: gar <[email protected]> * Adding namespace file Signed-off-by: gar <[email protected]> * updating readme with curl test Signed-off-by: gar <[email protected]>
- Loading branch information
Showing
7 changed files
with
201 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
Kind | ||
======= | ||
Kind is an open source project that brings up a local Kuberenetes environment all | ||
running in Docker. | ||
|
||
Doc: https://kind.sigs.k8s.io/docs/user/quick-start/ | ||
|
||
|
||
# Installation instructions: | ||
|
||
Doc: https://github.com/kubernetes-sigs/kind#installation-and-usage | ||
|
||
|
||
# Usage: | ||
|
||
## Creation: | ||
``` | ||
kind create cluster --config config.yaml --image kindest/node:v1.13.12 | ||
``` | ||
|
||
## List | ||
``` | ||
kind get clusters | ||
``` | ||
|
||
## Delete | ||
``` | ||
kind delete cluster | ||
``` | ||
|
||
## Debug | ||
By defaul if the create command fails it will clean up the Docker containers. | ||
|
||
You can append the `--retain` flag in the `kind create cluster...` command so | ||
it won't remove the Docker containers on failure and you can debug the containers | ||
from there. | ||
|
||
There is also a verbose flag to give you more information on what it is doing: `--v 7` | ||
|
||
# Example deployment | ||
|
||
## nginx-ingress | ||
|
||
``` | ||
cd kubernetes/helm/nginx-ingress/ | ||
``` | ||
|
||
Deploy: | ||
``` | ||
make ENVIRONMENT=kind external-apply | ||
``` | ||
|
||
## http-echo app | ||
|
||
``` | ||
cd kubernetes/helm/http-echo | ||
``` | ||
|
||
Deploy: | ||
``` | ||
kubectl apply -f namespace.yaml | ||
kubectl -n http-echo apply -f . | ||
``` | ||
|
||
Test out the ingress: | ||
```bash | ||
root@ip-10-4-2-98:/home/ubuntu/kubernetes-ops/kubernetes/helm/http-echo# curl -v http://localhost -H "HOST: gar1.example.com" | ||
* Rebuilt URL to: http://localhost/ | ||
* Trying 127.0.0.1... | ||
* TCP_NODELAY set | ||
* Connected to localhost (127.0.0.1) port 80 (#0) | ||
> GET / HTTP/1.1 | ||
> HOST: gar1.example.com | ||
> User-Agent: curl/7.58.0 | ||
> Accept: */* | ||
> | ||
< HTTP/1.1 200 OK | ||
< Server: nginx/1.15.10 | ||
< Date: Thu, 19 Dec 2019 20:28:46 GMT | ||
< Content-Type: text/plain | ||
< Transfer-Encoding: chunked | ||
< Connection: keep-alive | ||
< Vary: Accept-Encoding | ||
< | ||
|
||
|
||
Hostname: echoserver-6bdccfbcd4-jv557 | ||
|
||
Pod Information: | ||
-no pod information available- | ||
|
||
Server values: | ||
server_version=nginx: 1.13.3 - lua: 10008 | ||
|
||
Request Information: | ||
client_address=10.244.1.17 | ||
method=GET | ||
real path=/ | ||
query= | ||
request_version=1.1 | ||
request_scheme=http | ||
request_uri=http://gar1.example.com:8080/ | ||
|
||
Request Headers: | ||
accept=*/* | ||
host=gar1.example.com | ||
user-agent=curl/7.58.0 | ||
x-forwarded-for=10.244.1.1 | ||
x-forwarded-host=gar1.example.com | ||
x-forwarded-port=80 | ||
x-forwarded-proto=http | ||
x-original-uri=/ | ||
x-real-ip=10.244.1.1 | ||
x-request-id=2052b9f9e6a91587c5810773352fe7ab | ||
x-scheme=http | ||
|
||
Request Body: | ||
-no body in request- | ||
|
||
* Connection #0 to host localhost left intact | ||
``` |
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,30 @@ | ||
--- | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
|
||
nodes: | ||
- role: control-plane | ||
- role: worker | ||
extraPortMappings: | ||
- containerPort: 30080 | ||
hostPort: 80 | ||
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0" | ||
protocol: tcp | ||
- containerPort: 30443 | ||
hostPort: 443 | ||
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0" | ||
protocol: tcp | ||
kubeadmConfigPatches: | ||
- | | ||
apiVersion: kubeadm.k8s.io/v1beta2 | ||
kind: InitConfiguration | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
node-labels: "ingress-ready=true" | ||
authorization-mode: "AlwaysAllow" | ||
# - role: worker | ||
# extraPortMappings: | ||
# - containerPort: 8080 | ||
# hostPort: 8080 | ||
# listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0" | ||
# protocol: udp # Optional, defaults to tcp |
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,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: http-echo | ||
labels: | ||
name: http-ech |
20 changes: 20 additions & 0 deletions
20
kubernetes/helm/nginx-ingress/environments/kind/values-external.yaml
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,20 @@ | ||
nginx-ingress: | ||
controller: | ||
electionID: ingress-controller-leader-external | ||
ingressClass: nginx-external | ||
|
||
# service: | ||
# annotations: | ||
# service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-1:11111111111:certificate/1111111-1111-1111-1111-111111111" | ||
|
||
# Whitelisting IPs inbound | ||
# loadBalancerSourceRanges: | ||
# # Temporary ManagedKube | ||
# - 38.30.8.138/32 | ||
# - 1.1.1.1/32 | ||
|
||
service: | ||
type: NodePort | ||
nodePorts: | ||
http: "30080" | ||
https: "30443" |
14 changes: 14 additions & 0 deletions
14
kubernetes/helm/nginx-ingress/environments/kind/values-internal.yaml
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,14 @@ | ||
nginx-ingress: | ||
controller: | ||
electionID: ingress-controller-leader-internal | ||
ingressClass: nginx-internal | ||
|
||
service: | ||
annotations: | ||
service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 | ||
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-1:11111111111:certificate/1111111-1111-1111-1111-111111111" | ||
|
||
type: NodePort | ||
nodePorts: | ||
http: "31080" | ||
https: "31443" |
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,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: ingress | ||
labels: | ||
name: ingress |
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