101 lines
2.0 KiB
YAML
101 lines
2.0 KiB
YAML
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: assets
|
|
namespace: homer
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteMany
|
|
resources:
|
|
requests:
|
|
storage: 64M
|
|
storageClassName: cephfs-hyper
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: homer
|
|
namespace: homer
|
|
labels:
|
|
app: homer
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: homer
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: homer
|
|
spec:
|
|
dnsConfig:
|
|
options:
|
|
- name: ndots
|
|
value: "1"
|
|
securityContext:
|
|
runAsUser: 1000
|
|
runAsGroup: 1000
|
|
fsGroup: 1000
|
|
initContainers:
|
|
- name: copy-assets
|
|
image: b4bz/homer
|
|
command: ['/bin/startup.sh']
|
|
volumeMounts:
|
|
- mountPath: /www/assets
|
|
name: assets
|
|
- mountPath: /bin/startup.sh
|
|
name: startup
|
|
subPath: startup.sh
|
|
containers:
|
|
- name: homer
|
|
image: b4bz/homer:latest
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 8080
|
|
volumeMounts:
|
|
- mountPath: /www/assets/config.yml
|
|
name: assets-config
|
|
subPath: config.yml
|
|
- mountPath: /www/assets
|
|
name: assets
|
|
volumes:
|
|
- name: assets-config
|
|
configMap:
|
|
name: config
|
|
defaultMode: 0700
|
|
items:
|
|
- key: "config.yml"
|
|
path: "config.yml"
|
|
- name: startup
|
|
configMap:
|
|
name: startup
|
|
defaultMode: 0700
|
|
items:
|
|
- key: "startup.sh"
|
|
path: "startup.sh"
|
|
- name: assets
|
|
persistentVolumeClaim:
|
|
claimName: assets
|
|
readOnly: false
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: homer
|
|
namespace: homer
|
|
spec:
|
|
ipFamilies:
|
|
- IPv6
|
|
- IPv4
|
|
ipFamilyPolicy: PreferDualStack
|
|
#ipFamilyPolicy: SingleStack
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
protocol: TCP
|
|
targetPort: 8080
|
|
selector:
|
|
app: homer
|
|
sessionAffinity: None
|
|
type: ClusterIP
|