Skip to content

Instantly share code, notes, and snippets.

$ gcloud container clusters create test-cluster --region us-central1 --num-nodes 4
Default change: VPC-native is the default mode during cluster creation for versions greater than 1.21.0-gke.1500. To create advanced routes based clusters, please pass the `--no-enable-ip-alias` flag
Note: Your Pod address range (`--cluster-ipv4-cidr`) can accommodate at most 1008 node(s).
Creating cluster test-cluster in us-central1... Cluster is being health-checked (master is healthy)...done.
Created [https://container.googleapis.com/v1/projects/<project>/zones/us-central1/clusters/test-cluster].
To inspect the contents of your cluster, go to: https://console.cloud.google.com/kubernetes/workload_/gcloud/us-central1/test-cluster?project=<project>
kubeconfig entry generated for test-cluster.
NAME LOCATION MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS
test-cluster us-central1 1.21.9-gke.1002 34.133.154.90 e2-medium 1.21.9-gke.1002 12 RUNNING
@jmcdice
jmcdice / gist:527e2dcccb59fade0a295d2f630bee3a
Created December 4, 2019 18:40
Concourse-Vault-Docker
FROM ubuntu:latest
ENV DEBIAN_FRONTEND noninteractive
RUN sed -i 's#http://archive.ubuntu.com/#http://ubuntu.mirrors.tds.net/ubuntu/#' /etc/apt/sources.list
# built-in packages
RUN apt-get update
RUN apt-get -o Dpkg::Options::='--force-confold' --force-yes -fuy dist-upgrade
# common utils apt
# Deploy Concourse to PKS
$ helm init --wait
$ kubectl create serviceaccount --namespace kube-system tiller
$ kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
$ kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
$ helm install --name concourse stable/concourse
# View Concourse via your browser
$ export POD_NAME=$(kubectl get pods --namespace default|perl -lane 'print @F[0] if /web/')
## Install Utils:
$ sudo apt-get update
$ sudo apt-get install tmux youtube-dl htop ccze vlc
## Install and use youtube-dl
$ youtube-dl https://www.youtube.com/watch?v=cC9r0jHF-Fw
$ youtube-dl -F <video> (list video formats)
$ youtube-dl -f <index> <video> download video at <format> --output fish.webm
## Example
# Install gcloud
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
apt-get -y update
apt-get -y --allow-unauthenticated install google-cloud-sdk kubectl
# Install GCSFuse
#!/usr/bin/env bash
TARGET='concourse'
TASK='deploy-healthwatch/apply-changes'
function wait_for_pipeline_to_complete() {
local JOB=$1
local count=1
#!/usr/bin/env bash
#
# Have you ever deleted the default fw rules in your gcp project?
# Of course you have! Here's how to re-create them.
PROJECT=''
function create_default_ruleset() {
# Allow ICMP from Anywhere
@jmcdice
jmcdice / Training
Last active September 21, 2017 22:05
## Training for PRE
If on AWS or GCP use BBL
Setup Standalone Bosh (Bosh Boot Loader)
- https://github.com/cloudfoundry/bosh-bootloader
If on other, use bosh create-env (init)
https://bosh.io/docs/init.html
Deploy the Vault Bosh Release (secure credential storage)
@jmcdice
jmcdice / gist:fe15cc5ed053d57146d1961a76d833af
Last active July 14, 2017 13:54
Install and start concourse on Ubuntu
#!/usr/bin/env bash
function get_binary() {
wget https://github.com/concourse/bin/releases/download/v2.8.0-rc.125/concourse_linux_amd64 -O /usr/sbin/concourse
chmod 755 /usr/sbin/concourse
}
function create_keys() {
cat >cloudinit.sh<<EOF
#cloud-config
users:
- default
- name: stack
lock_passwd: False
sudo: ["ALL=(ALL) NOPASSWD:ALL\nDefaults:stack !requiretty"]
shell: /bin/bash