Skip to content

Instantly share code, notes, and snippets.

View sjenning's full-sized avatar

Seth Jennings sjenning

  • Red Hat
  • Austin, TX
View GitHub Profile
#!/bin/bash
for i in $(crioctl pod list | grep ^ID: | cut -f2 -d' ')
do
crioctl pod stop --id $i
crioctl pod remove --id $i
done
@sjenning
sjenning / use-crio.sh
Last active September 12, 2017 22:45
How to use cri-o for kube development
# on fedora 26 (as root)
dnf --enablerepo=updates-testing -y install cri-o
systemctl disable --now docker
systemctl enable --now cri-o
# cd to kubernetes repo
CGROUP_DRIVER=systemd CONTAINER_RUNTIME=remote CONTAINER_RUNTIME_ENDPOINT='/var/run/crio.sock' IMAGE_SERVICE_ENDPOINT='/var/run/crio.sock' ./hack/local-up-cluster.sh
# Golang
export GOPATH=$HOME/projects/go
export GOROOT=$HOME/bin/go
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
# Kubernetes
export PATH=$GOPATH/src/k8s.io/kubernetes/third_party/etcd:$PATH
export KUBECONFIG=/var/run/kubernetes/admin.kubeconfig
# Aliases
@sjenning
sjenning / openshift-aio.sh
Created August 23, 2017 23:03
local openshift AIO
_output/local/bin/linux/amd64/openshift start --write-config=openshift.local.config
sudo _output/local/bin/linux/amd64/openshift start --master-config openshift.local.config/master/master-config.yaml --node-config openshift.local.config/node-<node-name>/node-config.yaml
export KUBECONFIG=openshift.local.config/master/admin.kubeconfig
export PATH=$PATH:$PWD/_output/local/bin/linux/amd64
oc get nodes (should work)
[OSEv3:children]
masters
etcd
nodes
[OSEv3:vars]
ansible_ssh_user=centos
ansible_become=yes
deployment_type=origin
[OSEv3:children]
masters
etcd
nodes
[OSEv3:vars]
ansible_ssh_user=centos
ansible_become=yes
deployment_type=origin
@sjenning
sjenning / service-catalog-howto.sh
Last active August 1, 2017 15:28
How to run service catalog on local kubernetes cluster
# THIS IS NOT RUNNABLE, JUST SUFFIXED WITH .SH FOR SYNTAX HIGHLIGHT
# tested on fedora 25 with kube 1.8
# setup env
dnf install git docker gcc -y
systemctl enable --now docker
curl -OL https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz
# add following to $HOME/.bashrc
#export GOPATH=$HOME/go
@sjenning
sjenning / main.go
Created July 15, 2017 01:33
UWP Asset Generator
package main
import (
"fmt"
"gopkg.in/gographics/imagick.v2/imagick"
)
type asset struct {
size float32
Until packages hit repo:
curl -O https://kojipkgs.fedoraproject.org//packages/cri-o/1.0.0.alpha.0/0.git5dcbdc0.fc26.2/x86_64/cri-o-1.0.0.alpha.0-0.git5dcbdc0.fc26.2.x86_64.rpm
dnf install -y cri-o-1.0.0.alpha.0-0.git5dcbdc0.fc26.2.x86_64.rpm
Otherwise just:
dnf install -y cri-o
curl -L -O https://github.com/containernetworking/cni/releases/download/v0.5.2/cni-amd64-v0.5.2.tgz
mkdir -p /opt/cni/bin
tar xf cni-amd64-v0.5.2.tgz -C /opt/cni/bin/
#!/bin/bash
# Attempt to recreate pod stuck in Terminating
STOP=0
function testrun {
while [ $STOP -eq 0 ]; do
project=$1
template=$2