Kubernetes, often abbreviated as K8s, is an open-source container orchestration platform designed to automate the deployment, scaling, and management of containerized applications. It was originally developed by Google and is now maintained by the Cloud Native Computing Foundation (CNCF).
Kubernetes follows a client-server architecture. The master node manages the cluster, while worker nodes run the application workloads.
The smallest deployable units of computing that you can create and manage in Kubernetes. A pod can contain one or more containers.
Worker machines in Kubernetes, which can be physical or virtual. Each node runs at least a container runtime, kubelet, and kube-proxy.
A way to divide cluster resources between multiple users.
Deployments provide declarative updates for Pods and ReplicaSets. You describe the desired state in a Deployment object, and the Kubernetes control plane changes the actual state to the desired state at a controlled rate.
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
A Service in Kubernetes is an abstraction which defines a logical set of Pods and a policy by which to access them.
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app: MyApp
ports:
- protocol: TCP
port: 80
targetPort: 9376
ConfigMaps are used to store non-confidential data in key-value pairs.
apiVersion: v1
kind: ConfigMap
metadata:
name: my-config
data:
key1: value1
key2: value2
Secrets are used to store sensitive information, such as passwords, OAuth tokens, and ssh keys.
apiVersion: v1
kind: Secret
metadata:
name: my-secret
type: Opaque
data:
username: YWRtaW4=
password: MWYyZDFlMmU2N2Rm
Kubernetes supports various types of storage, including local volumes, network file systems, and cloud provider-specific storage solutions.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
Kubernetes provides a variety of networking solutions, including:
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: LoadBalancer
selector:
app: MyApp
ports:
- protocol: TCP
port: 80
targetPort: 9376
Kubernetes provides several security features, including:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: default
name: pod-reader
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "watch", "list"]
Kubernetes integrates with various monitoring and logging tools, such as:
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: my-image
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
This wiki should provide a comprehensive overview of Kubernetes. If you have any specific questions or need further details, feel free to ask!