Skip to content

Instantly share code, notes, and snippets.

View garethahealy's full-sized avatar

Gareth Healy garethahealy

View GitHub Profile
@garethahealy
garethahealy / log.txt
Created March 1, 2017 13:12
network project
[gahealy@exvoseqam1:~]$ oc project network-diag-global-ns-37fuf
Now using project "network-diag-global-ns-37fuf" on server "https://oldqa.ocp.metoffice.gov.uk:8443".
[gahealy@exvoseqam1:~]$ oc get pods
NAME READY STATUS RESTARTS AGE
network-diag-test-pod-9s726 0/1 MatchNodeSelector 0 33s
network-diag-test-pod-aoe30 0/1 MatchNodeSelector 0 31s
network-diag-test-pod-c7k8g 1/1 Running 0 19s
network-diag-test-pod-dez5m 0/1 MatchNodeSelector 0 21s
network-diag-test-pod-dftp0 1/1 Running 0 16s
network-diag-test-pod-ez2mg 0/1 MatchNodeSelector 0 28s
@garethahealy
garethahealy / log.txt
Created March 1, 2017 13:11
oc adm diagnostics
[root@exvoseqam1:/home/gahealy]# oc adm diagnostics --diaglevel=3
ERROR: [DNet2008 from diagnostic NetworkCheck@openshift/origin/pkg/diagnostics/network/run_pod.go:141]
[Logs for network diagnostic pod on node "exvoseqam1.metoffice.gov.uk" failed: container "network-diag-pod-0b1pq" in pod "network-diag-pod-0b1pq" is not available, See the errors below in the output from the network diagnostic pod on node "exvoseqan2.metoffice.gov.uk":
[Note] Running diagnostic: CheckExternalNetwork
Description: Check that external network is accessible within a pod
[Note] Running diagnostic: CheckNodeNetwork
Description: Check that pods in the cluster can access its own node.
[Note] Running diagnostic: CheckPodNetwork
oc new-project skydive
oc annotate namespace skydive openshift.io/node-selector=' '
oc adm policy add-scc-to-user privileged system:serviceaccount:skydive:default
oc create -f https://raw.githubusercontent.com/garethahealy/skydive/master/contrib/openshift/skydive-template.yaml
oc new-app --template=skydive
@garethahealy
garethahealy / cache-images.sh
Last active February 15, 2017 12:53
cache redhat images
sudo su
yum install -y skopeo
oc login -u admin -p admin address-of-cluster:8443
oc new-project openshift3
TOKEN=$(oc whoami -t)
OCP_VERSION="3.3.0"
OCP_VERSION_LONG="v3.3.0.34"
REGISTRY="registry.access.redhat.com"
@garethahealy
garethahealy / metrics-isAvailable.js
Created January 25, 2017 16:22
metrics-isAvailable
$http = angular.element(document.body).injector().get('$http');
var isAvailable = function() {
var url = _.get(window.OPENSHIFT_CONFIG, "metricsURL");
console.log("Trying to check for " + url);
if (!url) {
return false;
}
@garethahealy
garethahealy / bash_completion.sh
Created January 19, 2017 10:08
bash_completion
brew install bash-completion
brew tap homebrew/completions
brew install homebrew/completions/maven-completion
brew install homebrew/completions/docker-completion
brew install homebrew/completions/docker-compose-completion
brew install homebrew/completions/vagrant-completion
curl -L https://raw.githubusercontent.com/openshift/origin/release-1.4/contrib/completions/bash/oc -o /usr/local/etc/bash_completion.d/oc
localhost:hawkular-openshift-agent garethah$ cd ${GOPATH}/src/github.com/hawkular-openshift-agent
localhost:hawkular-openshift-agent garethah$ ll
total 120
drwxr-xr-x 3 garethah staff 102B 11 Jan 22:34 util
drwxr-xr-x 3 garethah staff 102B 11 Jan 22:34 storage
drwxr-xr-x 5 garethah staff 170B 11 Jan 22:34 prometheus
drwxr-xr-x 3 garethah staff 102B 11 Jan 22:34 log
drwxr-xr-x 18 garethah staff 612B 11 Jan 22:34 k8s
drwxr-xr-x 6 garethah staff 204B 11 Jan 22:34 jolokia
drwxr-xr-x 4 garethah staff 136B 11 Jan 22:34 http
@garethahealy
garethahealy / byteman-metrics.sh
Created January 9, 2017 12:55
byteman-metrics.sh
mkdir /tmp/byteman &&
cd /tmp/byteman &&
wget http://downloads.jboss.org/byteman/2.2.2/byteman-download-2.2.2-bin.zip &&
unzip byteman-*.zip &&
cd byteman-download-* &&
export BYTEMAN_HOME=$(pwd) &&
cd bin/ &&
echo $BYTEMAN_HOME &&
ps -deaf | grep hawkular
@garethahealy
garethahealy / jcmd.sh
Created January 5, 2017 18:03
java heapdump for docker
#!/bin/bash
docker exec $1 ps -deaf
echo -n "PID for Java: "
read pid
docker exec $1 jcmd $pid GC.heap_dump /tmp/docker.hprof
docker cp $1:/tmp/docker.hprof .
docker exec $1 rm /tmp/docker.hprof
@garethahealy
garethahealy / test.sh
Last active January 3, 2017 17:36
stats
#!/usr/bin/env bash
HAWKULAR_TENANT="unit-testing"
HAWKULAR_URL="http://192.168.99.100:8080/hawkular/metrics"
METRIC_ID="prometheus_test"
#echo "tags on datapoints: empty data returned"
curl -vvv -X GET -u admin:admin -H "Content-Type: application/json" -H "Hawkular-Tenant: $HAWKULAR_TENANT" "$HAWKULAR_URL/counters/stats?start=1482999755690&end=1483000020093&bucketDuration=10d&tags=method:*"
#echo "tags on metric: empty data returned"