Skip to content

Instantly share code, notes, and snippets.

@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:
@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 / 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
}
...
}
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 "image_url" {
default = "debian-cloud/debian-8"
}
resource "google_compute_disk" "seconddisk" {
name = "seconddisk"
type = "pd-standard"
zone = "us-west1-a"
size = "100"
}
variable "region" {
default = "us-east-1"
}
variable "ssh_public_key" {
default = "~/.ssh/id_rsa.pub"
}
provider "aws" {
region = "${var.region}"
@ryane
ryane / k8s-deployment-demo-deployment-version.diff
Created June 14, 2016 13:05
Diff between the v1 and v2 k8s-deployment-demo deployment manifests
diff --git a/demo-deployment-v1.yml b/demo-deployment-v2.yml
index 2823271..13f58d3 100644
--- a/demo-deployment-v1.yml
+++ b/demo-deployment-v2.yml
@@ -12,15 +12,15 @@ spec:
metadata:
labels:
app: k8s-deployment-demo
- version: v0.1
+ version: v0.2
@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

Keybase proof

I hereby claim:

  • I am ryane on github.
  • I am ryane (https://keybase.io/ryane) on keybase.
  • I have a public key whose fingerprint is E4F4 1EAB BF0F C785 06D8 62EF EF68 CF41 D42A 593D

To claim this, I am signing this object:

@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 '')