Giter VIP home page Giter VIP logo

k8s-training's Introduction

Rancher Kubernetes Training

Necessary tools

  • terraform
  • envsubst
  • k3sup
  • kubectl
  • helm

Setup infrastructure

cd 00-infrastructure
terraform apply
./print_install_commands.sh

Run k3sup commands and export Kubeconfig

cd ..

Create first pod

kubectl apply -f 01-pod/
  • Describe a pod
  • Show logs of a pod

Create first deployment

kubectl apply -f 02-deployment/

Follow rollout

kubectl rollout status deployment rancher-demo
kubectl get pods --all-namespaces -o wide

Access application

kubectl run curl --image=radial/busyboxplus:curl -i --tty --rm
curl http://POD_IP

Create service

kubectl apply -f 03-service/
kubectl get services
kubectl describe service rancher-demo

Access application

kubectl run curl --image=radial/busyboxplus:curl -i --tty --rm
curl http://rancher-demo

Create ingress

Update IP in ingress.yaml (kubectl get nodes -o wide)

kubectl apply -f 04-ingress/
kubectl get ingress

Go to ingress

Update deployment

kubectl apply -f 05-deployment-update/
watch kubectl get pods

Configure resources and health checks

Show current resources

kubectl top pods
kubectl apply -f 06-deployment-advanced-features/
watch kubectl get pods

Describe not ready pod

Fix health check

kubectl apply -f 06-deployment-advanced-features/
watch kubectl get pods

Add configmap

kubectl apply -f 07-configmap/
watch kubectl get pods

Install Rancher

helm repo add jetstack https://charts.jetstack.io
helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
cd 08-rancher
./print_install_commands.sh

Install Rancher

cd ..

Use Rancher

  • Creating additional clusters
  • Authentication & RBAC
  • Cluster Explorer
  • Apps & Marketplace

Monitoring & Logging

Install Rancher Monitoring

Optional:

Install Rancher Logging Install Loki

helm repo add loki https://grafana.github.io/loki/charts
helm upgrade --install loki loki/loki --namespace loki --create-namespace

Configure logging flow and grafana datasource

kubectl apply -f 09-monitoring-logging
kubectl rollout restart deployment -n cattle-monitoring-system rancher-monitoring-grafana

Go to grafana, login with admin/prom-operator, go to explorer, show logs {namespace="default"}.

Cleanup

cd 00-infrastructure
terraform destroy
cd ..

k8s-training's People

Contributors

bashofmann avatar david-vtuk avatar

Stargazers

Vitalie Procopan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.