Skip to content

Instantly share code, notes, and snippets.

View aweiteka's full-sized avatar

Aaron Weitekamp aweiteka

  • Red Hat
  • Boston, MA
View GitHub Profile
@aweiteka
aweiteka / test_kubernetes.sh
Created December 18, 2014 17:15
Run unit tests on Kubernetes
#!/bin/sh -e
yum install -y git
mkdir -p $GOPATH/src/github.com/GoogleCloudPlatform/
cd $GOPATH/src/github.com/GoogleCloudPlatform/
git clone https://github.com/GoogleCloudPlatform/kubernetes.git
cd kubernetes
hack/test-go.sh
# TODO: upstream end-to-end tests
@aweiteka
aweiteka / nulecule2openshift.go
Created April 29, 2015 14:18
Convert nulecule application to openshift template
package main
import "fmt"
import "encoding/json"
import "os"
import "io/ioutil"
import "path/filepath"
import "github.com/ghodss/yaml"
const openshiftApiVer = "v1beta1"
@aweiteka
aweiteka / test_registry_api.sh
Last active August 29, 2015 14:22
test docker registry API
#!/bin/bash
# curl -v $hostname/<path> --key /etc/pki/entitlement/<id>-key.pem --cert /etc/pki/entitlement/<id>.pem --cacert cert.crt
# docker pull calls
#/v1/_ping
#/v1/repositories/acme/app/images
#/v1/repositories/acme/app/tags
# these are all redirects
#/v1/images/5f28cecd443d0503f9350f690ae6896b3e18e6c8ae59e9556b6ac157180b61e7/ancestry

Keybase proof

I hereby claim:

  • I am aweiteka on github.
  • I am aweiteka (https://keybase.io/aweiteka) on keybase.
  • I have a public key whose fingerprint is 04AA 2FAA 4762 69AB 3407 FA45 FD5E B4DB 4807 17ED

To claim this, I am signing this object:

@aweiteka
aweiteka / automated-builds.json
Last active August 29, 2015 14:25
OpenShift v3 image CI-CD pipeline
{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"name": "automated-build",
"creationTimestamp": null,
"annotations": {
"description": "An OpenShift v3 template that sets up an automated build pipeline for building docker images from Dockerfile. Assumes the base FROM image has been created as an ImageStream.",
"provider": "[email protected]"
}
@aweiteka
aweiteka / atomicapp-installer.md
Last active August 29, 2015 14:27
Atomic App as a generalized installation pattern for linux

Problem

There is no standard application installation technology for linux like MSI for Windows. Projects are increasingly turning to Ansible and Heat for installing their distributed applications. However there is no standard way to distribute ansible playbooks or heat templates outside of Github or RPM.

Needs

  • End-users need a way to customize their installation using descriptive parameters.
  • Installer artifacts and tooling should be packaged and distributed in a container image.
  • Each project should be able to interface with a standard way of packaging and executing their installation.

Joe's Journey

Joe is relatively new to his job. He has been contributing to a new service in the Flubber project and was asked to create a container for it. His container integrates with the "Bounce" service. He's been pulling the flubber/bounce image anonomously from an internal Docker registry but didn't know anything else about the registry. He tried to push to the registry the image he was working on but got 401 Unauthorized. Curious, he loaded the registry URL in the browser and was redirected to a login page. His corporate single sign-on credentials worked!

He browsed a huge, flat list of images but it was too big to sort through. He noticed a filter field and typed "flu". A dynamic list of all of the "flubber" images was displayed. He clicked the Flubber project link and noticed a list of project admins. He recognized Amy's name and sent her an email asking how to get his image pushed into the registry.

While he waited to hear back from Amy he decided to try creating his own project to put hi

@aweiteka
aweiteka / openshift2kube.md
Created December 23, 2015 15:21
Exporting OpenShift to Kubernetes

Exporting an application from OpenShift to Kubenetes

OpenShift v3 is based on Kubernetes, adding additional objects such as builds, routes and image streams.

Metadata

Common objects or data types

  • pods
  • replication controllers (rc)
@aweiteka
aweiteka / run.sh
Created January 14, 2016 16:43
Run Origin all-in-one container with custom config
#!/bin/bash
# start all-in-one container
sudo docker run -it --name "origin" --privileged --pid=host --net=host -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys -v /var/lib/docker:/var/lib/docker:rw -v /var/lib/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes -v `pwd`/config/:/var/lib/origin/openshift.local.config:Z --entrypoint bash openshift/origin
# gen config
openshift start --write-config=./openshift.local.config
# edit config
#sudo vim config/master/master-config.yaml
@aweiteka
aweiteka / master-config.yaml
Last active January 26, 2016 19:47
OpenShift Authentication config snippet--3 providers: Htpasswd, LDAP (AD) and GitHub
oauthConfig:
assetPublicURL: https://localhost:8443/console/
grantConfig:
method: auto
identityProviders:
- name: github
challenge: false
login: true
mappingMethod: claim
provider: