Skip to content

Instantly share code, notes, and snippets.

View kelvinji2009's full-sized avatar
🏠
Working from home

kelvinji2009 kelvinji2009

🏠
Working from home
View GitHub Profile
@kelvinji2009
kelvinji2009 / wildcard-ssl-certificate.md
Created August 30, 2018 08:37 — forked from talyguryn/wildcard-ssl-certificate.md
How to get a wildcard ssl certificate and set up Nginx.

Request a new certificate

Get certbot

Go to any directory and clone repo with sources.

cd ~
git clone https://github.com/certbot/certbot
@kelvinji2009
kelvinji2009 / sync-projects
Created August 21, 2018 14:56 — forked from JonasGroeger/sync-projects
Gitlab: Clone / Pull all projects in a group
#!/usr/bin/env bash
# Documentation
# https://docs.gitlab.com/ce/api/projects.html#list-projects
NAMESPACE="YOUR_NAMESPACE"
BASE_PATH="https://gitlab.example.com/"
PROJECT_SEARCH_PARAM=""
PROJECT_SELECTION="select(.namespace.name == \"$NAMESPACE\")"
PROJECT_PROJECTION="{ "path": .path, "git": .ssh_url_to_repo }"
@kelvinji2009
kelvinji2009 / vagrant_host.md
Created June 15, 2018 05:30 — forked from lsloan/vagrant_host.md
Vagrant: host IP address from guest perspective

Unless specified otherwise in Vagrantfile, the IP address of the host (the computer running Vagrant) from the perspective of the guest (the VM being run by Vagrant) is: 10.0.2.2

If that IP address doesn't work, then examination of Vagrantfile should reveal directives that changed it from its default value.

If an IP address can't be found in Vagrantfile, then the following command will probably reveal it:

route -A inet

On master and nodes

Pull images form internet access laptop

docker pull gcr.io/google_containers/kube-apiserver-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-controller-manager-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-proxy-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-scheduler-amd64:v1.5.0
docker pull weaveworks/weave-npc:1.8.2
docker pull weaveworks/weave-kube:1.8.2

01 - Deploy a Kubernetes cluster and Microservices Application

Deploy a Kubernetes cluster on Digital Ocean

Deploy the Socks Shop Microservices Application

Wednesday 26/07/2017

tl;dr - Kubernetes is a container orchestration engine.

tl;dr - Microservices are software components that are independently deployable and scalable.

Kubeadm Documentation : https://kubernetes.io/docs/getting-started-guides/kubeadm/

02 - Introduction to Ingress Resources in Kubernetes

Deploying an Ingress Controller for exposing HTTP services

Expose the Kubernetes Dashbaord via Ingress

Wednesday 26/07/2017

tl;dr - An Ingress is a collection of rules that allow inbound connections to reach the cluster services.

tl;dr - The ingress-controller is just a reverse proxy that forwards incoming requests based on the URL and host header (if used).

@kelvinji2009
kelvinji2009 / pki-setup.sh
Created March 23, 2018 08:59 — forked from chrishoffman/pki-setup.sh
Vault Multi-Level CA Setup
vault mount pki
vault mount -path=pki1 pki
vault mount -path=pki2 pki
vault mount -path=pki3 pki
vault mount-tune -max-lease-ttl=87600h pki
vault mount-tune -max-lease-ttl=87600h pki1
vault mount-tune -max-lease-ttl=87600h pki2
vault mount-tune -max-lease-ttl=87600h pki3
vault write pki/root/generate/internal common_name="Vault Testing Root Authority" ttl=87600h
#!/bin/bash -e
# Setup a Root CA in vault
# Generate and sign an Intermediate cert
#
# Requires:
# * A running vault server already initialzed and unsealed
# * Environment variable VAULT_TOKEN is set
# * vault cli (https://www.vaultproject.io)
# * httpie (https://github.com/jkbrzt/httpie)