Skip to content

Instantly share code, notes, and snippets.

@johnmarcou
johnmarcou / drone-setup.py
Last active July 31, 2018 06:39
Drone CI setup repo
#!/usr/bin/env python3
# .drone.yml is used to configure your pipeline at the repo level
# let's write a .drone.setup.yml to setup our repo, configure some settings, and push some secrets
#
# Configure your Drone repo with a git-tracked file, then apply your conf
# Use a bit of sops (https://github.com/mozilla/sops) to protect your secrets
# First, export your Drone env var (DRONE_SERVER, DRONE_TOKEN)
# Run: ./drone-setup.py
#
helm plugin install https://github.com/databus23/helm-diff --version v2.8.0+1
@johnmarcou
johnmarcou / merge_to_active_kubeconfig.sh
Created February 12, 2018 03:55
Merge kubeconfig files
kmerge() {
NEW_KUBECONFIG=$1
ACTIVE_KUBECONFIG=${KUBECONFIG:-~/.kube/config}
BACKUP_KUBECONFIG=$ACTIVE_KUBECONFIG.bak
cp $ACTIVE_KUBECONFIG $BACKUP_KUBECONFIG 2>/dev/null || :
KUBECONFIG=$BACKUP_KUBECONFIG:$NEW_KUBECONFIG kubectl config view --flatten > $ACTIVE_KUBECONFIG
}
@johnmarcou
johnmarcou / crideploy.sh
Last active February 9, 2018 04:41
Deploy CRIPROXY on CoreOS
set -x
mkdir -p /opt/bin/
#wget -O /opt/bin/criproxy https://github.com/Mirantis/criproxy/releases/download/v0.9.4/criproxy
chmod +x /opt/bin/criproxy
if [ ! -f /etc/systemd/system/kubelet.service.origin ]; then
@johnmarcou
johnmarcou / coreos-windows-share.sh
Created March 31, 2017 03:41 — forked from pantelis/coreos-windows-share.sh
Mount Windows share drives on CoreOS
# WARNING - THIS IN NOT a SHELL SCRIPT - JUST a LIST of COMMANDS
# based on https://github.com/coreos/coreos-overlay/issues/595 with links updated
# Build cifs-utils in a container and copy it into /tmp on the host.
$docker run -t -i -v /tmp:/host_tmp fedora /bin/bash
# On the container bash prompt
yum groupinstall -y "Development Tools" "Development Libraries"
yum install -y tar
yum install -y bzip2
curl http://ftp.samba.org/pub/linux-cifs/cifs-utils/cifs-utils-6.3.tar.bz2 | bunzip2 -c - | tar -xvf -