Skip to content

Commit 4251f49

Browse files
committed
shift-week: add topolvm upstream manifests
Signed-off-by: Evgeny Slutsky <[email protected]>
1 parent b716736 commit 4251f49

File tree

5 files changed

+14591
-1
lines changed

5 files changed

+14591
-1
lines changed

okd/storage/README.md

+55-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,57 @@
11
## examples for using with storage
2+
3+
### run Microshift with upsteam topolvm
4+
5+
1. prepare the LVM backend on the host (example only)
6+
```bash
7+
truncate --size=20G /tmp/lvmdisk
8+
losetup -f /tmp/lvmdisk
9+
device_name=$(losetup -j /tmp/lvmdisk | cut -d: -f1)
10+
vgcreate -f -y myvg1 /dev/${device_name}
11+
lvcreate -T myvg1/thinpool -L 6G
12+
```
13+
14+
15+
1. run microshift in OKD and wait for its to be ready
16+
```bash
17+
export kustomize_dir=/usr/lib/microshift/manifests.d/001-topolvm
18+
sudo podman run --privileged --rm --name microshift-okd \
19+
-v $(pwd)/okd/storage/topolvm/manifests:${kustomize_dir}:z \
20+
--hostname 127.0.0.1.nip.io \
21+
-p 5432:5432 -p 6443:6443 \
22+
-d localhost/microshift-okd-4.19
23+
```
24+
25+
1. wait for all the components to come up
26+
```bash
27+
sudo podman exec microshift-okd bash -c "microshift healthcheck "
28+
```
29+
1. apply the manifests:
30+
`sudo podman exec microshift-okd bash -c "oc apply -f /usr/lib/microshift/manifests.d/001-topolvm/"`
31+
32+
TODO: embed manifests so it will be performed automaticly
33+
34+
### load some example data into the psql
35+
36+
1. copy kubeconfig from the container
37+
```bash
38+
sudo podman cp microshift-okd:/var/lib/microshift/resources/kubeadmin/127.0.0.1.nip.io/kubeconfig .
39+
sudo chown ${USERNAME}:${USERNAME} kubeconfig
40+
```
41+
42+
43+
1. applying manifests
44+
```bash
45+
# install cert-manager
46+
oc apply -f manifests/namespace.yaml
47+
oc apply -f manifests/cert-manager.yaml
48+
oc apply -f manifests/topolvm.yaml
49+
```
50+
51+
52+
1. oc ally
53+
54+
255
### run Microshift with hostpath volume
356
A hostPath volume mounts a file or directory from the host node’s file system into your pod.
457
Most pods do not need a hostPath volume, but it does offer a quick option for testing should an application require it (some requires persistent storage - DBs).
@@ -12,7 +65,7 @@ Most pods do not need a hostPath volume, but it does offer a quick option for te
1265
1366
sudo podman run --privileged --rm --name microshift-okd \
1467
-v ${data_dir}:/var/lib/pvdata:z \
15-
-v $(pwd)/okd/examples/hostpath:${kustomize_dir}:z \
68+
-v $(pwd)/okd/storage/hostpath:${kustomize_dir}:z \
1669
--hostname 127.0.0.1.nip.io \
1770
-p 5432:5432 -p 6443:6443 \
1871
-d localhost/microshift-okd
@@ -46,3 +99,4 @@ Most pods do not need a hostPath volume, but it does offer a quick option for te
4699

47100
1. stop the container `sudo podman stop microshift-okd`
48101
1. start a new container instance and verify data is still exists.
102+

0 commit comments

Comments
 (0)