Skip to content

Instantly share code, notes, and snippets.

View emreozkangit's full-sized avatar

Emre Özkan emreozkangit

View GitHub Profile
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
namespace: emre
name: rhel
labels:
app: containerized-data-importer
annotations:
cdi.kubevirt.io/storage.import.endpoint: "http://xxx.xxx.xxx.xxx/rhel-server-7.7-update-2-x86_64-kvm.qcow2"
spec:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
namespace: emre
name: windows
labels:
app: containerized-data-importer
annotations:
cdi.kubevirt.io/storage.import.endpoint: "http://xxx.xxx.xxx.xxx/windows_server_2012_r2_standard_eval_kvm_20170321.qcow2"
spec:
cat << EOF | oc create -f -
apiVersion: ocs.openshift.io/v1
kind: StorageCluster
metadata:
name: ocs-storagecluster
namespace: openshift-storage
spec:
manageNodes: false
monPVCTemplate:
spec:
cat << EOF | oc create -f -
apiVersion: v1
kind: Namespace
metadata:
labels:
openshift.io/cluster-monitoring: "true"
name: openshift-storage
spec: {}
EOF
@emreozkangit
emreozkangit / local-storage-check
Created April 27, 2020 14:02
local-storage-check
[root@rhel7 ~]# oc get ds
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
local-block-local-diskmaker 3 3 3 3 3 <none> 2m14s
local-block-local-provisioner 3 3 3 3 3 <none> 2m14s
local-fs-local-diskmaker 3 3 3 3 3 <none> 2m6s
local-fs-local-provisioner 3 3 3 3 3 <none> 2m6s
[root@rhel7 ~]# oc get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
local-pv-2c80d128 10Gi RWO Delete Available local-fs 80s
local-pv-88efdaee 50Gi RWO Delete Available local-block 63s
@emreozkangit
emreozkangit / local-fs
Created April 27, 2020 13:58
local-fs
cat <<EOF | oc create -n local-storage -f -
apiVersion: local.storage.openshift.io/v1
kind: LocalVolume
metadata:
name: local-fs
@emreozkangit
emreozkangit / local-block
Created April 27, 2020 13:57
local-block
cat <<EOF | oc create -n local-storage -f -
apiVersion: local.storage.openshift.io/v1
kind: LocalVolume
metadata:
name: local-block
podman run --name mirror-registry -p 5000:5000 -v /opt/registry/data:/var/lib/registry:z -v /opt/registry/auth:/auth:z -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd -v /opt/registry/certs:/certs:z -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key -d docker.io/library/registry:2
{
"filesystem": "root",
"group": {
},
"path": "/etc/pki/ca-trust/source/anchors/domain.crt",
"user": {
},
"contents": {
info: Mirroring 99 images to rhel7.lp.int:5000/ocp4/openshift4 ...
emre.int:5000/
ocp4/openshift4
....
....
info: Mirroring completed in 14m48.01s (5.68MB/s)
Success
Update image: emre.int:5000/ocp4/openshift4:4.2.19-x86_64
Mirror prefix: emre.int:5000/ocp4/openshift4