Skip to content

Commit

Permalink
Ch16 exercises - network policy
Browse files Browse the repository at this point in the history
  • Loading branch information
sixeyed committed Jul 9, 2020
1 parent 47a28b0 commit 3ada871
Show file tree
Hide file tree
Showing 6 changed files with 963 additions and 0 deletions.
38 changes: 38 additions & 0 deletions ch16/apod/api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: v1
kind: Service
metadata:
name: apod-api
labels:
kiamol: ch16
spec:
ports:
- port: 80
targetPort: api
selector:
app: apod-api
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: apod-api
labels:
kiamol: ch16
spec:
selector:
matchLabels:
app: apod-api
template:
metadata:
labels:
app: apod-api
annotations:
prometheus.io/path: "/actuator/prometheus"
spec:
containers:
- name: api
image: kiamol/ch14-image-of-the-day
ports:
- containerPort: 80
name: api

36 changes: 36 additions & 0 deletions ch16/apod/log.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: v1
kind: Service
metadata:
name: apod-log
labels:
kiamol: ch16
spec:
ports:
- port: 80
targetPort: api
selector:
app: apod-log
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: apod-log
labels:
kiamol: ch16
spec:
selector:
matchLabels:
app: apod-log
template:
metadata:
labels:
app: apod-log
spec:
containers:
- name: api
image: kiamol/ch14-access-log
ports:
- containerPort: 80
name: api

18 changes: 18 additions & 0 deletions ch16/apod/update/networkpolicy-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: apod-api
labels:
kiamol: ch16
spec:
podSelector:
matchLabels:
app: apod-api
ingress:
- from:
- podSelector:
matchLabels:
app: apod-web
ports:
- protocol: TCP
port: api
35 changes: 35 additions & 0 deletions ch16/apod/web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: v1
kind: Service
metadata:
name: apod-web
labels:
kiamol: ch16
spec:
ports:
- port: 8016
targetPort: web
selector:
app: apod-web
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: apod-web
labels:
kiamol: ch16
spec:
selector:
matchLabels:
app: apod-web
template:
metadata:
labels:
app: apod-web
spec:
containers:
- name: web
image: kiamol/ch14-image-gallery
ports:
- containerPort: 80
name: web
Loading

0 comments on commit 3ada871

Please sign in to comment.