https://github.com/openshift/hive
# login to the target cluster with oc
go get sigs.k8s.io/kustomize
go get sigs.k8s.io/controller-tools
go get github.com/openshift/hive
cd $GOPATH/src/github.com/openshift/hive
make deploy
https://github.com/openshift/hive
# login to the target cluster with oc
go get sigs.k8s.io/kustomize
go get sigs.k8s.io/controller-tools
go get github.com/openshift/hive
cd $GOPATH/src/github.com/openshift/hive
make deploy
$ go run test.go | |
2019/03/01 08:51:34 PASS: test=openshift-nmalik, expected=true, matched=true | |
2019/03/01 08:51:34 FAIL: test=nmalik-openshift-test, expected=false, matched=true | |
2019/03/01 08:51:34 PASS: test=nmalik-test, expected=false, matched=false |
import boto3 | |
ec = boto3.client('ec2') | |
def lambda_handler(event, context): | |
# https://serverlesscode.com/post/lambda-schedule-ebs-snapshot-backups/ | |
reservations = ec.describe_instances( | |
Filters=[ | |
{'Name': 'tag-key', 'Values': ['openshiftClusterID']}, | |
] |
This came out of an ansible role I was creating to monitor some external hosts that run node-exporter. I've since moved away from exposting node-exporter and am using prometheus pushgateway instead. This gist exists to capture what I learned.
Deploy the endpoint, service, and servicemonitor in the openshift-monitoring namespace. You should be able to deploy to another project but you'll maybe have problems with reading data. A couple of notes on that at the end
Ansible snippet to make this happen (I have not tested this). Assumes the host it runs on has ability to run oc
commands against openshift-monitoring
.
Sometimes you need simple authentication in front of a REST endpoint that doesn't provide authentication. In this gist I outline how to do this with API Gateway and Lambda.
The original goal with this work was to secure a deployment of Prometheus node_exporter. I have since found the configuration for the prometheus-operator does not support setting custom headers, only Authorization. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#%3Cscrape_config%3E
What was done:
. Create EC2 instance (sg allows 9100) . Install node_exporter on :9100 . Create Lambda function . Create API Gateway
https://github.com/MoonshineSG/OctoPrint-MultiColors
I slice with Slic3r and have enabled verbose GCODE. I found GOCDE to move the hot end off the print at a layer change (reference eludes me right now). Wanted to share what I did with this OctoPrint plugin for my setup.
The trick is to get the retract, extrucsion reset, and Z change captured in a group so you can replay it.
My regex: (.*layer [(]{0}[)])\n(G1 X.*move.*)\n(G1 E([\d.]*) F([\d.]*)[; ]*.*unretract)
My GCODE:
{ | |
"objectType": "selfReferenceArrayContainsArray", | |
"projection": [ | |
{ | |
"field": "*", | |
"include": true, | |
"recursive": true | |
},{ | |
"field": "test_reference", | |
"include": true, |
sed 's/\([ ]*\)\([^ :]*\)[ ]*:[ ]*\([^,]*\).*/\1"\2": "\3",/g' | sed 's/"{",/{/g' | sed 's/"\[",/[/g' | sed 's/""/"/g' |
##Yet another gist to provide Graphite support for Dashing Pull data from Graphite and present in Dashing. Support both graph and number widget.
Quick install:
dashing install efffa657c31e244131e3
Set the graphite name and names of metrics in jobs/graphite.rb
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"type": "object", | |
"description": "JSON schema for entity 'country' version '1.0.0' (see https://raw.githubusercontent.com/lightblue-platform/openshift-lightblue-cart/master/versions/shared/template/src/main/data/country.json)", | |
"properties": { | |
"createdBy": { | |
"type": "string", | |
"description": "Identifies who created this entity. Ideally, a login. Worst case an ID from some other system." | |
}, | |
"creationDate": { |