All Projects → protess → k8scc

protess / k8scc

Licence: Unlicense license
# K8S Crash Course

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to k8scc

K8s Utils
Kubernetes Utility / Helper Scripts
Stars: ✭ 33 (+106.25%)
Mutual labels:  k8s, kubectl
Maratona Kubernetes
Repositório de código de demonstrações da Maratona Kubernetes 🇧🇷
Stars: ✭ 152 (+850%)
Mutual labels:  k8s, kubectl
Kube Aliases
Kubernetes Aliases and Bash Functions
Stars: ✭ 40 (+150%)
Mutual labels:  k8s, kubectl
Geodesic
🚀 Geodesic is a DevOps Linux Distro. We use it as a cloud automation shell. It's the fastest way to get up and running with a rock solid Open Source toolchain. ★ this repo! https://slack.cloudposse.com/
Stars: ✭ 629 (+3831.25%)
Mutual labels:  k8s, kubectl
k8s-deployer
Deploy Kubernetes service and store retrieved information in the Consul K/V store
Stars: ✭ 23 (+43.75%)
Mutual labels:  k8s, kubectl
Gcr.io mirror
all of the gcr.io docker image mirror
Stars: ✭ 650 (+3962.5%)
Mutual labels:  k8s, kubectl
K8sh
A simple, easily extensible shell for navigating your kubernetes clusters
Stars: ✭ 136 (+750%)
Mutual labels:  k8s, kubectl
kube-dump
Backup a Kubernetes cluster as a yaml manifest
Stars: ✭ 142 (+787.5%)
Mutual labels:  k8s, kubectl
kubeswitch
visually select kubernetes context/namespace from tree
Stars: ✭ 15 (-6.25%)
Mutual labels:  k8s, kubectl
Ansible Role Kubernetes
Ansible Role - Kubernetes
Stars: ✭ 247 (+1443.75%)
Mutual labels:  k8s, kubectl
Allok8
⚡️A pretty swell Kubernetes visualization tool
Stars: ✭ 281 (+1656.25%)
Mutual labels:  k8s, kubectl
kubectl-janitor
List Kubernetes objects in a problematic state
Stars: ✭ 48 (+200%)
Mutual labels:  k8s, kubectl
vcluster
vcluster - Create fully functional virtual Kubernetes clusters - Each vcluster runs inside a namespace of the underlying k8s cluster. It's cheaper than creating separate full-blown clusters and it offers better multi-tenancy and isolation than regular namespaces.
Stars: ✭ 1,360 (+8400%)
Mutual labels:  k8s, kubectl
Rakkess
Review Access - kubectl plugin to show an access matrix for k8s server resources
Stars: ✭ 751 (+4593.75%)
Mutual labels:  k8s, kubectl
kubectl-images
🕸 Show container images used in the cluster.
Stars: ✭ 153 (+856.25%)
Mutual labels:  k8s, kubectl
Libvirt K8s Provisioner
Automate your k8s installation
Stars: ✭ 106 (+562.5%)
Mutual labels:  k8s, kubectl
command-line-cheat-sheet
📝 A place to quickly lookup commands (bash, vim, git, AWS, Docker, Terraform, Ansible, kubectl)
Stars: ✭ 30 (+87.5%)
Mutual labels:  k8s, kubectl
Ketall
Like `kubectl get all`, but get really all resources
Stars: ✭ 233 (+1356.25%)
Mutual labels:  k8s, kubectl
kahoy
Simple Kubernetes raw manifests deployment tool
Stars: ✭ 33 (+106.25%)
Mutual labels:  k8s, kubectl
kube-lineage
A CLI tool to display all dependencies or dependents of an object in a Kubernetes cluster.
Stars: ✭ 238 (+1387.5%)
Mutual labels:  k8s, kubectl

Kubernetes Crash Course

Kubernetes Crash Course Blog Post(KR) - no link yet

Prerequisite

Requirement: Mac model 2010+, OS 10.12+

Docker

Install docker for mac.
Follow docker guide to increase resource limit(need to set memory to 8GB+).

Go

Install Go download from golang.org
You can manage Go verions with gvm

Kubectl

### Install with Homebrew on macOS
brew install kubernetes-cli

### download kubectl 1.16.0
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/darwin/amd64/kubectl

chmod -x ./kubectl

mv ./kubectl /usr/local/bin/kubectl

### if kubectl isn't executable
chmod 755 /usr/local/bin/kubectl

KIND

Refer to KIND for more details

GO111MODULE="on" go get sigs.k8s.io/[email protected]

export PATH="$PATH:$(go env GOPATH)/bin"

Aliases

alias k='kubectl'

alias chrome="/Applications/Google\\ \\Chrome.app/Contents/MacOS/Google\\ \\Chrome"

Useful Tools

kubectl command shell auto-completion

### for oh-my-zsh
plugins=(... kubectl)
  • k8s context/namespace changer kubectx/kubens
  • Awesome k8s shell prompt kube ps1
  • Very cool k8s CLI manage tool k9s
  • Multiple pods log tool for k8s stern

Practice

Create k8s multi-node cluster with KIND

Will create 1 master and 2 worker nodes.

kind create cluster --name kind-m --config kind-test-config.yaml

Change k8s config

Add configs from '.kube/kind-config-kind-m' to '.kube/config' file or:

export KUBECONFIG="$(kind get kubeconfig-path --name="kind-m")"

Note: k8s config file may contain multiple configs.

Verify k8s cluster

kubectl cluster-info
kubectl get nodes
kubectl get pods --all-namespaces

Install metrics-server

Refer to metrics-server for more information

kubectl apply -f ./metrics-server

Install Ingress-nginx

Installation Guide

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml

### create service with nodeport 32080, 32433
kubectl apply -f ./ingress-nginx/

Deploy MariaDB(MySQL) for Wordpress - Stateful Sets

Deploy MariaDB:

kubectl create namespace wordpress
kubectl apply -f ./mysql

### Check Stateful Sets
kubectl get sts -n wordpress
kubectl describe sts mysql -n wordpress

Deploy Wordpress - Deployment

Deploy Wordpress:

### get you local ip
IP=$(ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}')

### replace ingress host with your IP
sed -i.bak "s/host.*/host: blog."$IP".nip.io/g" ./wordpress/ingress.yaml

kubectl apply -f ./wordpress

### edit deployment
kubectl edit deploy wordpress

### port forward to check if wordpress is running correctly
WPOD=$(kubectl get -n wordpress pod -l app=wordpress -o jsonpath="{.items[0].metadata.name}")

kubectl port-forward pod/$WPOD 8090:80 -n wordpress

Scale in/out Deployments:

kubectl scale deploy wordpress --replicas=3 -n wordpress
kubectl scale deploy wordpress --replicas=1 -n wordpress

### check services for wordpress
kubectl get svc -n wordpress

### check ingress
kubectl get ingress -n wordpress

### other commands
k explain deployment --recursive
k explain svc --recursive
k get pods -o wide --sort-by="{.spec.nodeName}"

Expose Ingress

Intall socat to expose nodeport on local 80 port:

docker run -d --name kind-proxy-80 \
--publish 80:80 \
--link kind-m-control-plane:target \
alpine/socat \
tcp-listen:80,fork,reuseaddr tcp-connect:target:32080

Test

Test with your own DNS:

chrome http://blog.$IP.nip.io

Delete resources and cluster

kubectl --namespace=wordpress delete --all
kubectl delete --namespace wordpress

kind delete cluster --name kind-m

### remove socat
docker rm -f kind-proxy-80

Extra

Web UI(Dashboard)

Install dashboard:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta4/aio/deploy/recommended.yaml

### Run below to fix auth
k apply -f ./dashboard

### Run below and copy hash code from token:  
./dashboard/getsecret.sh

### Run below from another terminal:
k proxy

Click this link to open dashboard in your web browser.

To disable session time-out:

kubectl edit deployment kubernetes-dashboard -n kube-system

### add following after arg:
- args:
  - --token-ttl=0

Autoscaler

### metrics-server must be running
kubectl apply -f ./extra

Demo - ASCIINEMA

asciicast

Debug

Refer to K8S Debug Services for details

# Run alpine image to troubleshoot
kubectl run -it --rm --restart=Never alpine --image=alpine sh

# lookup service
nslookup wordpress

# check svc name/IP
wget -SO- wordpress:8081
wget -SO- <SVC_IP>:8081

# check pod endpoint
wget -SO- <POD ID:80>

Blogs and Documentations

subicura님의 쿠버네티스 시작하기 블로그

Kubernetes Documentation(KR)

K8S Deep Dive: API Server Part1, Part2, Part3

Google Container(KR)

이어형님 딥다이브

Dockerfile Best Practices

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].