Skip to content

Instantly share code, notes, and snippets.

oc delete pods -n rook-ceph --field-selector=status.phase=Failed
podman run -it --network=host --name postgres -e POSTGRES_PASSWORD=1234 postgres
podman run -it --network=host --name pgadmin4 -e "PGADMIN_DEFAULT_EMAIL=postgres" -e "PGADMIN_DEFAULT_PASSWORD=1234" -e "PGADMIN_LISTEN_PORT=5050" dpage/pgadmin4
psql -h 127.0.0.1 -p 5432 -d postgres -U postgres -W
oc get node working-b7sd9-worker-0-fdqsc -o yaml
apiVersion: v1
kind: Node
metadata:
annotations:
kubevirt.io/heartbeat: "2019-09-04T15:01:29Z"
machine.openshift.io/machine: openshift-machine-api/working-b7sd9-worker-0-fdqsc
machineconfiguration.openshift.io/currentConfig: rendered-worker-4fffe5d42714996068049d7028611f74
machineconfiguration.openshift.io/desiredConfig: rendered-worker-4fffe5d42714996068049d7028611f74
machineconfiguration.openshift.io/ssh: accessed
root@dell-r730-002:~# kubectl get pod -o=custom-columns=NAME:.metadata.name,STATUS:.status.phase,NODE:.spec.nodeName --all-namespaces
NAME STATUS NODE
importer-cdrom-vm-cdrom-example-example-qdqlz Pending <none>
importer-cdrom-vm-cdrom-vm-cirros-4rzss Pending <none>
importer-cdrom-vm-disk2-cdrom-vm-cdrom-vm-hv64m Pending <none>
importer-cdrom-vm-disk2-qdvqp Pending <none>
importer-rawagner-pvc-cdrom-vm-hpdzl Pending <none>
importer-rawagner-pvc-example-5j4gf Pending <none>
importer-rawagner-pvc-vm-cirros-2p657 Pending <none>
virt-launcher-vm-cirros-gtbr8 Running working-b7sd9-worker-0-6zv8n
@yaacov
yaacov / gist:085c03d890192278e6422b8e1cb4dc68
Created August 5, 2019 11:53
openshift qe jenkins hiccups
# If can't create worker check iptables rulls:
iptables -I INPUT -p tcp -s 192.168.126.0/24 -d 192.168.122.1 --dport 16509 -j ACCEPT -m comment --comment "Allow insecure libvirt clients"
# When stuck on samples.operator run:
oc delete configs.samples.operator.openshift.io cluster
kubectl proxy --port=8080 --address='0.0.0.0' --accept-hosts='.*'
git config --global --bool pull.rebase true
git config --global push.default simple
git config --global alias.co checkout
git config --global alias.br branch
git config --global user.name yaacov
git config --global user.email [email protected]
sudo dnf install haproxy
sudo setsebool -P haproxy_connect_any=1
sudo vim /etc/haproxy/haproxy.cfg
```
#---------------------------------------------------------------------
# pass through SSL for api and apps
#---------------------------------------------------------------------
frontend https_api
@yaacov
yaacov / fish
Created April 25, 2019 11:19
install fish
sudo dnf config-manager --add-repo https://download.opensuse.org/repositories/shells:fish:release:3/Fedora_29/shells:fish:release:3.repo
sudo dnf update -y
sudo dnf install fish powerline powerline-fonts mozilla-fira-mono-fonts
curl -L https://get.oh-my.fish | fish
omf update
omf install bobthefish
@yaacov
yaacov / gist:f837d4fcd1ca27bd26e38a42a381f487
Created March 6, 2018 09:11
aws exporter metrics list
# Install the aws tool, dnf or yum
dnf install awscli
# Genrate a list of all avalilable mtrics
aws cloudwatch list-metrics | \
sed ':a;N;$!ba;s/[ \n]//g;s/{"Namespace":/\n{"Namespace":/g;s/{"Metrics":\[//g;s/}\]}/}/g;s/,\n/\n/g' | \
sort
# Get value of last collected metrics
export METRICS='{"Namespace":"AWS/ELB","Dimensions":[{"Name":"Namespace","Value":"AWS"}],"MetricName":"Latency"}'