Service.yaml
· 181 B · YAML
Raw
apiVersion: v1
kind: Service
metadata:
name: <NAME>-svc
labels:
app: <NAME>
spec:
ports:
- port: 3003
name: <PORT NAME>
clusterIP: None
selector:
app: <NAME>
1 | apiVersion: v1 |
2 | kind: Service |
3 | metadata: |
4 | name: <NAME>-svc |
5 | labels: |
6 | app: <NAME> |
7 | spec: |
8 | ports: |
9 | - port: 3003 |
10 | name: <PORT NAME> |
11 | clusterIP: None |
12 | selector: |
13 | app: <NAME> |
StatefulSet.yaml
· 614 B · YAML
Raw
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: <NAME>
labels:
app: <NAME>
spec:
serviceName: <NAME>
minReadySeconds: 10
replicas: 1
selector:
matchLabels:
app: <NAME>
template:
metadata:
labels:
app: <NAME>
spec:
volumes:
- name: <NAME>-vol
persistentVolumeClaim:
claimName: <NAME>-pvc
containers:
- image: "<IMAGE>"
#imagePullPolicy: Never
name: app
volumeMounts:
- mountPath: /path
name: <NAME>-vol
ports:
- containerPort: 3003
# hostPort: 8085
1 | apiVersion: apps/v1 |
2 | kind: StatefulSet |
3 | metadata: |
4 | name: <NAME> |
5 | labels: |
6 | app: <NAME> |
7 | spec: |
8 | serviceName: <NAME> |
9 | minReadySeconds: 10 |
10 | replicas: 1 |
11 | selector: |
12 | matchLabels: |
13 | app: <NAME> |
14 | template: |
15 | metadata: |
16 | labels: |
17 | app: <NAME> |
18 | spec: |
19 | volumes: |
20 | - name: <NAME>-vol |
21 | persistentVolumeClaim: |
22 | claimName: <NAME>-pvc |
23 | containers: |
24 | - image: "<IMAGE>" |
25 | #imagePullPolicy: Never |
26 | name: app |
27 | volumeMounts: |
28 | - mountPath: /path |
29 | name: <NAME>-vol |
30 | ports: |
31 | - containerPort: 3003 |
32 | # hostPort: 8085 |
33 |