Skip to content

Instantly share code, notes, and snippets.

@jgreat
jgreat / packer_debug.out
Last active January 2, 2017 23:55
packer arm-azure output
PACKER_LOG=1 packer build post.json
2017/01/02 17:27:46 [INFO] Packer version: 0.12.1
2017/01/02 17:27:46 Packer Target OS/Arch: linux amd64
2017/01/02 17:27:46 Built with Go Version: go1.7.3
2017/01/02 17:27:46 Detected home directory from env var: /home/jgreat
2017/01/02 17:27:46 Using internal plugin for amazon-instance
2017/01/02 17:27:46 Using internal plugin for azure-arm
2017/01/02 17:27:46 Using internal plugin for docker
2017/01/02 17:27:46 Using internal plugin for file
2017/01/02 17:27:46 Using internal plugin for profitbricks
@jgreat
jgreat / export-kubeconfig.sh
Last active February 5, 2018 22:47
Export a kubectl portable config. Import into rancher or other tools.
#!/bin/bash
### kubectl should really allow you to export a singel context.
### if you only have one context you can just run `kubectl config view --flatten`
### if you have more than one context use this script.
###
### **Requires jq: https://stedolan.github.io/jq/
###
context=${1:-"minikube"}
@jgreat
jgreat / deployment.yml
Last active March 2, 2018 16:34
rancher server in k8s
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: server
name: server
spec:
replicas: 1
selector:
@jgreat
jgreat / aws-custom.md
Last active November 16, 2018 03:28
Rancher 2.0 AWS - custom

Install with custom script

AMI:

  • Ubuntu Server 16.04 - ami-91659f4

Size:

  • t2.medium
@jgreat
jgreat / 1.6-Mysql-Tuning.md
Last active May 22, 2018 18:13
1.6-Mysql-Tuning.md

MySQL Config Tuning

Connections:

First and foremost it is important to not run out of connections from the Rancher Server to the MySQL database server. The threads per server are driven by the thread pool size. So max connections should follow this basic formula:

Number of nodes x Total threads + buffer for non-rancher tasks

  • Number of nodes: Rancher Management server nodes.
  • Total Threads: Sum of all thread pools (maximums) found on (http(s):///admin/processes/pools). Default: 150
  • Buffer: Non-rancher tasks such as monitoring, admin, backups and other ad hoc tasks require connections as well.
@jgreat
jgreat / 00-prerequisites.md
Last active October 14, 2019 19:37
Rancher install with helm

Prerequisits

Describe installs for.

  • rke
  • kubectl
  • helm
@jgreat
jgreat / 00-notes.md
Last active February 15, 2024 20:25
Rancher-Azure-Cloud-Provider-Storage-Classes

storageClass with PersistentVolumeClaims are really the way to do storage with Kubernetes.

For Azure There are 3 types of storage avalible.

  • (Slow, Limited, Going to cause tears) AzureFiles - CIFS share, with all the limitaions of CIFS :(
  • (Better) Azure Disk (Storage Account) - You can use this type with Azure "Node Driver" VMs in Rancher.
  • (Best) Azure Disk (Managed) - You will need to create your own VMs that support managed disk with premium storage, then use the "Custom" option.
@jgreat
jgreat / self-signed.md
Last active June 26, 2018 15:47
Create a self signed cert.

CA

First we need to generate a CA for signing the website certs.

Generate CA Private Key

openssl genrsa -out ca.key 2048
@jgreat
jgreat / rke_cleanup.sh
Last active September 20, 2018 21:32
RKE Cleanup
docker rm -fv $(docker ps -qa)
docker volume ls -q | xargs docker volume rm
rm -rf /etc/ceph \
/etc/cni \
/etc/kubernetes \
/opt/cni \
/opt/rke \
/run/secrets/kubernetes.io \
/run/calico \
/run/flannel \