New playbooks for k8s service and examples
- kubedns moved to playbooks dir - new ansible playbooks added for kubedash and kube-dashboard - examples for k8s deployments and services added
This commit is contained in:
18
examples/kubernetes/external-nginx/README.md
Normal file
18
examples/kubernetes/external-nginx/README.md
Normal file
@ -0,0 +1,18 @@
|
||||
Nginx example with external IPs
|
||||
===============================
|
||||
|
||||
* Edit `nginx-frontend.yaml` and update `externalIPs` to the list of external IPs of your k8s minions
|
||||
|
||||
* Deploy:
|
||||
|
||||
```bash
|
||||
kubectl create -f nginx-backends.yaml
|
||||
kubectl create -f nginx-frontend.yaml
|
||||
```
|
||||
|
||||
* Check:
|
||||
|
||||
```bash
|
||||
curl $ANY_MINION_EXTERNAL_IP
|
||||
```
|
||||
|
24
examples/kubernetes/external-nginx/nginx-backends.yaml
Normal file
24
examples/kubernetes/external-nginx/nginx-backends.yaml
Normal file
@ -0,0 +1,24 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-backend
|
||||
spec:
|
||||
replicas: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nginx-backend
|
||||
tier: backend
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
env:
|
||||
- name: GET_HOSTS_FROM
|
||||
value: dns
|
||||
ports:
|
||||
- containerPort: 80
|
22
examples/kubernetes/external-nginx/nginx-frontend.yaml
Normal file
22
examples/kubernetes/external-nginx/nginx-frontend.yaml
Normal file
@ -0,0 +1,22 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-frontend
|
||||
labels:
|
||||
app: nginx-frontend
|
||||
tier: frontend
|
||||
spec:
|
||||
externalIPs:
|
||||
- 10.210.0.12
|
||||
- 10.210.0.13
|
||||
- 10.210.0.14
|
||||
- 10.210.0.15
|
||||
- 10.210.0.16
|
||||
- 10.210.0.17
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
selector:
|
||||
app: nginx-backend
|
Reference in New Issue
Block a user