Skip to content

Instantly share code, notes, and snippets.

@ryane
ryane / five_minutes.yml
Created February 24, 2015 15:15
five_minutes.yml
---
- hosts: all
vars:
UBUNTU_COMMON_ROOT_PASSWORD: 'xxxxx'
UBUNTU_COMMON_DEPLOY_PASSWORD: 'xxxxx'
UBUNTU_COMMON_LOGWATCH_EMAIL: user@example.com
ubuntu_common_deploy_user_name: deploy
ubuntu_common_deploy_public_keys:
- ~/.ssh/id_rsa.pub
@ryane
ryane / defaultbackend.yml
Last active July 13, 2023 01:11
Code for External DNS, Let's Encrypt, and Nginx Ingress on Kubernetes and AWS
---
kind: Service
apiVersion: v1
metadata:
name: nginx-default-backend
labels:
app: ingress-nginx
component: default-backend
k8s-addon: ingress-nginx.addons.k8s.io
@ryane
ryane / k8s-deployment-demo-version.diff
Created June 12, 2016 14:46
Diff between the v1 and v2 k8s-deployment-demo replication controller manifests
diff --git a/demo-rc-v0.1.yml b/demo-rc-v0.2.yml
index 985c09f..f464cdf 100644
--- a/demo-rc-v0.1.yml
+++ b/demo-rc-v0.2.yml
@@ -2,25 +2,25 @@
apiVersion: v1
kind: ReplicationController
metadata:
- name: k8s-deployment-demo-controller-v1
+ name: k8s-deployment-demo-controller-v2
@ryane
ryane / terraform-aws-wait-healthy.sh
Last active November 7, 2019 03:12
Waits for AWS instances launched from Terraform to become healthy
aws ec2 wait instance-status-ok --instance-ids $(cat terraform.tfstate | jq '.modules[].resources[] | select(.type == "aws_instance") | .primary.attributes.id' | sed 's/\"//g' | tr '\n', ' '; echo '')
@ryane
ryane / main-state.tf
Last active April 26, 2018 16:24
Code for Deploy Kubernetes in an Existing AWS VPC with Kops and Terraform post
resource "aws_s3_bucket" "state_store" {
bucket = "${var.name}-state"
acl = "private"
force_destroy = true
versioning {
enabled = true
}
...
}
variable "image_url" {
default = "debian-cloud/debian-8"
}
resource "google_compute_disk" "seconddisk" {
name = "seconddisk"
type = "pd-standard"
zone = "us-west1-a"
size = "100"
}
@ryane
ryane / demo.yml
Last active May 21, 2017 13:02
Code for ExternalDNS blog post
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: nginx.extdns.ryaneschinger.com
http:
aws_route53_zone.public: Refreshing state... (ID: ZPIIVVYPS22KD)
aws_route53_zone.public: Destroying...
2017/03/03 08:37:06 [INFO] Terraform version: 0.8.8
2017/03/03 08:37:06 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.8.8/bin/terraform", "destroy", "-force"}
2017/03/03 08:37:06 [DEBUG] Detected home directory from env var: /Users/ryan
2017/03/03 08:37:06 [DEBUG] Detected home directory from env var: /Users/ryan
2017/03/03 08:37:06 [DEBUG] Attempting to open CLI config file: /Users/ryan/.terraformrc
2017/03/03 08:37:06 [INFO] Local triton provider configuration 'triton-terraform' overrides '/usr/local/Cellar/terraform/0.8.8/bin/terraform-TFSPACE-internal-plugin-TFSPACE-provider-TFSPACE-triton'
2017/03/03 08:37:06 [DEBUG] Detected home directory from env var: /Users/ryan
2017/03/03 08:37:06 [DEBUG] Checking resource noop: aws_route53_zone.public
variable "region" {
default = "us-east-1"
}
variable "ssh_public_key" {
default = "~/.ssh/id_rsa.pub"
}
provider "aws" {
region = "${var.region}"
@ryane
ryane / gist:5492658
Created April 30, 2013 23:17
Disable Chrome's terrible print dialog
defaults write com.google.Chrome DisablePrintPreview -boolean true