02-Kubernetes Setup
02-Kubernetes Setup
Kubernetes setups
• https://github.com/kubernetes/minikube
Minikube setups
• We chose to version at the API level rather than at the resource or field level to
ensure that the API presents a clear, consistent view of system resources and
behavior, and to enable controlling access to end-of-lifed and/or experimental
APIs.
API Versioning
Different API versions imply different levels of stability and support.
Alpha level
• The version names contain alpha (e.g. v1alpha1).
• May be buggy. Enabling the feature may expose bugs. Disabled by default.
• Support for feature may be dropped at any time without notice.
Beta level
The version names contain beta (e.g. v2beta3).
Code is well tested. Enabling the feature is considered safe. Enabled by default.
Support for the overall feature will not be dropped, though details may change.
API Versioning
Stable level
• The version name is vX where X is an integer.
• Stable versions of features will appear in released software for many subsequent
versions.
API Groups
To make it easier to extend the Kubernetes API, API groups implemented
• The API group is specified in a REST path and in the apiVersion field of a
serialized object.
Currently there are several API groups in use:
• The core group, often referred to as the legacy group, is at the REST path /api/v1
and uses apiVersion: v1.
• The named groups are at REST path /apis/$GROUP_NAME/$VERSION, and
use apiVersion: $GROUP_NAME/$VERSION (e.g. apiVersion: batch/v1). Full
list of supported API groups can be seen in Kubernetes API reference.
Enabling API groups
We can be enabled or disabled by setting --runtime-config on apiserver. --runtime-
config accepts comma separated values.
Example
• To disable batch/v1, set --runtime-config=batch/v1=false
• To enable batch/v2alpha1, set --runtime-config=batch/v2alpha1
Running First app
First app
• Let’s run our newly built application on the new Kubernetes
cluster
• Before we can launch a container based on the image, we need
to create a pod definition
• A pod describe an application running on kubernetes
• A pod can contain one or more tightly coupled containers, that
make up app
• Those apps can easily communicate with each other using their local port
numbers
• Our app only has one container
Create a pod
• Create a file pod-helloworld.yml with pod definition: