Skip to content

Instantly share code, notes, and snippets.

# detach volumes from server
openstack server show compute-1 -f value
for v in `cat volumes`; do openstack volume show $v; done
for v in `cat volumes`; do echo $v && openstack server remove volume compute-1 $v; done
# add security group
for s in `openstack server list -c Name -f value| grep "prod"`; do openstack server add security group $s allow-http; done
# list/show/delete available volumes
openstack volume list --status available -f value -c Name > available-vols.txt
# Install OpenShift 3.11 cli
brew install https://raw.githubusercontent.com/cblecker/homebrew-core/d1092419e5113b296a6b1d7ecd2bf6673d39f0a2/Formula/openshift-cli.rb
# ID = /var/lib/origin/openshift.local.volumes/plugins/kubernetes.io/cinder/mounts/[ID]
oc get pv -o json | jq -r '[.items[] | {name:.spec.claimRef.name, namespace:.spec.claimRef.namespace, volumeID:.spec.cinder.volumeID}]' | grep -n2 [ID]
# ElasticSearch get incides
oc -n openshift-logging rsh $(oc -n openshift-logging get po -l component=es -o name) es_util --query=_cat/indices -XCURL
# Docker daemon
systemctl is-active docker
# Check that Docker volume group has adequate space
echo $(echo \"$(docker info 2>/dev/null | awk '/Data Space Available/ {print $4}') / $(docker info 2>/dev/null | awk '/Data Space Total/ {print $4}')\" | bc -l) '>' 0.3 | bc -l
# Check that Docker volume group has adequate metadata space
echo $(echo \"$(docker info 2>/dev/null | awk '/Metadata Space Available/ {print $4}') / $(docker info 2>/dev/null | awk '/Metadata Space Total/ {print $4}')\" | bc -l) '>' 0.3 | bc -l
# etcd is active
https://docs.openshift.com/container-platform/3.10/install/prerequisites.html
Infrastructure nodes running in DMZ
Application hosting nodes, master, other supporting infrastructure running in more secure network
# diagnostics after installation
sudo oc adm diagnostics
ansible-playbook -i /root/my_ocp_inventory \
/usr/share/ansible/openshift-ansible/playbooks/byo/openshift-checks/health.yml
apiVersion: v1
items:
- kind: "BuildConfig"
apiVersion: "v1"
metadata:
name: "pipeline-demo"
spec:
triggers:
- github:
secret: 5Mlic4Le
@rvanbutselaar
rvanbutselaar / OpenShift Training
Last active October 10, 2018 09:55
OpenShift
minishift start --vm-driver virtualbox
# Openshift Cockpit
Monitoring tool??
# Routing layer pluggable and extensible if hardware or non-OpenShift software router desired
Haproxy / F5 LB
# Image stream
Laag voor Docker registries, met triggers bij image wijzigingen voor automatische deployments.