Skip to content

Instantly share code, notes, and snippets.

View glaracuente's full-sized avatar

Gerardo Laracuente glaracuente

View GitHub Profile
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp
namespace: development
spec:
replicas: 2
selector:
matchLabels:
app: webapp
@glaracuente
glaracuente / sensu-server
Created January 13, 2020 21:35
sensu-server init script with kill-9 . Lines 265-272 are the only additions to the original
#!/bin/bash
# chkconfig: 345 90 01
# description: Sensu monitoring framework service
### BEGIN INIT INFO
# Provides: server
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
#!/bin/bash
environmentX=$1
aws_output=$(aws elb describe-load-balancers --region=us-east-1 |grep "\"DNSName\": \"internal-$environmentX")
if [[ ${#aws_output} -lt 50 ]]; then
echo "No elbs were found for ${environmentX}".
exit
fi
@glaracuente
glaracuente / dot_twelve_workspace_checker
Created September 9, 2019 20:04
workspace_checker for 0.12, does NOT work with 0.11
locals {
invalid_workspace = contains(var.valid_workspaces, terraform.workspace) ? null : file(
"ERROR: You're running in the ${terraform.workspace} workspace which isn't valid for this project. You can set the workspace name by typing: terraform workspace select <name>. Valid workspaces for this project are: ${join(",", var.valid_workspaces)}",
)
}
variable "valid_workspaces" {
description = "List of valid workspaces for this project"
type = list(string)
}
### Keybase proof
I hereby claim:
* I am glaracuente on github.
* I am glaracuente (https://keybase.io/glaracuente) on keybase.
* I have a public key ASCDXOAnLfxL9hTavaiKILvuCjEtX3XgTPXeFH2newvZkwo
To claim this, I am signing this object: