Skip to content

Instantly share code, notes, and snippets.

View sebastien-prudhomme's full-sized avatar

Sébastien Prud'homme sebastien-prudhomme

  • Toulouse, France
View GitHub Profile
@sebastien-prudhomme
sebastien-prudhomme / mongo-express-oauth2-proxy.yaml
Created May 7, 2020 16:43
Application access control with OAuth2 Proxy deployed by Argo CD on Kubernetes
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: mongo-express-oauth2-proxy
namespace: argo-cd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
@sebastien-prudhomme
sebastien-prudhomme / backupconfiguration.yaml
Created April 27, 2020 15:26
Kubernetes volume snapshot-based backup with Stash and Argo
apiVersion: stash.appscode.com/v1beta1
kind: BackupConfiguration
metadata:
name: mongodb
spec:
schedule: "0 23 * * 0"
paused: true
driver: VolumeSnapshotter
target:
ref:
@sebastien-prudhomme
sebastien-prudhomme / src-app.hooks.js
Created April 20, 2020 18:25
Instrumenting FeathersJS with Prometheus
const prometheus = require('./hooks/prometheus')
module.exports = {
before: {
all: [prometheus()],
find: [],
get: [],
create: [],
update: [],
patch: [],
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
minikluster-1 - virtualbox Running tcp://192.168.99.100:2376 v17.03.2-ce
minikluster-2 - virtualbox Running tcp://192.168.99.101:2376 v17.03.2-ce
$ docker-machine ssh minikluster-2 sudo ros engine switch docker-17.03.2-ce
$ docker-machine create --driver virtualbox --virtualbox-boot2docker-url https://github.com/rancher/os/releases/download/v1.4.1/rancheros.iso --virtualbox-cpu-count 1 --virtualbox-disk-size 10000 --virtualbox-memory 2048 minikluster-2
$ rke up
INFO[0000] Building Kubernetes cluster
INFO[0000] [dialer] Setup tunnel for host [192.168.99.100]
INFO[0000] [dialer] Setup tunnel for host [192.168.99.101]
INFO[0000] [state] Found local kube config file, trying to get state from cluster
INFO[0000] [state] Fetching cluster state from Kubernetes
INFO[0000] [state] Successfully Fetched cluster state to Kubernetes ConfigMap: cluster-state
INFO[0000] [certificates] Getting Cluster certificates from Kubernetes
INFO[0000] [certificates] Successfully fetched Cluster certificates from Kubernetes
INFO[0000] [network] Deploying port listener containers
$ kubectl
kubectl controls the Kubernetes cluster manager.
Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/
Basic Commands (Beginner):
create Create a resource from a file or from stdin.
expose Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service
run Run a particular image on the cluster
set Set specific features on objects
nodes:
- address: 192.168.99.100
port: "22"
internal_address: ""
role:
- controlplane
- worker
- etcd
hostname_override: minikluster-1
user: docker
$ rke up
INFO[0000] Building Kubernetes cluster
INFO[0000] [dialer] Setup tunnel for host [192.168.99.100]
INFO[0000] [network] Deploying port listener containers
INFO[0000] [network] Pulling image [rancher/rke-tools:v0.1.13] on host [192.168.99.100]
INFO[0031] [network] Successfully pulled image [rancher/rke-tools:v0.1.13] on host [192.168.99.100]
INFO[0032] [network] Successfully started [rke-etcd-port-listener] container on host [192.168.99.100]
INFO[0033] [network] Successfully started [rke-cp-port-listener] container on host [192.168.99.100]
INFO[0033] [network] Successfully started [rke-worker-port-listener] container on host [192.168.99.100]
INFO[0033] [network] Port listener containers deployed successfully