Skip to content

Instantly share code, notes, and snippets.

View guangbochen's full-sized avatar
👨‍👩‍👧‍👦
orchestration

Guangbo guangbochen

👨‍👩‍👧‍👦
orchestration
View GitHub Profile
kind: pipeline
name: default
steps:
- name: docker-mirror
image: docker
volumes:
- name: docker
path: /var/run/
environment:
# launch an ubuntu instance
multipass launch --name k3s --mem 5G --disk 20G
# mount local dir to the vm
mp mount $PWD k3sdev
mp shell k3sdev
# install golang 1.13
sudo add-apt-repository ppa:longsleep/golang-backports
@guangbochen
guangbochen / dev-ops.sh
Created April 16, 2020 07:22
useful dev ops sh
alias 'airgap'='iptables -A OUTPUT -i eth0 -j DROP && iptables -A INPUT -i eth0 -j DROP'
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# -----------------------------------------------------------------------------
# K3d cluster variables helpers. These functions need the
# following variables:
#
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
cattle.io/creator: norman
source: rancher-alert
name: michelia-test
namespace: cattle-prometheus
spec:
groups:
# init gcloud client
gcloud init
gcloud auth login
# create base disk
gcloud compute disks create gc-debian --image-project debian-cloud --image-family debian-9 --zone asia-east2-b
# create image with nested virtualization license
gcloud compute images create gc-debian-image \
--source-disk gc-debian --source-disk-zone asia-east2-b \
apiVersion: v1
kind: Namespace
metadata:
name: local-path-storage
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: local-path-provisioner-service-account
namespace: local-path-storage
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
name: macvlan-conf
namespace: default
spec:
config: '{
"cniVersion": "0.3.0",
"type": "macvlan",
"master": "eth0",
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
name: k3os-img
spec:
dataVolumeTemplates:
- metadata:
name: k3os-cdroom-disk
spec:
pvc: