Skip to content

Instantly share code, notes, and snippets.

@warroyo
warroyo / Dockerfile
Created January 5, 2021 20:33
codestream-ci-image
FROM vmwarecmbu/k8s-ci-container
RUN apt-get update && apt-get install -y git jq && \
curl -LO https://vmware.bintray.com/tmc/0.2.0-001dbc95/linux/x64/tmc && \
chmod +x ./tmc && \
mv ./tmc /usr/local/bin/tmc
@warroyo
warroyo / template.sh
Created January 8, 2021 18:36
ubuntu ova script for cloudinit in vmware
#!/bin/bash
###Create a runonce script for re-exec cloud-init. ###
###System Update###
sudo apt-get update && sudo apt-get -y upgrade
# ###install cloud-init. ###
sudo apt-get -y install cloud-init
# ###install perl ###
sudo apt-get -y install perl
@warroyo
warroyo / get-sa-token.sh
Created February 4, 2021 22:25
getting a token from k8s service account
export APISERVER=$(kubectl config view --minify | grep server | cut -f 2- -d ":" | tr -d " ")
APISERVERNOHTTPS=$(echo $APISERVER | cut -c 9-)
FPRINT=$(openssl s_client -connect $APISERVERNOHTTPS < /dev/null 2>/dev/null | openssl x509 -fingerprint -sha256 -noout -in /dev/stdin)
export FINGERPRINT=$(echo $FPRINT | cut -c 20-)
TOKENNAME=$(kubectl -n kube-system get serviceaccount/dev-admin -o jsonpath='{.secrets[0].name}')
export TOKEN=$(kubectl -n kube-system get secret $TOKENNAME -o jsonpath='{.data.token}'| base64 --decode)
@warroyo
warroyo / cluster.yaml
Created July 29, 2021 23:15
ytt example
type:
kind: Cluster
package: vmware.tanzu.manage.v1alpha1.cluster
version: v1alpha1
fullName:
managementClusterName: "seti-labs"
name: cluster-cli
provisionerName: "lab"
meta:
labels: null
@warroyo
warroyo / values.yml
Created August 18, 2021 20:29
harbor metrics values for helm
metrics:
enabled: true
exporter:
podAnnotations:
prometheus.io/port: 8001
prometheus.io/scrape: true
core:
podAnnotations:
prometheus.io/port: 8001
prometheus.io/scrape: true
@warroyo
warroyo / contour-data-values.yaml
Last active September 2, 2021 17:33
static IP for contour TKg extension
#@data/values
#@overlay/match-child-defaults missing_ok=True
---
infrastructure_provider: "vsphere"
contour:
image:
repository: projects.registry.vmware.com/tkg
envoy:
image:
repository: projects.registry.vmware.com/tkg
@warroyo
warroyo / cluster-config.yml
Last active September 8, 2021 20:58
custom lb setup
#! add these values to your cluster config
#!custom subnets to use for LB placement
LB_SUBNETS: "subnet-xxxxxx,subnet-xxxxx"
#! set api LB to internal
LB_INTERNAL: true
# place this file in ~/.tanzu/tkg/providers/infrastructure-aws/v0.6.4/cluster-template-definition-ha1az.yaml
apiVersion: run.tanzu.vmware.com/v1alpha1
kind: TemplateDefinition
spec:
paths:
- path: providers/infrastructure-aws/v0.6.4/ytt
- path: providers/infrastructure-aws/ytt
- path: providers/ytt
- path: bom
filemark: text-plain
@warroyo
warroyo / cluster_config.yml
Created September 14, 2021 16:49
custom LB subnets(workaround)
#! add these values to your cluster config
#!custom subnets to use for LB placement
LB_SUBNETS: "subnet-xxxxxx,subnet-xxxxx"
#! set api LB to internal
LB_INTERNAL: true
@warroyo
warroyo / cluster_config.yml
Created September 20, 2021 22:39
additional tags
#comma seperated pairs using = between key and value
TAGS: "test=test,test2=test5"