Skip to content

Instantly share code, notes, and snippets.

View garethahealy's full-sized avatar

Gareth Healy garethahealy

View GitHub Profile
@garethahealy
garethahealy / gist:c7ac1208810f8374063dbbd69295f575
Created September 22, 2016 13:07
metrics/?type=gauge - working - Hawkular-Tenant=originmetrics
[main] DEBUG org.hawkular.client.core.jaxrs.RestRequestFilter - >> HTTP: GET
[main] DEBUG org.hawkular.client.core.jaxrs.RestRequestFilter - >> URI: http://192.168.99.100:8080/hawkular/metrics/metrics/?type=gauge&tags=pod_namespace%3Azproject9%2Ccontainer_name%3Astress
[main] DEBUG org.hawkular.client.core.jaxrs.RestRequestFilter - >> Headers: [Accept=application/json,Accept-Encoding=gzip, deflate,Hawkular-Tenant=originmetrics]
[main] DEBUG org.hawkular.client.core.jaxrs.RestRequestFilter - >> Data: null
[main] DEBUG org.hawkular.client.core.jaxrs.RestResponseFilter - << Response headers:[Cache-Control=no-cache, no-store, must-revalidate,Date=Thu, 22 Sep 2016 13:04:22 GMT,Expires=0,Pragma=no-cache,Server=WildFly/10,X-Powered-By=Undertow/1]
[main] DEBUG org.hawkular.client.core.jaxrs.RestResponseFilter - << Status -> code:204, message:No Content
[main] DEBUG org.hawkular.client.core.DefaultClientResponse - Client Response: Status Code:204, Is Success:false, Error Message:-, Raw Entity:null, Entity:[null]
@garethahealy
garethahealy / gist:09c5769bd348919d39d9604381d3f8ae
Created September 22, 2016 13:10
metrics/?type=gauge - not working - Hawkular-Tenant=origin-metrics
[main] DEBUG org.hawkular.client.core.jaxrs.RestRequestFilter - >> HTTP: GET
[main] DEBUG org.hawkular.client.core.jaxrs.RestRequestFilter - >> URI: http://192.168.99.100:8080/hawkular/metrics/metrics/?type=gauge&tags=pod_namespace%3Azproject9%2Ccontainer_name%3Astress
[main] DEBUG org.hawkular.client.core.jaxrs.RestRequestFilter - >> Headers: [Accept=application/json,Accept-Encoding=gzip, deflate,Hawkular-Tenant=origin-metrics]
[main] DEBUG org.hawkular.client.core.jaxrs.RestRequestFilter - >> Data: null
[main] DEBUG org.hawkular.client.core.jaxrs.RestResponseFilter - << Response headers:[Cache-Control=no-cache, no-store, must-revalidate,Connection=keep-alive,Content-Length=187,Content-Type=application/json,Date=Thu, 22 Sep 2016 13:08:56 GMT,Expires=0,Pragma=no-cache,Server=WildFly/10,X-Powered-By=Undertow/1]
[main] DEBUG org.hawkular.client.core.jaxrs.RestResponseFilter - << Status -> code:500, message:Internal Server Error
[main] DEBUG org.hawkular.client.core.DefaultClientResponse - Client Response: Statu
apiVersion: v1
kind: Template
labels:
application: nexus-ephemeral
createdBy: template-nexus
metadata:
annotations:
description: Nexus service, with ephemeral storage. Scaling to more than one replica
is not supported
tags: repository-managers,nexus
apiVersion: v1
kind: Template
labels:
application: nexus-ephemeral
createdBy: template-nexus
metadata:
annotations:
description: Nexus service, with ephemeral storage. Scaling to more than one replica
is not supported
tags: repository-managers,nexus
[root@localhost ~]# oc new-app --file=cakephp-mysql.json --loglevel=8
I1005 14:01:04.772578 8605 loader.go:330] Config loaded from file /var/lib/origin/openshift.local.config/master/admin.kubeconfig
I1005 14:01:04.773359 8605 round_trippers.go:296] GET https://10.2.2.2:8443/oapi
I1005 14:01:04.773367 8605 round_trippers.go:303] Request Headers:
I1005 14:01:04.773371 8605 round_trippers.go:306] User-Agent: oc/v1.3.0 (linux/amd64) openshift/d451518
I1005 14:01:04.773374 8605 round_trippers.go:306] Authorization: Bearer AA1Pvl4ITa9ZtYO9wvALU0Sck1JUd-PzptUTGSyqdZc
I1005 14:01:04.773377 8605 round_trippers.go:306] Accept: application/json, */*
I1005 14:01:04.808198 8605 round_trippers.go:321] Response Status: 200 OK in 34 milliseconds
I1005 14:01:04.808217 8605 round_trippers.go:324] Response Headers:
I1005 14:01:04.808221 8605 round_trippers.go:327] Date: Wed, 05 Oct 2016 14:01:04 GMT
@garethahealy
garethahealy / gist:6f8defaf3e4820e57b40149f20a5d1e8
Last active October 5, 2016 16:49
ose new-project / template
# Create Project
curl -XGET --insecure --header "Authorization: Bearer AA1Pvl4ITa9ZtYO9wvALU0Sck1JUd-PzptUTGSyqdZc" https://10.2.2.2:8443/oapi/v1/projectrequests
curl -XPOST --insecure --header "Authorization: Bearer AA1Pvl4ITa9ZtYO9wvALU0Sck1JUd-PzptUTGSyqdZc" --header "Content-Type: application/json" https://10.2.2.2:8443/oapi/v1/projectrequests -d @projectrequest.json
# Create template
wget https://raw.githubusercontent.com/openshift/origin/master/examples/quickstarts/cakephp-mysql.json
curl -XPOST --insecure --header "Authorization: Bearer AA1Pvl4ITa9ZtYO9wvALU0Sck1JUd-PzptUTGSyqdZc" --header "Content-Type: application/json" https://10.2.2.2:8443/oapi/v1/namespaces/test2/processedtemplates -d @cakephp-mysql.json -o processed-cakephp-mysql.json
# Now loop over the items, and create the "objects"
NUMBER_OF_RESOURCES=$(cat processed-cakephp-mysql.json| jq '.objects | length')
AllInOne port = 4001
HA = 2379
Dir = /var/lib/origin/openshift.local.config/master
curl https://192.168.99.100:4001/version --cacert ./ca.crt --cert ./master.etcd-client.crt --key ./master.etcd-client.key
curl https://192.168.99.100:4001/health --cacert ./ca.crt --cert ./master.etcd-client.crt --key ./master.etcd-client.key
curl https://192.168.99.100:4001/metrics --cacert ./ca.crt --cert ./master.etcd-client.crt --key ./master.etcd-client.key
etcdclt -C https://192.168.99.100:4001 --ca-file ./ca.crt --cert-file=./master.etcd-client.crt --key-file=./master.etcd-client.key
@garethahealy
garethahealy / gist:7986adf64bfcc63763e76f469712f3d4
Created December 10, 2016 17:15
hawkular-timestamp-precision.sh
#!/usr/bin/env bash
METRIC_ID="my-first-metric"
QUOTA_NAMESPACE="test"
HAWKULAR_URL="https://hawkular-metrics.apps.10.2.2.2.xip.io/hawkular/metrics"
HAWKULAR_TOKEN=$(oc whoami -t)
HAWKULAR_TENANT="testing1"
CREATE_JSON_PAYLOAD=$(cat <<EOF
{
@garethahealy
garethahealy / gist:d06cc00166b4f2bde1ea5550326728e7
Last active December 11, 2016 13:35
hawkular agent with etcd
# Create the secrets and add to the pod
oc project openshift-infra
oc secrets new etcd-client-crt master.etcd-client.crt
oc secrets new etcd-client-key master.etcd-client.key
oc secrets add serviceaccount/hawkular-agent secret/etcd-client-crt --for=mount
oc secrets add serviceaccount/hawkular-agent secret/etcd-client-key --for=mount
oc volume rc/hawkular-openshift-agent --add --name=etcd-client-crt --type=secret --secret-name=etcd-client-crt --mount-path=/etcd-client-crt
oc volume rc/hawkular-openshift-agent --add --name=etcd-client-key --type=secret --secret-name=etcd-client-key --mount-path=/etcd-client-key
@garethahealy
garethahealy / clusterquota.yaml
Last active December 14, 2016 12:39
ClusterResourceQuota-ForUser
apiVersion: v1
kind: ClusterResourceQuota
metadata:
name: for-user
annotations:
instance-type: "small"
applicable-strategy: "per-project-group"
creation-strategy: "per-project-group"
pods-calculation: "memory / 500mb + 3"
static-content: "false"