Skip to content

Instantly share code, notes, and snippets.

View chrislovecnm's full-sized avatar
😃
Living LIFE!!

Chris Love chrislovecnm

😃
Living LIFE!!
View GitHub Profile
@chrislovecnm
chrislovecnm / alias.zsh
Created September 14, 2017 00:26
zsh alias' for kops
getMasterIP()
CLUSTER=$1
AZ=$2
aws ec2 describe-instances --filter Name="tag-value",Values="master-${AZ}.masters.${CLUSTER}" --filter Name="instance-state-name",Values="running" | jq -r '.Reservations[0].Instances[0].PublicIpAddress'
}
tailMasterLog() {
IP=$(getMasterIP $1 $2)
ssh admin@$IP "tail -f /var/log/daemon.log"
}
@chrislovecnm
chrislovecnm / rolling-update-2s.md
Last active September 5, 2017 02:09
Rolling Update Test 2s

Rolling Update Testing Notes

Attempt to recreate problem the @justinsb is having with 2s interval

Create cluster

kops create cluster --zones us-east-1c --name rolling-update.aws.k8spro.com --yes
@chrislovecnm
chrislovecnm / rolling-update-2m.md
Last active September 5, 2017 02:15
Rolling Update test normal case 2m interval

Rolling Update Test Normal Case

These are the test results from upgrading using:

export KOPS_FEATURE_FLAGS=+DrainAndValidateRollingUpdate

Create a cluster

@chrislovecnm
chrislovecnm / kops-admin.json
Last active October 3, 2017 15:36
Permissions Needed By a Kops Administrator - No VPC network perms included.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:AttachVolume",
"ec2:AuthorizeSecurityGroupEgress",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CreateSecurityGroup",
@chrislovecnm
chrislovecnm / iam-node.json
Created May 11, 2017 03:48
json IAM policy for kops kubernetes node
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances"
],
"Resource": [
"*"
@chrislovecnm
chrislovecnm / iam-master.json
Last active October 2, 2017 20:29
kubernetes master iam policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:AttachVolume",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CreateTags",
"ec2:CreateVolume",
@chrislovecnm
chrislovecnm / kops-iam-installer.txt
Created April 18, 2017 20:08
IAM roles for kops kubernetes installer
//All the resource "*" we can prune down to a
//"Resource": "arn:aws:iam::ACCOUNTNUMBER:role/ROLENAME"
// which is tied to a VPC
// This is a list of the permissions that our installer tools
// use.
// There are multiple modes that our installer uses, we
// will not need the perms for VPC creation as we
// will be using a pre installed VPC
// Will need all of these
@chrislovecnm
chrislovecnm / kops-node-k8s.json
Last active April 20, 2017 02:14
Kops k8s node IAM Role
//All the resource "*" we can prune down to a
//"Resource": "arn:aws:iam::ACCOUNTNUMBER:role/ROLENAME"
//which is tied to a VPC
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:Describe*"
@chrislovecnm
chrislovecnm / kops-k8s-master-iam.json
Created April 18, 2017 20:02
JSON for IAM kops master
//All the resource "*" we can prune down to a
//"Resource": "arn:aws:iam::ACCOUNTNUMBER:role/ROLENAME"
//which is tied to a VPC
{
"Version": "2012-10-17",
"Statement": [
// This is used by the autoscaling components
{
"Effect": "Allow",
"Action": [
@chrislovecnm
chrislovecnm / pod-antiaffinity.yaml
Created March 15, 2017 22:34
example yaml for pod anti-affinity
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
nginx: yes
annotations:
scheduler.alpha.kubernetes.io/affinity: >
{
"nodeAffinity": {