86 lines
1.9 KiB
YAML
86 lines
1.9 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: demos-static
|
|
namespace: demos-static
|
|
labels:
|
|
app: demos-static
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: demos-static
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: demos-static
|
|
spec:
|
|
nodeSelector:
|
|
kubernetes.io/hostname: raspberry
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 101
|
|
runAsGroup: 101
|
|
fsGroup: 101
|
|
fsGroupChangePolicy: OnRootMismatch
|
|
containers:
|
|
- name: demos-static
|
|
image: 192.168.100.68:30500/demos-static:latest
|
|
imagePullPolicy: Always
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
readOnlyRootFilesystem: true
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
ports:
|
|
- containerPort: 8080
|
|
name: http
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: http
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: http
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 30
|
|
resources:
|
|
requests:
|
|
cpu: 15m
|
|
memory: 32Mi
|
|
limits:
|
|
memory: 128Mi
|
|
volumeMounts:
|
|
- name: nginx-cache
|
|
mountPath: /var/cache/nginx
|
|
- name: nginx-run
|
|
mountPath: /var/run
|
|
- name: tmp
|
|
mountPath: /tmp
|
|
volumes:
|
|
- name: nginx-cache
|
|
emptyDir: {}
|
|
- name: nginx-run
|
|
emptyDir: {}
|
|
- name: tmp
|
|
emptyDir: {}
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: demos-static-service
|
|
namespace: demos-static
|
|
spec:
|
|
type: NodePort
|
|
externalTrafficPolicy: Local
|
|
ports:
|
|
- port: 80
|
|
targetPort: http
|
|
nodePort: 30081
|
|
selector:
|
|
app: demos-static
|