This commit is contained in:
2024-02-20 17:15:27 +08:00
committed by huty
parent 6706e1a633
commit 34158042ad
1529 changed files with 177765 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: todo-web
namespace: kiamol-ch17
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: todo-web
namespace: kiamol-ch17
spec:
selector:
matchLabels:
app: todo-web
template:
metadata:
labels:
app: todo-web
spec:
serviceAccountName: todo-web
initContainers:
- name: configurator
image: kiamol/ch17-todo-list-configurator
volumeMounts:
- name: shared
mountPath: "/config-out"
readOnly: false
containers:
- name: web
image: kiamol/ch04-todo-list
volumeMounts:
- name: shared
mountPath: "/app/config"
readOnly: true
volumes:
- name: shared
emptyDir: {}

View File

@@ -0,0 +1,26 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ch17-reader
labels:
kiamol: ch17
rules:
- apiGroups: [""]
resources: ["namespaces"]
resourceNames: ["kiamol-ch17"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: todo-web-reader
labels:
kiamol: ch17
subjects:
- kind: ServiceAccount
name: todo-web
namespace: kiamol-ch17
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ch17-reader

View File

@@ -0,0 +1,38 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: todo-web
namespace: kiamol-ch17
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: todo-web
namespace: kiamol-ch17
spec:
selector:
matchLabels:
app: todo-web
template:
metadata:
labels:
app: todo-web
spec:
serviceAccountName: todo-web
initContainers:
- name: configurator
image: kiamol/ch17-todo-list-configurator
volumeMounts:
- name: shared
mountPath: "/config-out"
readOnly: false
containers:
- name: web
image: kiamol/ch04-todo-list
volumeMounts:
- name: shared
mountPath: "/app/config"
readOnly: true
volumes:
- name: shared
emptyDir: {}

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: todo-web
namespace: kiamol-ch17
spec:
type: LoadBalancer
ports:
- port: 8020
targetPort: 80
selector:
app: todo-web