Добавлены services и statefulset

This commit is contained in:
B4D_US3R 2026-03-18 22:20:01 +05:00
parent fd21b566f1
commit c1ce0dcb2d
6 changed files with 102 additions and 0 deletions

View 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

View 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

View 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
View 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

View 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

View 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