Skip to content

Instantly share code, notes, and snippets.

View rimusz's full-sized avatar

Rimantas (Rimas) Mocevicius rimusz

View GitHub Profile
@rimusz
rimusz / README.md
Last active August 29, 2015 14:15 — forked from proppy/README.md

isoc

isoc is yet another "standard" container format.

It brings together the best bits of Docker Image Specification 1.0 and App Container Specification 0.3.0+git into a comprehensive yet portable container archive format, at the cost of a "few" duplicated bytes.

Layout

An isoc image is a appc image embedded in a docker image, but also a docker image embedded in a appc image. Some people might describe it as an iso-contained container format.

Kubernetes on Rocket

API Service

/etc/systemd/system/kube-apiserver.service
[Unit]
$ actool cat-manifest --pretty-print kubelet-0.19.0.aci
{
"acKind": "ImageManifest",
"acVersion": "0.5.1",
"name": "kubelet",
"labels": [
{
"name": "version",
"value": "0.19.0"
},
@rimusz
rimusz / preemtible_kubernetes.md
Last active July 7, 2018 02:52 — forked from tsuri/preemtible_kubernetes.md
kubernetes cluster w/ pre-emptible instances

Kubernetes clusters using preemtible instances

Motivation

People experimenting with kubernetes clusters on the GKE not necessarily have money to keep a full cluster on at all time. GKE clusters can be easily resized, but this still incurs in the full instance cost when the cluster is up.

Google has added preemptible instances that are ideal for many

@rimusz
rimusz / kubernetes-dashboard-auto-refresh.sh
Created September 25, 2016 23:54
Kubernetes-Dashboard Auto Refresh Script
#!/usr/bin/env bash
set -eu -o pipefail
DASHBOARD_REPO_PATH="${DASHBOARD_REPO_PATH:-"/home/cole/code/colemickens/dashboard"}"
REGISTRY="${REGISTRY:-"docker.io/colemickens"}"
cd "${DASHBOARD_REPO_PATH}"
git remote update
git reset --hard kubernetes/master
@rimusz
rimusz / README.md
Created October 14, 2016 08:32 — forked from adambom/README.md
Backup Kubernetes Cluster State

Run this in order to backup all you k8s cluster data. It will be saved in a folder bkp. To restore the cluster, you can run kubectl apply -f bkp.

Please note: this recovers all resources correctly, including dynamically generated PV's. However, it will not recover ELB endpoints. You will need to update any DNS entries manually, and manually remove the old ELB's.

Please note: This has not been tested with all resource types. Supported resource types include:

  • services
  • replicationcontrollers
  • secrets
  • deployments
  • horizontal pod autoscalers
@rimusz
rimusz / kube-rotate.sh
Created October 26, 2016 14:13 — forked from mgoodness/kube-rotate.sh
Bash script for draining & terminating Kubernetes nodes
#!/usr/bin/env bash
k8s_node="$1"
kubectl drain --force --ignore-daemonsets --delete-local-data ${k8s_node}
if [[ $? -eq 0 ]]; then
instance_id=$(aws ec2 describe-instances --out=text\
--filters Name=network-interface.private-dns-name,Values=${k8s_node} \
--query 'Reservations[0].Instances[0].{InstanceID:InstanceId}')
@rimusz
rimusz / parse-tcpdump-udp-port-53.php
Created March 23, 2017 14:56 — forked from jtai/parse-tcpdump-udp-port-53.php
Quick and dirty script to parse output of /usr/sbin/tcpdump -vvv -s 0 -l port 53
<?php
// quick and dirty argument parsing
foreach ($argv as $arg) {
if ($arg == '-f') {
define('FOLLOW', true);
}
if ($arg == '-h') {
define('HISTOGRAM', true);
}
@rimusz
rimusz / pr.md
Created May 5, 2017 07:48 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@rimusz
rimusz / gitlab-runner.yaml
Created May 10, 2017 15:40 — forked from lsjostro/gitlab-runner.yaml
gitlab-runner k8s
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: gitlab-ci
namespace: gitlab
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]