This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"regexp" | |
"testing" | |
) | |
var illegalCharsRE = regexp.MustCompile(`[^a-zA-Z0-9_]`) | |
func regexVersion(metricName string) string { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/exporter.go b/exporter.go | |
index 15c01b7..c225fcf 100644 | |
--- a/exporter.go | |
+++ b/exporter.go | |
@@ -21,7 +21,6 @@ import ( | |
"hash/fnv" | |
"io" | |
"net" | |
- "regexp" | |
"sort" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// API for a deployment service. | |
// It's easier for me to express an API as protobuf/service | |
// definitions. grpc-gateway would be used, so HTTP/1.1 and | |
// json would work. A simple browser API could be provided. | |
// This API is meant for users - both systems and humans - | |
// to easily deploy images. | |
// | |
// The envisioned flow is that the build system would push | |
// images to a registry and notify this service using CreateImage. | |
// Another step in the pipeline would then use DeployApplication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example scrape config for pods | |
# | |
# The relabeling allows the actual pod scrape endpoint to be configured via the | |
# following annotations: | |
# | |
# * `prometheus.io/scrape`: Only scrape pods that have a value of `true` | |
# * `prometheus.io/path`: If the metrics path is not `/metrics` override this. This | |
# will be the same for every container in the pod that is scraped. | |
# * this will scrape every container in a pod with `prometheus.io/scrape` set to true and the | |
port is name `metrics` in the container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get our hostip if running under kubernetes | |
if [[ -n "${KUBERNETES_NAMESPACE}" && -n "${KUBERNETES_PODNAME}" ]] ; then | |
KUBERNETES_HOSTIP="" | |
while true; do | |
KUBERNETES_HOSTIP=`kubectl get pods --namespace=${KUBERNETES_NAMESPACE} ${KUBERNETES_PODNAME} -o json | jq -r .status.hostIP` | |
if [ -n "${KUBERNETES_HOSTIP}" ] && [ "${KUBERNETES_HOSTIP}" != "null" ]; then | |
break | |
fi | |
sleep 1 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/utils/dockerutil.py b/utils/dockerutil.py | |
index 975b260..d8e0868 100644 | |
--- a/utils/dockerutil.py | |
+++ b/utils/dockerutil.py | |
@@ -82,6 +82,7 @@ def find_cgroup_filename_pattern(mountpoints, container_id): | |
stat_file_path_coreos = os.path.join(mountpoint, "system.slice") | |
stat_file_path_kubernetes = os.path.join(mountpoint, container_id) | |
stat_file_path_kubernetes_docker = os.path.join(mountpoint, "system", "docker", container_id) | |
+ stat_file_path_docker_daemon = os.path.join(mountpoint, "docker-daemon", "docker", container_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
# create certs for a kubernetes cluster | |
usage() { | |
echo $0 [cluster_name] [service_ip] [additional_names] | |
echo additional name is generally the dns name | |
exit -1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
KUBERNETES_VERSION=0.19.0 | |
RELEASE=${KUBERNETES_VERSION}-1 | |
ETCD_VERSION=2.0.11 | |
DOCKER_VERSION=1.6.2 | |
WORKDIR=$(mktemp -d k8s.XXXXXXXXXX) | |
trap "rm -rf '${WORKDIR}'" EXIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat terraform.tfstate | jq -r '.modules[0].resources | map(select(.type == "google_compute_instance")) | map([.primary.id, " ansible_ssh_host=", .primary.attributes["network_interface.0.access_config.0.nat_ip"]] | join("")) | sort | .[]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd /tmp | |
curl -L -O https://github.com/coreos/rkt/releases/download/v0.5.4/rkt-v0.5.4.tar.gz | |
tar -zxvf rkt-v0.5.4.tar.gz | |
cd rkt-v0.5.4 | |
echo yes | ./rkt trust --prefix coreos.com/etcd | |
./rkt fetch coreos.com/etcd:v2.0.4 |
NewerOlder