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
YAML
is 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
-
Dictionaries
are an unordered collection whilelists
are 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
apt
repo - install dependencies using
apt
- install dependencies using
pip
- copy source code into container directory
/app
,/src
,/opt
etc. - 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
Dockerfiles
must start withFROM
- pick an os. i.e.
-
build the image using the
docker build
command.docker build Dockerfile -t <image-name>
-t
- tag the image
-
view image
operating system
docker 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 install
helm install <application-name> <chart-name>
-
uninstall application using
helm uninstall
helm uninstall <application-name>
-
view application using
helm list
helm list
-
view application details using
helm status
helm status <application-name>
-
upgrade application using
helm upgrade
helm upgrade <application-name> <chart-name>
-
rollback application using
helm rollback
helm 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
đ ī¸
-
nano
config 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+K
Cut current line into cutbufferAlt+6
Copy current line into cutbufferCtrl+U
Paste contents of cutbufferAlt+T
Cut until end of bufferCtrl+]
Complete current wordAlt+3
Comment/uncomment line/regionAlt+U
Undo last actionAlt+E
Redo last undone action
- search and replace
Ctrl+Q
Start backward searchCtrl+W
Start forward searchAlt+Q
Find next occurrence backwardAlt+W
Find next occurrence forwardAlt+R
Start a replacing session
- deletion
Ctrl+H
Delete character before cursorCtrl+D
Delete character under cursorAlt+Bsp
Delete word to the leftCtrl+Del
Delete word to the rightAlt+Del
Delete current line
- moving around
Ctrl+B
One character backwardCtrl+F
One character forwardCtrl+â
One word backwardCtrl+â
One word forwardCtrl+A
To start of lineCtrl+E
To end of lineCtrl+P
One line upCtrl+N
One line downCtrl+â
To previous blockCtrl+â
To next blockCtrl+Y
One page upCtrl+V
One page downAlt+\
To top of bufferAlt+/
To end of buffer