Skip to content

Instantly share code, notes, and snippets.

@praseodym
Created July 2, 2017 17:48
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 praseodym/a75600721d217cbb5f5c3241ff988a01 to your computer and use it in GitHub Desktop.
Save praseodym/a75600721d217cbb5f5c3241ff988a01 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: PersistentVolume
metadata:
annotations:
pv.kubernetes.io/bound-by-controller: "yes"
pv.kubernetes.io/provisioned-by: local-volume-provisioner-k8s-01-2bb98394-3734-11e7-956b-00505699a646
volume.alpha.kubernetes.io/node-affinity: '{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"kubernetes.io/hostname","operator":"In","values":["k8s-01"]}]}]}}'
creationTimestamp: 2017-07-02T17:16:17Z
name: local-pv-87b4a99e
resourceVersion: "11478333"
selfLink: /api/v1/persistentvolumes/local-pv-87b4a99e
uid: 28ce6703-5f4a-11e7-9fb7-00505699a646
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 930508Ki
claimRef:
apiVersion: v1
kind: PersistentVolumeClaim
name: data-postgres-test-0
namespace: default
resourceVersion: "11478329"
uid: 16500650-5f4b-11e7-9fb7-00505699a646
local:
path: /mnt/local-storage/data/4b359fbb-3daa-49d7-87fd-b97222f7a4e0
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
status:
phase: Bound
status:
currentReplicas: 1
currentRevision: postgres-test-2680033234
observedGeneration: 1
replicas: 1
updateRevision: postgres-test-2680033234
~/k8s % kubectl get pvc data-postgres-test-0 -o yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
pv.kubernetes.io/bind-completed: "yes"
pv.kubernetes.io/bound-by-controller: "yes"
volume.beta.kubernetes.io/storage-class: local-storage
creationTimestamp: 2017-07-02T17:22:55Z
labels:
app: postgres-test
name: data-postgres-test-0
namespace: default
resourceVersion: "11478338"
selfLink: /api/v1/namespaces/default/persistentvolumeclaims/data-postgres-test-0
uid: 16500650-5f4b-11e7-9fb7-00505699a646
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 858993459200m
volumeName: local-pv-87b4a99e
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 930508Ki
phase: Bound
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1beta1","kind":"StatefulSet","metadata":{"annotations":{},"creationTimestamp":null,"generation":1,"labels":{"app":"postgres-test"},"name":"postgres-test","namespace":"default","selfLink":"/apis/apps/v1beta1/namespaces//statefulsets/postgres-test"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"postgres-test"}},"serviceName":"postgres-test","template":{"metadata":{"creationTimestamp":null,"labels":{"app":"postgres-test"}},"spec":{"containers":[{"env":[{"name":"POSTGRES_PASSWORD","value":"Phi2IthoGh0beeWaeyoi9aiC"}],"image":"postgres:9.6","imagePullPolicy":"Always","name":"postgres-test","resources":{},"securityContext":{"privileged":true},"terminationMessagePath":"/dev/termination-log","volumeMounts":[{"mountPath":"/var/lib/postgresql/data","name":"data"}]}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","securityContext":{},"terminationGracePeriodSeconds":30}},"volumeClaimTemplates":[{"metadata":{"annotations":{"volume.beta.kubernetes.io/storage-class":"local-storage"},"name":"data"},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"0.8Gi"}}}}]},"status":{"replicas":0}}
creationTimestamp: 2017-07-02T17:39:12Z
generation: 1
labels:
app: postgres-test
name: postgres-test
namespace: default
resourceVersion: "11480220"
selfLink: /apis/apps/v1beta1/namespaces/default/statefulsets/postgres-test
uid: 5c296495-5f4d-11e7-879c-00505699a646
spec:
podManagementPolicy: OrderedReady
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: postgres-test
serviceName: postgres-test
template:
metadata:
creationTimestamp: null
labels:
app: postgres-test
spec:
containers:
- env:
- name: POSTGRES_PASSWORD
value: Phi2IthoGh0beeWaeyoi9aiC
image: postgres:9.6
imagePullPolicy: Always
name: postgres-test
resources: {}
securityContext:
privileged: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: data
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
updateStrategy:
type: OnDelete
volumeClaimTemplates:
- metadata:
annotations:
volume.beta.kubernetes.io/storage-class: local-storage
creationTimestamp: null
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 858993459200m
status:
phase: Pending
status:
currentReplicas: 1
currentRevision: postgres-test-2680033234
observedGeneration: 1
replicas: 1
updateRevision: postgres-test-2680033234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment