- Kubernetes Concepts
- Hands on: Using kubeadm to stand up a Kubernetes cluster
- Hands on: Using kubectl to make changes to running Kubernetes cluster
11. Recap: all you need to know
Pods
containers
Container
Image
Docker container image, contains your application code in an isolated
environment.
Pod A set of containers, sharing network namespace and local volumes,
co-scheduled on one machine. Mortal. Has pod IP. Has labels.
23. Recap: all you need to know
Pods
containers
Deployments
Container
Image
Docker container image, contains your application code in an isolated
environment.
Pod A set of containers, sharing network namespace and local volumes,
co-scheduled on one machine. Mortal. Has pod IP. Has labels.
Deployment Specify how many replicas of a pod should run in a cluster. Then
ensures that many are running across the cluster.
31. kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 2
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
kind: Service
metadata:
name: frontend
spec:
type: NodePort
selector:
app: nginx
ports:
- port: 80
targetPort: 80
nodePort: 30002
Using selectors
How do services connect to deployments?
matches
32. kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 2
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
kind: Service
metadata:
name: frontend
spec:
type: NodePort
selector:
app: nginx
ports:
- port: 80
targetPort: 80
nodePort: 30002
How do you expose services to outside?
Using NodePort
33. Recap: all you need to know
Pods
containers
ServicesDeployments
Container
Image
Docker container image, contains your application code in an isolated
environment.
Pod A set of containers, sharing network namespace and local volumes,
co-scheduled on one machine. Mortal. Has pod IP. Has labels.
Deployment Specify how many replicas of a pod should run in a cluster. Then
ensures that many are running across the cluster. Has labels.
Service Names things in DNS. Gets virtual IP. Two types: ClusterIP for internal
services, NodePort for publishing to outside. Routes based on labels.
36. API server
Architecture of Kubernetes itself
Node 1 Node 2
Master
API server etcd
kubeadm init
kubeadm join
kubelet
37. API server
Architecture of Kubernetes itself
Node 1 Node 2
Master
API server etcd
kubeadm init
kubeadm join kubeadm join
kubelet kubelet
38. API server
Architecture of Kubernetes itself
Node 1 Node 2
Master
API server etcd
kubeadm init
kubeadm join kubeadm join
kubelet kubelet
kubectl apply
39. API server
Architecture of Kubernetes itself
Node 1 Node 2
Master
containers
Services
containers
API server etcd
kubeadm init
kubeadm join kubeadm join
kubectl apply
kubelet kubelet
41. Join the Weave user group!
meetup.com/pro/Weave/
weave.works/help
42. What’s next?
• Continuous delivery: hooking up my CI/CD
pipeline to Kubernetes
• How do I monitor this stuff?
• Network policy for security
Come to our Weave Cloud training to find out!
43. Thanks! Questions?
We are hiring!
DX in San Francisco
Engineers in London & SF
weave.works/weave-company/hiring