additional resources
This commit is contained in:
parent
041cffe032
commit
2c5c119731
4 changed files with 186 additions and 0 deletions
9
CKA_Course/role-pod-reader.yaml
Normal file
9
CKA_Course/role-pod-reader.yaml
Normal file
|
@ -0,0 +1,9 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
namespace: cka
|
||||
name: pod-reader
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["pods", "pods/log"]
|
||||
verbs: ["get", "watch", "list"]
|
13
CKA_Course/rolebinding-sa-pod-reader.yaml
Normal file
13
CKA_Course/rolebinding-sa-pod-reader.yaml
Normal file
|
@ -0,0 +1,13 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: sa-pod-reader
|
||||
namespace: cka
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: my-serviceaccount
|
||||
namespace: cka
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: pod-reader
|
||||
apiGroup: rbac.authorization.k8s.io
|
5
CKA_Course/sa-my-service-account.yaml
Normal file
5
CKA_Course/sa-my-service-account.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: my-serviceaccount
|
||||
namespace: cka
|
159
yelb/yelb-lb.yaml
Normal file
159
yelb/yelb-lb.yaml
Normal file
|
@ -0,0 +1,159 @@
|
|||
# Minor modification from http://www.it20.info/2017/07/yelb-yet-another-sample-app/ for demo purposes
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: yelb
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis-server
|
||||
labels:
|
||||
app: redis-server
|
||||
tier: cache
|
||||
namespace: yelb
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 6379
|
||||
selector:
|
||||
app: redis-server
|
||||
tier: cache
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: yelb-db
|
||||
labels:
|
||||
app: yelb-db
|
||||
tier: backenddb
|
||||
namespace: yelb
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 5432
|
||||
selector:
|
||||
app: yelb-db
|
||||
tier: backenddb
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: yelb-appserver
|
||||
labels:
|
||||
app: yelb-appserver
|
||||
tier: middletier
|
||||
namespace: yelb
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 4567
|
||||
selector:
|
||||
app: yelb-appserver
|
||||
tier: middletier
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: yelb-ui
|
||||
labels:
|
||||
app: yelb-ui
|
||||
tier: frontend
|
||||
namespace: yelb
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
selector:
|
||||
app: yelb-ui
|
||||
tier: frontend
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: yelb-ui
|
||||
namespace: yelb
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: yelb-ui
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: yelb-ui
|
||||
tier: frontend
|
||||
spec:
|
||||
containers:
|
||||
- name: yelb-ui
|
||||
image: mreferre/yelb-ui:0.6
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis-server
|
||||
namespace: yelb
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis-server
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis-server
|
||||
tier: cache
|
||||
spec:
|
||||
containers:
|
||||
- name: redis-server
|
||||
image: redis:4.0.2
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: yelb-db
|
||||
namespace: yelb
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: yelb-db
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: yelb-db
|
||||
tier: backenddb
|
||||
spec:
|
||||
containers:
|
||||
- name: yelb-db
|
||||
image: mreferre/yelb-db:0.5
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: yelb-appserver
|
||||
namespace: yelb
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: yelb-appserver
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: yelb-appserver
|
||||
tier: middletier
|
||||
spec:
|
||||
containers:
|
||||
- name: yelb-appserver
|
||||
image: mreferre/yelb-appserver:0.5
|
||||
ports:
|
||||
- containerPort: 4567
|
Loading…
Reference in a new issue