Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am benjvi on github.
  • I am benjvi (https://keybase.io/benjvi) on keybase.
  • I have a public key ASDHceCesUYNDZH-EpFm3gM_EAvfR-eMZWGOF8b3Y9zk0go

To claim this, I am signing this object:

@benjvi
benjvi / bosh_env_aliases.sh
Last active May 28, 2019 10:06
Aliases added to my zshrc to make it easier to handle bosh envs
bosh-setup-env() {
# setup with just director IP and path to creds file from `bosh create-env`
# arg[1] - director IP
# arg[2] - path to creds file
export BOSH_ENVIRONMENT="$1"
export BOSH_CLIENT=admin
export BOSH_CLIENT_SECRET="$(cat "$2" | yq -r .admin_password)"
export BOSH_CA_CERT="$(cat "$2"| yq -rc .director_ssl.ca)"
BOSH_DIR_ID="$(echo $RANDOM | head -c 3)"
# depends on:
# CLIs: bosh, fly, credhub, om
# aliases: bosh_env_aliases (another of my gists)
alias fly='fly -t concourse'
alias whichom="env | grep -i om_"
alias ch=credhub
fly-cp-login() {
# arg[1] - control plane external url (no port)
# dependencies
# cli: kubectl, pks, om, yq
alias k=kubectl
alias kube=kubectl
alias kube-use-ns="kubectl config set-context $(kubectl config current-context) --namespace"
pks-get-admin-pw() {
om curl --path "https://example.com/api/v0/deployed/products/$pks_product_id/credentials/.properties.uaa_admin_password" | jq -r ".credential.value.secret" 2> /dev/null
}
---
az-configuration:
- name: ((availability_zones.0))
- name: ((availability_zones.1))
- name: ((availability_zones.2))
network-assignment:
network:
name: management
singleton_availability_zone:
name: ((availability_zones.0))
---
opsman-configuration:
vsphere:
vcenter:
url: ((vcenter_host))
username: ((vcenter_username))
password: ((vcenter_password))
datastore: ((vcenter_datastore))
# ca_cert: TODO: add to terraform if necessary
host: example-host # vCenter host to deploy Ops Manager in
resources:
- name: test-file
type: s3
source:
endpoint: http://MY_MINIO_ENDPOINT:9000
access_key_id: MY_ACCESS_KEY
bucket: concourse-resources
secret_access_key: MY_SECRET
regexp: test-(.*).txt
@benjvi
benjvi / cert-manager-cert-alert.yml
Created January 26, 2022 16:56
Sample Alert For Expiring Cert Manager Certificates
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: ingress-certificate-expiry
namespace: monitoring
labels:
prometheus: k8s
role: alert-rules
spec:
groups:
@benjvi
benjvi / dashboard-backup-execution-1643216020334.json
Created January 26, 2022 16:58
Backup Execution Dashboard - CronJobs & Velero
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@benjvi
benjvi / dashboard-apps-basic-checks-by-namespace-1643215963443.json
Created January 26, 2022 17:00
Apps in Namespace Basic Health Dashboard
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}