Добавлены services и statefulset
This commit is contained in:
parent
fd21b566f1
commit
c1ce0dcb2d
6 changed files with 102 additions and 0 deletions
21
02-service/deployment.yaml
Normal file
21
02-service/deployment.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-deployment
|
||||
labels:
|
||||
app: &app nginx
|
||||
spec:
|
||||
replicas: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: *app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: *app
|
||||
spec:
|
||||
containers:
|
||||
- name: *app
|
||||
image: nginx:1.28.2-alpine
|
||||
ports:
|
||||
- containerPort: 80
|
||||
16
02-service/service-cluster-ip.yaml
Normal file
16
02-service/service-cluster-ip.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-srv
|
||||
labels:
|
||||
app: &app nginx
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: 10.43.2.28
|
||||
selector:
|
||||
app: *app
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
name: http
|
||||
16
02-service/service-node-port.yaml
Normal file
16
02-service/service-node-port.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-srv
|
||||
labels:
|
||||
app: &app nginx
|
||||
spec:
|
||||
selector:
|
||||
app: *app
|
||||
type: NodePort
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
nodePort: 31337
|
||||
name: http
|
||||
14
02-service/service.yaml
Normal file
14
02-service/service.yaml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-srv
|
||||
labels:
|
||||
app: &app nginx
|
||||
spec:
|
||||
selector:
|
||||
app: *app
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
name: http
|
||||
22
03-statefulset/deployment.yaml
Normal file
22
03-statefulset/deployment.yaml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: nginx-deployment
|
||||
labels:
|
||||
app: &app nginx
|
||||
spec:
|
||||
replicas: 3
|
||||
serviceName: "nginx-srv"
|
||||
selector:
|
||||
matchLabels:
|
||||
app: *app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: *app
|
||||
spec:
|
||||
containers:
|
||||
- name: *app
|
||||
image: nginx:1.28.2-alpine
|
||||
ports:
|
||||
- containerPort: 80
|
||||
13
03-statefulset/service-headless.yaml
Normal file
13
03-statefulset/service-headless.yaml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-srv
|
||||
labels:
|
||||
app: &app nginx
|
||||
spec:
|
||||
selector:
|
||||
app: *app
|
||||
ports:
|
||||
- port: 80
|
||||
name: http
|
||||
clusterIP: None
|
||||
Loading…
Add table
Add a link
Reference in a new issue