Skip to content

Instantly share code, notes, and snippets.

View alchen99's full-sized avatar

Alice Chen alchen99

View GitHub Profile
@alchen99
alchen99 / cloud-init-minnaker-marketplace
Created February 9, 2021 21:56
Cloud Init for Minnaker in AWS Marketplace
#cloud-config
repo_update: true
repo_upgrade: all
packages:
- curl
- httpie
- jq
- make
- screen
@alchen99
alchen99 / bashrc-ext-minnaker
Created February 9, 2021 21:44
Extended bashrc for minnaker
# kubectl
#source <(kubectl completion bash)
if [ -f /etc/rancher/k3s/k3s.yaml ]; then
export KUBECONFIG="~/.kube/config:/etc/rancher/k3s/k3s.yaml"
elif [ -f ~/.kube/config ]; then
export KUBECONFIG="~/.kube/config"
fi
alias k='kubectl'
alias kcc='kubectl config current-context'
@alchen99
alchen99 / standard-artifacts.json
Last active February 22, 2021 20:06
Spinnaker Standard Artifacts Pipeline Definition (1.20+)
{
"expectedArtifacts": [
{
"defaultArtifact": {
"artifactAccount": "docker-registry",
"id": "fa3d4608-d499-46f9-87d7-0da05c0a7bc2",
"name": "index.docker.io/alchen99/express-hello-world",
"reference": "index.docker.io/alchen99/express-hello-world:alpine-httpd-blue",
"type": "docker/image",
"version": "alpine-httpd-blue"
@alchen99
alchen99 / legacy-artifacts.json
Last active January 14, 2021 20:51
Spinnaker Legacy Artifacts Pipeline Definition (before 1.21)
{
"description": "Artifacts created with legacy artifacts UI (less than 1.19) ",
"expectedArtifacts": [
{
"defaultArtifact": {
"artifactAccount": "alchen99-git-helm-repo",
"id": "6f653e58-8d6c-4cb6-a10b-30fd08108ea6",
"name": "colors",
"type": "helm/chart",
"version": "0.1.3"
@alchen99
alchen99 / generate-ulid.sh
Created January 5, 2021 01:34
Generate ULID
generate_ulid () {
# generate ulid for Spinnaker stats
curl -s https://ulidgenerator.com/ | sed -n '/class="js-ulid-result"/{n;p}' | sed -e 's/\(<[^<][^<]*>\)//g; /^$/d'
}
@alchen99
alchen99 / custom-job-stage-david.yml
Created November 4, 2020 17:41
Spinnaker Summit - Kustomize Equiv
apiVersion: spinnaker.armory.io/v1alpha2
kind: SpinnakerService
metadata:
name: spinnaker # name doesn't matter since this is a patch
spec:
# spec.spinnakerConfig - This section is how to specify configuration spinnaker
spinnakerConfig:
# spec.spinnakerConfig.profiles - This section contains the YAML of each service's profile
profiles:
orca:
@alchen99
alchen99 / clouddriver.yml
Created November 4, 2020 17:37
Spinnaker Summit - Kubernetes Clouddriver sample config
apiVersion: spinnaker.armory.io/v1alpha2
kind: SpinnakerService
metadata:
name: spinnaker
spec:
validation:
providers:
kubernetes:
enabled: true # Default: true. Indicate if operator should do connectivity checks to configured kubernetes accounts before applying the manifest
spinnakerConfig:
@alchen99
alchen99 / cloud-init-minnaker-prereq
Last active November 3, 2020 22:17
Cloud Init for Minnaker to Spinnaker Operator
#cloud-config
repo_update: true
repo_upgrade: all
packages:
- curl
- golang
- httpie
- jq
- make
@alchen99
alchen99 / Makefile.add
Last active June 10, 2021 21:42
Additional make commands for K3s with Traefik from https://github.com/carlosedp/cluster-monitoring.git
update_config: ## Update vars.jsonnet
@echo "External IPs are ${EXT_IP}"
curl -s https://gist.githubusercontent.com/alchen99/249b382a8c64401638d87e9f0dd13fb7/raw/b02654ed49f1b92f9130c56bd2dff62fb8afd1eb/vars.jsonnet -o vars.jsonnet
curl -s https://gist.githubusercontent.com/alchen99/b55d285d018abe23d196d82f6e824133/raw/fc34a76e957fe90dfca3f703600d43b54c2e4209/minnaker-tmp.crt -o server.crt
curl -s https://gist.githubusercontent.com/alchen99/b1eaecb36176aba2e049f4148d07abc4/raw/b037195bc4dad6155e6a40dc4c4a3439efe96159/minnaker-tmp.key -o server.key
sed -i 's/CHANGE_EXT_IP/'${EXT_IP}'/g' vars.jsonnet
@echo ""
@echo "Patching prometheus clusterrole so it has more permissions"
curl -s https://gist.githubusercontent.com/alchen99/e1fb9fd045a2e82c8d99449a15c1fe8f/raw/926a671dcbd4817b841733016f98d056718a5fb1/prometheus_clusterrole_patch.diff -o prometheus_clusterrole_patch.diff
{
_config+:: {
namespace: 'monitoring',
},
// Enable or disable additional modules
modules: [
{
// After deployment, run the create_gmail_auth.sh script from scripts dir.
name: 'smtpRelay',
enabled: false,