Skip to content

Instantly share code, notes, and snippets.

@tutsunom
Created November 24, 2019 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tutsunom/0e418650eb948483351d0a03f52a62f2 to your computer and use it in GitHub Desktop.
Save tutsunom/0e418650eb948483351d0a03f52a62f2 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: date
spec:
replicas: 3
selector:
matchLabels:
app: date
strategy:
type: Recreate
template:
metadata:
labels:
app: date
spec:
containers:
- name: date
image: busybox
command: ["/bin/sh", "-c", "while true; do echo `date` by `hostname` >> /mnt/`hostname`; echo `date` by `hostname` >> /mnt/shared_file; sleep 1; done"]
volumeMounts:
- name: date-pv
mountPath: "/mnt"
volumes:
- name: date-pv
persistentVolumeClaim:
claimName: cephfs-pvc
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: role
operator: In
values:
- app
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cephfs-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: csi-cephfs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment