Skip to content

Instantly share code, notes, and snippets.

@benbonnet
Last active October 23, 2017 12:55
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 benbonnet/cb2b4180cc066c2e08d5cd0fbad06323 to your computer and use it in GitHub Desktop.
Save benbonnet/cb2b4180cc066c2e08d5cd0fbad06323 to your computer and use it in GitHub Desktop.
Simple pv/pvc
kind: Deployment
apiVersion: "extensions/v1beta1"
metadata:
name: "service-sharp"
spec:
replicas: 5
revisionHistoryLimit: 2
template:
metadata:
labels:
service: "service-sharp"
spec:
containers:
- name: "service-sharp"
image: "xxx/xxx/xxx"
imagePullPolicy: Always
ports:
- containerPort: 3002
resources:
requests:
memory: "2Mi"
cpu: "2m"
#volumeMounts:
#- mountPath: /usr/src/app/transforms
# name: data-disk
#volumes:
#- name: data-disk
# persistentVolumeClaim:
# claimName: storage-claim
---
kind: Service
apiVersion: v1
metadata:
name: "service-sharp"
labels:
service: "service-sharp"
spec:
type: NodePort
sessionAffinity: ClientIP
ports:
- port: 3002
targetPort: 3002
selector:
service: "service-sharp"
apiVersion: v1
kind: PersistentVolume
metadata:
name: data-disk
labels:
name: data-disk
spec:
capacity:
storage: 200Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
gcePersistentDisk:
pdName: "storage-disk"
fsType: "ext4"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: storage-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment