Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
m0sc0 committed Jul 10, 2021
1 parent 61e2b45 commit 7d32441
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
65 changes: 64 additions & 1 deletion P2/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,64 @@
test
## OPENSHIFT DYNAMIC STORAGE
2.03
```
oc adm top nodes
oc adm node-logs -u crio node-name
oc debug node/node-name
skopeo inspect
oc get events
oc whoami -t
```

2.05 In this lab we will attach a PV to a deployment
```
lab install-storage start
source /usr/local/etc/ocp4.config
oc login -u kubeadmin -p ${RHT_OCP4_KUBEADM_PASSWD}
Create a project called install-storage
Create an app with
name postgresql-persistent \
registry.redhat.io/rhel8/postgresql-12:1-43 \
-e POSTGRESQL_USER=redhat \
-e POSTGRESQL_PASSWORD=redhat123 \
-e POSTGRESQL_DATABASE=persistentdb
Add a persistent storage with
name postgresql-storage
class nfs-storage
rwo
size 10Gi
mount path /var/lib/psql
claim name postgresql-storage
Populate data to pvc with ~/DO280/labs/install-storage/init_data.sh
Check ~/DO280/labs/install-storage/check_data.sh
Remove deploy and all
Create another app with the same vars called postgresql-persistent2
Attach pv again
Delete all deploy and pvc
cd
```

### SOLUTION

oc new-app --name postgresql-persistent \
--docker-image registry.redhat.io/rhel8/postgresql-12:1-43 \
-e POSTGRESQL_USER=redhat \
-e POSTGRESQL_PASSWORD=redhat123 \
-e POSTGRESQL_DATABASE=persistentdb
oc set volume dc/ --add --name postgresql-storage -t pvc --claim-size 10G --claim-class nfs-storage --claim-mode rwo --claim-name postgresql-storage -m /var/lib/psql
oc get pvc
oc get pv
oc delete all -l app=postgresql-persistent


oc new-app --name postgresql-persistent2 \
--docker-image registry.redhat.io/rhel8/postgresql-12:1-43 \
-e POSTGRESQL_USER=redhat \
-e POSTGRESQL_PASSWORD=redhat123 \
-e POSTGRESQL_DATABASE=persistentdb

oc delete all -l app=postgresql-persistent
oc delete pvc postgresql-storage
4 changes: 4 additions & 0 deletions pushea
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
git add *
git commit -m "commit"
git push

0 comments on commit 7d32441

Please sign in to comment.