mirror of
https://github.com/nofusscomputing/kubernetes.git
synced 2025-08-02 04:22:42 +00:00
48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/component: webserver
|
|
name: nginx
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: webserver
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/component: webserver
|
|
spec:
|
|
containers:
|
|
- name: backend
|
|
image: docker.io/nginx:alpine
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 80
|
|
name: http
|
|
resources:
|
|
limits:
|
|
cpu: 200m
|
|
memory: 256Mi
|
|
requests:
|
|
cpu: 10m
|
|
memory: 20Mi
|
|
volumeMounts:
|
|
- name: http-root
|
|
mountPath: /usr/share/nginx/html
|
|
mountPropagation: HostToContainer
|
|
- name: nginx-config
|
|
mountPath: /etc/nginx/conf.d
|
|
tolerations: []
|
|
volumes:
|
|
- name: http-root
|
|
hostPath:
|
|
# Ensure the file directory is created.
|
|
path: /opt/webserver
|
|
type: DirectoryOrCreate
|
|
- name: nginx-config
|
|
configMap:
|
|
name: nginx-config
|