ConfigMap.yaml
· 85 B · YAML
Raw
apiVersion: v1
kind: ConfigMap
metadata:
name: <NAME>-config
data:
VAR: "value"
1 | apiVersion: v1 |
2 | kind: ConfigMap |
3 | metadata: |
4 | name: <NAME>-config |
5 | data: |
6 | VAR: "value" |
Ingress.yaml
· 488 B · YAML
Raw
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: <NAME>
spec:
ingressClassName: nginx
rules:
- host: example.com
http:
paths:
- pathType: Prefix
backend:
service:
name: <NAME>
port:
number: 3003
path: /
# This section is only required if TLS is to be enabled for the Ingress
tls:
- hosts:
- example.com
secretName: <TLSSECRETNAME>
1 | apiVersion: networking.k8s.io/v1 |
2 | kind: Ingress |
3 | metadata: |
4 | name: <NAME> |
5 | spec: |
6 | ingressClassName: nginx |
7 | rules: |
8 | - host: example.com |
9 | http: |
10 | paths: |
11 | - pathType: Prefix |
12 | backend: |
13 | service: |
14 | name: <NAME> |
15 | port: |
16 | number: 3003 |
17 | path: / |
18 | # This section is only required if TLS is to be enabled for the Ingress |
19 | tls: |
20 | - hosts: |
21 | - example.com |
22 | secretName: <TLSSECRETNAME> |
23 | |
24 |
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 |
storage.yaml
· 668 B · YAML
Raw
apiVersion: v1
kind: PersistentVolume
metadata:
name: <NAME>-pv
spec:
capacity:
storage: 100Mi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: <STORAGECLASSNAME>
local:
path: /path/to/data/on/host
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- <HOSTNAME>
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: <NAME>-pvc
spec:
storageClassName: <STORAGECLASSNAME>
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
1 | apiVersion: v1 |
2 | kind: PersistentVolume |
3 | metadata: |
4 | name: <NAME>-pv |
5 | spec: |
6 | capacity: |
7 | storage: 100Mi |
8 | volumeMode: Filesystem |
9 | accessModes: |
10 | - ReadWriteOnce |
11 | persistentVolumeReclaimPolicy: Retain |
12 | storageClassName: <STORAGECLASSNAME> |
13 | local: |
14 | path: /path/to/data/on/host |
15 | nodeAffinity: |
16 | required: |
17 | nodeSelectorTerms: |
18 | - matchExpressions: |
19 | - key: kubernetes.io/hostname |
20 | operator: In |
21 | values: |
22 | - <HOSTNAME> |
23 | --- |
24 | apiVersion: v1 |
25 | kind: PersistentVolumeClaim |
26 | metadata: |
27 | name: <NAME>-pvc |
28 | spec: |
29 | storageClassName: <STORAGECLASSNAME> |
30 | accessModes: |
31 | - ReadWriteOnce |
32 | resources: |
33 | requests: |
34 | storage: 100Mi |
35 |