Skip to content

Instantly share code, notes, and snippets.

@Jooho
Last active August 18, 2017 14:16
Show Gist options
  • Save Jooho/f59a644fb139a77e33b718a704f710a0 to your computer and use it in GitHub Desktop.
Save Jooho/f59a644fb139a77e33b718a704f710a0 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Pod
metadata:
annotations:
kubernetes.io/created-by: |
{"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicationController","namespace":"postgresql-test","name":"postgresql-2","uid":"ab564aaf-841e-11e7-9072-5254009e71c2","apiVersion":"v1","resourceVersion":"592182"}}
openshift.io/deployment-config.latest-version: "2"
openshift.io/deployment-config.name: postgresql
openshift.io/deployment.name: postgresql-2
openshift.io/scc: anyuid
creationTimestamp: 2017-08-18T14:08:15Z
generateName: postgresql-2-
labels:
deployment: postgresql-2
deploymentconfig: postgresql
name: postgresql
name: postgresql-2-xlkzf
namespace: postgresql-test
resourceVersion: "592206"
selfLink: /api/v1/namespaces/postgresql-test/pods/postgresql-2-xlkzf
uid: ad5f3c33-841e-11e7-9072-5254009e71c2
spec:
containers:
- env:
- name: POSTGRESQL_USER
valueFrom:
secretKeyRef:
key: database-user
name: django-psql-persistent
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
key: database-password
name: django-psql-persistent
- name: POSTGRESQL_DATABASE
value: default
image: registry.access.redhat.com/rhscl/postgresql-95-rhel7@sha256:b40f48962137beaf961d3a889f862c549cecea940e34a4b4f88ec6fc8d2a9d8b
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 5432
timeoutSeconds: 1
name: postgresql
ports:
- containerPort: 5432
protocol: TCP
readinessProbe:
exec:
command:
- /bin/sh
- -i
- -c
- psql -h 127.0.0.1 -U ${POSTGRESQL_USER} -q -d ${POSTGRESQL_DATABASE} -c
'SELECT 1'
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
memory: 512Mi
requests:
memory: 512Mi
securityContext:
capabilities:
drop:
- MKNOD
- SYS_CHROOT
privileged: false
seLinuxOptions:
level: s0:c10,c5
terminationMessagePath: /dev/termination-log
volumeMounts:
- mountPath: /var/lib/pgsql/data
name: postgresql-data
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: default-token-l9fvl
readOnly: true
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: default-dockercfg-dd62c
nodeName: node12.example.com
restartPolicy: Always
securityContext:
seLinuxOptions:
level: s0:c10,c5
serviceAccount: default
serviceAccountName: default
terminationGracePeriodSeconds: 30
volumes:
- name: postgresql-data
persistentVolumeClaim:
claimName: postgresql
- name: default-token-l9fvl
secret:
defaultMode: 420
secretName: default-token-l9fvl
status:
conditions:
- lastProbeTime: null
lastTransitionTime: 2017-08-18T14:08:15Z
status: "True"
type: Initialized
- lastProbeTime: null
lastTransitionTime: 2017-08-18T14:08:15Z
message: 'containers with unready status: [postgresql]'
reason: ContainersNotReady
status: "False"
type: Ready
- lastProbeTime: null
lastTransitionTime: 2017-08-18T14:08:15Z
status: "True"
type: PodScheduled
containerStatuses:
- containerID: docker://4675e56ccc5668468d0df9efdcf33739cd699f980514d80801fdea71b88e920f
image: registry.access.redhat.com/rhscl/postgresql-95-rhel7@sha256:b40f48962137beaf961d3a889f862c549cecea940e34a4b4f88ec6fc8d2a9d8b
imageID: docker-pullable://registry.access.redhat.com/rhscl/postgresql-95-rhel7@sha256:b40f48962137beaf961d3a889f862c549cecea940e34a4b4f88ec6fc8d2a9d8b
lastState:
terminated:
containerID: docker://4675e56ccc5668468d0df9efdcf33739cd699f980514d80801fdea71b88e920f
exitCode: 1
finishedAt: 2017-08-18T14:08:19Z
reason: Error
startedAt: 2017-08-18T14:08:18Z
name: postgresql
ready: false
restartCount: 1
state:
waiting:
message: Back-off 10s restarting failed container=postgresql pod=postgresql-2-xlkzf_postgresql-test(ad5f3c33-841e-11e7-9072-5254009e71c2)
reason: CrashLoopBackOff
hostIP: 192.168.200.212
phase: Running
podIP: 10.129.0.12
startTime: 2017-08-18T14:08:15Z
[root@master10 ~]# oc logs postgresql-2-xlkzf
mkdir: cannot create directory '/var/lib/pgsql/data': Permission denied
[root@master10 ~]# oc get pvc
NAME STATUS VOLUME CAPACITY ACCESSMODES AGE
postgresql Bound pv-infra-ose01g008 1Gi RWO 17h
[root@infra exports]# ls -al
total 0
drwxrwxrwx 12 root root 146 Aug 3 10:42 .
dr-xr-xr-x. 18 root root 259 Jul 25 08:58 ..
drwxrwx--- 2 root nfsnobody 6 Aug 17 17:37 lv_001
drwxrwx--- 2 root root 6 Jul 25 09:21 lv_002
drwxrwx--- 2 root root 6 Aug 3 10:42 lv_003
drwxrwx--- 2 root root 18 Aug 3 12:06 lv_004
drwxrwx--- 2 root root 6 Aug 3 10:42 lv_005
drwxrwx--- 2 root root 6 Aug 10 11:17 lv_006
drwxrwx--- 2 root root 6 Aug 10 11:17 lv_007
drwxrwx--- 2 root root 6 Aug 11 15:35 lv_008
drwxrwx--- 2 root root 6 Aug 10 10:38 lv_009
drwxrwxrwx 2 root root 6 Aug 3 10:42 lv_010
[root@infra exports]# ls -al lv_008
total 0
drwxrwx--- 2 root root 6 Aug 11 15:35 .
drwxrwxrwx 12 root root 146 Aug 3 10:42 ..
[root@infra exports]# cat /etc/exports
/exports *(root_squash,rw,sync)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment