Skip to content

Instantly share code, notes, and snippets.

View metral's full-sized avatar
☁️

Mike Metral metral

☁️
View GitHub Profile
@metral
metral / ubuntu_dist_upgrade.sh
Created October 17, 2013 19:59
Non-interactive apt-get update & dist-upgrade - Ubuntu
#!/bin/bash
# update & dist-upgrade
unset UCF_FORCE_CONFFOLD
export UCF_FORCE_CONFFNEW=YES
ucf --purge /boot/grub/menu.lst
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -o Dpkg::Options::="--force-confnew" --force-yes -fuy dist-upgrade
#!/bin/bash
# Copyright 2014 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@metral
metral / gh-dl-release
Last active June 5, 2024 21:09 — forked from maxim/gh-dl-release
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
#!/bin/bash
# Local kubeconfig settings
# These values don't affect connectivity to the cluster as they're only meant for
# the end-user's usage & readability
CLUSTER_NAME="kubernetes"
CLUSTER_USER="admin"
CLUSTER_ROOT_CA_PROPERTY="clusters.$CLUSTER_NAME.certificate-authority-data"
kind: ConfigMap
apiVersion: v1
metadata:
name: calico-config
namespace: kube-system
data:
etcd_endpoints: http://10.0.0.50:2379
apiVersion: v1
kind: Pod
metadata:
name: calicoctl
namespace: kube-system
spec:
hostNetwork: true
containers:
- name: calicoctl
image: calico/ctl:v1.0.1

Ingress configuration options per platform.

Platform Host Port Node Port Cluster IP Provider
Bare-Metal Y Y Y NA
Google Cloud Y N N GLBC
AWS Y Y N NA

Ingress configuration pros/cons.

@metral
metral / ubuntu-debug.yaml
Created June 28, 2017 03:27
Ubuntu debug container for k8s
apiVersion: v1
kind: Pod
metadata:
name: ubuntu-debug
spec:
hostNetwork: true
containers:
- image: metral/debug:0.0.1
command:
- sleep
apiVersion: v1
kind: LimitRange
metadata:
name: mylimits
spec:
limits:
- max:
cpu: 1
memory: 1Gi
min:
@metral
metral / registry_creds.sh
Created August 30, 2017 05:47
k8s registry creds
#!/bin/bash
AUTH="$DOCKER_USERNAME:$DOCKER_PASSWORD"
AUTH_B64=$(echo -n $AUTH | base64 -w 0)
DOCKERCFG="{
\"auths\": {
\"$DOCKER_REGISTRY\": {
\"auth\": \"$AUTH_B64\"
}