Please enable JavaScript.
Coggle requires JavaScript to display documents.
Kubernetes (Pod (Definition (declaration of a desired state, K8s ensures…
Pod
basic unit for Kubernetes operations, has unique IP in the cluster
consists of 1 or more containers, sharing the same port space, volumes, IP, IPC namespace
-
-
-
-
metadata.name is the default hostname of the Pod, can be overridden by .spec.hostname field
.spec.subdomain allow defining subdomain in the hostname
-
Container Probes
Handlers
ExecAction
execute a specified command inside the container, success if it exit with code 0
TCPSocketAction
do a TCP check against the container's IP and given port, success if port is open
HTTPGetAction
do a HTTP GET request against the container's IP address, port and path. success if 200 <= response code < 400
Types
livenessProbe
check whether the container is running, kill and restart if not.
readinessProbe
check whether container is ready to serve, if not, endpoints controller removes it from the service endpoints
-
handling service discovering, load balancing
-
-
Headless Service
no load-balancing or single service IP, allowing customised service discovery
-
with selector defined: endpoints controller creates Endpoints records and update DNS to return address pointing directly to Pods of the Service
without selector defined: no Endpoints created, but DNS looks for and configs CNAME records for ExternalName services
-
-
Deployment
automates the process of application version upgrade, with zero downtime
-
Definition file
-
strategy
type
defines how to perform update, e.g. RollingUpdate
-
Volumes
-
-
Volume Types
emptyDir
create a new directory that exists as long as the Pod is running on the node, can persist across container failures and restarts.
hostPath
mounts an existing dir on the node's file system, e.g. /var/logs
-
-
each Service is assigned a DNS name: <Service name>.<k8s namespace>
namespace can be omitted if search is within the same namespace
Service record types
A record
headless service got the same A record, but returning set of IPs of Pods selected by the Service
-
-