-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebsite-controller.yaml
More file actions
47 lines (47 loc) · 1.5 KB
/
Copy pathwebsite-controller.yaml
File metadata and controls
47 lines (47 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#When the main container starts up, it does a GET http://localhost:8001/apis/extensions.example.com/v1/websites?watch=true
#to watch for Website resources. When a Website resource is created, it will create a Deployment and Service resource
#to deploy a simple website and expose it as a NodePort service.
apiVersion: apps/v1
kind: Deployment
metadata:
name: website-controller
spec:
replicas: 1
selector:
matchLabels:
app: website-controller
template:
metadata:
name:
website-controller
labels:
app: website-controller
spec:
#The controller executes as a serviceAccount with the cluster-admin role.
#A secret will be mounted onto the containers with the certificates to access
#the kube-apiserver. This is required so the kubectl proxy can authenticate
#with the kube-apiserver.
serviceAccountName: website-controller
containers:
#The controller container.
- name: main
image: luksa/website-controller
#The kubectl proxy container. The controller needs to access the kube-apiserver
#To make it simple, it will proxy through to the api-server using kubectl
- name: proxy
image: luksa/kubectl-proxy:1.6.2
---
#Marko's example uses a NodePort service so
#we are adding a LoadBalancer service
apiVersion: v1
kind: Service
metadata:
name: kubia-website-lb
spec:
type: LoadBalancer
selector:
webserver: kubia-website
ports:
- name: http
port: 8080
targetPort: 80