Skip to content

Instantly share code, notes, and snippets.

K8s notes

Cluster basics

Master

provides an API, Scheduler, UI, controller and a KV store, all information and state is stored in -> etcd

control plane

Worker Nodes

@calum-github
calum-github / gist:866487f370bed4e6e0bf1bc2157b8a14
Created November 30, 2018 02:36
example using count in TF
# define the network interfaces in a count block for the vm's you want to assign them to
resource "azurerm_network_interface" "network-interface" {
name = "interface-number-${count.index}"
count = 3
# ...
}
# The above resource will generate three network interfaces
@calum-github
calum-github / get_ami_codes.sh
Last active September 27, 2018 03:44
Get a list of AWS AMI codes for CentOS 7 Linux
#!/bin/bash
# Get latest AMI codes for CentOS 7 from AWS
region="ap-southeast-2"
product_code="aw0evgkw8e5c1q413zgy5pjce"
aws ec2 describe-images \
--region "$region" \
--owners aws-marketplace \
@calum-github
calum-github / gist:f19699aef289ceb7d9bcedc84191c7fa
Last active June 27, 2018 00:41
Installing Pip on Mac OS 10.12+
## Download the get pip script
$ curl -o get_pip.py https://bootstrap.pypa.io/get-pip.py
## Switch to root user
$ sudo su
## Run the script as root
# ./get_pip.py
## Switch back to regular user and install modules with pip
@calum-github
calum-github / ad_check.sh
Created May 9, 2018 07:08
checks to see if its bound to AD or not.
#!/bin/bash
#################################################################################
# #
# Author: Calum Hunter #
# Date: 22-08-2016 #
# Version: 1.0 #
# Purpose: Install check script for the AD Bind Package. #
# This script checks to see if we are bound to AD and if our binding #
# is working. If we are not bound, or our binding is broken. #
#!/usr/bin/expect
expect "connecting"
send "yes\r"
exit 0
@calum-github
calum-github / fixUserShell.py
Last active April 16, 2018 03:43
Fix user's default shell in their user record in /Local/Default
#!/usr/bin/python
'''
Author: Calum Hunter
Date: April 16 2018
Version: 1.0
This script will get the current UserShell
value set in the users record in /Local/Default
# Option 1
# Get the data from the ManagedClient section of the System Profiler
system_profiler SPManagedClientDataType
# Additional - you can also provide the -xml flag to get the output in xml
system_profiler -xml SPManagedClientDataType
# Option 2
# use mcxquery
mcxquery
@calum-github
calum-github / office2016_no_mau.xml
Created December 6, 2015 23:31
office 2016 choices - no mau
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>attributeSetting</key>
<integer>0</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
@calum-github
calum-github / configure_dock.sh
Created January 11, 2016 23:17
dockutil script
#!/bin/bash
################################################################################
# Author: Calum Hunter #
# Date: 12/01/2016 #
# Version: 1.91 #
# Purpose: Default dock settings for user accounts #
# Configured via Dockutil #
# This should be run as a initial login script via LauchAgent #
################################################################################