Skip to content

Instantly share code, notes, and snippets.

View derekwaynecarr's full-sized avatar

Derek Carr derekwaynecarr

  • Red Hat
  • Raleigh, NC
View GitHub Profile
@derekwaynecarr
derekwaynecarr / gist:ce34b73e3ee895f0ed33
Last active August 29, 2015 14:05
Kubernetes configuration via Salt

Using Salt to configure Kubernetes

The Kubernetes cluster can be configured using Salt.

The Salt scripts are shared across multiple hosting providers, so it's important to understand some background information prior to making a modification to ensure your changes do not break hosting Kubernetes across multiple environments. Depending on where you host your Kubernetes cluster, you may be using different operating systems and different networking configurations. As a result, it's important to understand some background information before making Salt changes in order to minimize introducing failures for other hosting providers.

Salt cluster setup

The salt-master service runs on the kubernetes-master node.

Kubernetes - ACL Model
Proposed PR:
https://github.com/GoogleCloudPlatform/kubernetes/pull/891
Proposal Summary:
0...N User Account objects
Each User Account object may have a default Project
0...N Project objects
Each Project contains
0...N Policy objects
Each policy object has:
[sudo] password for decarr:
+++ Building Docker image kube-build:build. This can take a while.
+++ Docker build command failed for kube-build:build
Sending build context to Docker daemon 3.572 MB
Sending build context to Docker daemon
Step 0 : FROM golang:cross
Pulling repository golang
sudo docker run -ti golang cat /etc/resolv.conf
Unable to find image 'golang' locally
Pulling repository golang
770c8a9d8805: Download complete
511136ea3c5a: Download complete
6d94bb8b50b2: Download complete
b2eda1f5dec1: Download complete
377f9502415f: Download complete
0742c1b5338a: Download complete
bcf773178633: Download complete
[decarr@localhost kubernetes ((detached from jbeda/binary-deploy))]$ sudo ./build/release.sh
+++ Building Docker image kube-build:build. This can take a while.
mkdir: cannot create directory `build/build-image/../../build/build-image/../../_output/build/linux': Permission denied
# Use go get to get the specified dependency
dependency=$1
echo "Getting new dependency ${dependency}"
if ! go get "${dependency}" ; then
echo "ERROR: Unable to get new dependency via 'go get'"
exit 1
fi
# Use godep to save new dependency
echo "Saving dependencies ..."
# NUMBER OF MINIONS IN THE CLUSTER
NUM_MINIONS=${KUBERNETES_NUM_MINIONS-"3"}
# IP LOCATIONS FOR INTERACTING WITH THE MASTER
export KUBE_MASTER_IP="10.245.1.2"
INSTANCE_PREFIX=kubernetes
MASTER_NAME="${INSTANCE_PREFIX}-master"
MASTER_TAG="${INSTANCE_PREFIX}-master"
@derekwaynecarr
derekwaynecarr / gist:f51da4ff763a2cea3db5
Last active August 29, 2015 14:07
Indexing proposal

Kubernetes Proposal - Indexing

Background

The Kubernetes cluster uses etcd as its primary data store.

High level goals:

  • Support ability to look-up an API object by something other than its key, e.g. uid
  • Support ability to look-up a list of API objects that have a field match on a particular value, e.g. label, status, etc.
Mar 20 19:36:01 kubernetes-master kube-apiserver[20949]: I0320 19:36:01.461303 20949 handlers.go:109] GET /api/v1beta1/services?namespace=: (2.573252ms) 200 [[kube-controller-manager/v0.12.0 (
Mar 20 19:36:00 kubernetes-master kube-apiserver[20949]: I0320 19:36:00.467671 20949 handlers.go:109] GET /api/v1beta1/minions: (1.517075ms) 200 [[kube-scheduler/v0.12.0 (linux/amd64) kubernet
Mar 20 19:35:58 kubernetes-master kube-apiserver[20949]: I0320 19:35:58.876799 20949 handlers.go:109] GET /api/v1beta1/minions: (1.527966ms) 200 [[kube-controller-manager/v0.12.0 (linux/amd64)
Mar 20 19:35:58 kubernetes-master kube-apiserver[20949]: I0320 19:35:58.557180 20949 handlers.go:109] GET /api/v1beta1/minions: (1.953585ms) 200 [[kube-controller-manager/v0.12.0 (linux/amd64)
Mar 20 19:35:57 kubernetes-master kube-apiserver[20949]: I0320 19:35:57.268396 20949 handlers.go:109] GET /api/v1beta1/resourceQuotas?namespace=: (925.202µs) 200 [[kube-apiserver/v0.12.0 (linu
Mar 20 19:35:57 kubernetes-master kube-apiserver[