Kubernetes - Section 0: Resources đī¸
Description đ
Resources for the Kubernetes Zero to Pro Guide. Has images, pdfs, and links to other resources.
đ pdfs
- đ kubernetes up and running
đ links
minikube install- đ certified kubernetes application developer test
- đĒ exercises for CKAD
- đđģââī¸ study materials for CKAD
- đ¤ kubernetes concepts
- đ candidate handbook
- đĄ exam tips
Helpful Content đ
This is a collection of helpful content for the Kubernetes Zero to Pro Guide. It is not a part of Kubernetes, but it is helpful for learning Kubernetes.
YAML 
YAML is a human-readable data serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML is stored in key value pairs and can be used to serialize data structures such as maps, sequences, and scalars.
YAML Syntax
YAMLis case sensitive- Comments are created using the # symbol
Examples đ§Š
-
key value pairs
Fruit: Apple Vegetable: Carrot Liquid: Water Meat: Chicken -
arrays / lists
Fruits: - Orange - Apple - Banana Vegetables: - Carrot - Cauliflower - Tomato -
dictionary / map
Banana: Calories: 105 Fat: 0.4g Carbs: 27g Grapes: Calories: 62 Fat: 0.3g Carbs: 16g -
key value / dictionary / lists
Fruits: - Banana: Calories: 105 Fat: 0.4g Carbs: 27g - Grapes: Calories: 62 Fat: 0.3g Carbs: 16g
Notice the alignment, this is important in yaml.
-
You can either set a value or a list/dictionary/map but not both
-
Dictionariesare an unordered collection whilelistsare ordered
Docker đŗ
Docker is a containerization platform that allows you to package and run an application in a loosely isolated environment called a container. Docker is a client-server application with the Docker daemon running on the host and the Docker client from the command line or from a program.
How To Create Your Own Image?
-
Dockerfile- a text document that contains all the commands a user could call on the command line to assemble an imageVery Basic Outline:
- pick an os. i.e.
ubuntu - update
aptrepo - install dependencies using
apt - install dependencies using
pip - copy source code into container directory
/app,/src,/optetc. - run the web server, or application
# sample Dockerfile for steps outlined above FROM Ubuntu RUN apt-get update RUN apt-get install python RUN pip install flask RUN pip install flask-mysql COPY . /opt/source-code ENTRYPOINT FLASK_APP=/opt/source-code/app.py flask run- all
Dockerfilesmust start withFROM
- pick an os. i.e.
-
build the image using the
docker buildcommand.docker build Dockerfile -t <image-name>-t- tag the image
-
view image
operating systemdocker image inspect <image-name>or
docker run <image-name> cat /etc/os-release
Helm 
Kubernetes does not care about you application as a whole, it cares about the individual components. Helm is a package manager for Kubernetes that allows you to package up your application as a whole and deploy it to Kubernetes.
Basic Commands đ
-
install application using
helm installhelm install <application-name> <chart-name> -
uninstall application using
helm uninstallhelm uninstall <application-name> -
view application using
helm listhelm list -
view application details using
helm statushelm status <application-name> -
upgrade application using
helm upgradehelm upgrade <application-name> <chart-name> -
rollback application using
helm rollbackhelm rollback <application-name> <revision-number>
Nano đ
Nano is a text editor that is installed by default on most Linux distributions. It is a simple text editor that is easy to use and has a lot of features. During the CKAD exam, you will be asked to edit a file using Nano or Vim.
- đ nano documentation
Initial Setup đ ī¸
-
nanoconfig file, ~/.nanorcset tabsize 2 set tabstospaces-
tabsize- sets the number of spaces that a tab will be replaced with -
tabstospaces- replaces tabs with spaces -
if ~/.nanorc does not exist, create it
touch ~/.nanorc
-
Keyboard Shortcuts â¨ī¸
- editing
Ctrl+KCut current line into cutbufferAlt+6Copy current line into cutbufferCtrl+UPaste contents of cutbufferAlt+TCut until end of bufferCtrl+]Complete current wordAlt+3Comment/uncomment line/regionAlt+UUndo last actionAlt+ERedo last undone action
- search and replace
Ctrl+QStart backward searchCtrl+WStart forward searchAlt+QFind next occurrence backwardAlt+WFind next occurrence forwardAlt+RStart a replacing session
- deletion
Ctrl+HDelete character before cursorCtrl+DDelete character under cursorAlt+BspDelete word to the leftCtrl+DelDelete word to the rightAlt+DelDelete current line
- moving around
Ctrl+BOne character backwardCtrl+FOne character forwardCtrl+âOne word backwardCtrl+âOne word forwardCtrl+ATo start of lineCtrl+ETo end of lineCtrl+POne line upCtrl+NOne line downCtrl+âTo previous blockCtrl+âTo next blockCtrl+YOne page upCtrl+VOne page downAlt+\To top of bufferAlt+/To end of buffer