Kubernetes Production Readiness and Best Practices Checklist
Kubernetes Production Readiness and Best Practices Checklist
Production
Readiness and
Best Practices
Checklist
Kubernetes Production Readiness and Best Practices Checklist
Availability
Configured liveness and readiness probes?
replex.io 2
Kubernetes Production Readiness and Best Practices Checklist
replex.io 3
Kubernetes Production Readiness and Best Practices Checklist
replex.io 4
Kubernetes Production Readiness and Best Practices Checklist
Once multiple master replica nodes have been deployed, the next
obvious step is to load balance traffic to and from those
replicas. You can do this by creating an L4 load balancer in front
of all apiserver instances and updating the DNS name
appropriately or use the round-robin DNS technique to access all
apiserver directly. Check this document for more information.
replex.io 5
Kubernetes Production Readiness and Best Practices Checklist
replex.io 6
Kubernetes Production Readiness and Best Practices Checklist
replex.io 7
Kubernetes Production Readiness and Best Practices Checklist
Setup Ingress?
Ingress allows HTTP and HTTPS traffic from the outside internet
to services inside the cluster. Ingress can also be used for load
balancing, terminating SSL and to give services externally-
reachable URLs.
replex.io 8
Kubernetes Production Readiness and Best Practices Checklist
Resource Management
Resource requests and limits can be set for CPU, memory and
ephemeral storage resources. Setting resource requests and
limits is a Kubernetes best practice and will help avoid
containers getting throttled due to lack of resources or going
berserk and hogging resources.
replex.io 9
Kubernetes Production Readiness and Best Practices Checklist
Here is how you can check whether requests and limits have
been defined for local ephemeral storage for all containers:
You can also display a list of all the pods running inside a
namespace with kubectl get pods --all-namespaces
replex.io 10
Kubernetes Production Readiness and Best Practices Checklist
replex.io 11
Kubernetes Production Readiness and Best Practices Checklist
replex.io 12
Kubernetes Production Readiness and Best Practices Checklist
Pod quotas allow you to restrict the total number of pods that
can run inside a namespace. API quotas let you set limits for
other API objects like PersistentVolumeClaims, Services and
ReplicaSets.
Pod and API quotas are a good way to manage resource usage
on a namespace level.
replex.io 13
Kubernetes Production Readiness and Best Practices Checklist
replex.io 14
Kubernetes Production Readiness and Best Practices Checklist
You can also control the number of pods that can be scheduled
on a node using the --max-pods flag in Kubelet.
replex.io 15
Kubernetes Production Readiness and Best Practices Checklist
replex.io 16
Kubernetes Production Readiness and Best Practices Checklist
nodefs.available<10%
nodefs.inodesFree<5%
imagefs.available<15%
imagefs.inodesFree<20%
Doing this will ensure that unused images and dead containers
and pods do not take up unnecessary disk space.
replex.io 17
Kubernetes Production Readiness and Best Practices Checklist
replex.io 18
Kubernetes Production Readiness and Best Practices Checklist
replex.io 19
Kubernetes Production Readiness and Best Practices Checklist
Security
replex.io 20
Kubernetes Production Readiness and Best Practices Checklist
You can define rules about which events to record and what data
to log in an audit policy. Here is a minimal audit policy which will
log all metadata related to requests
You can implement logging at Request level which will log both
metadata and request body as well as RequestResponse level
which will log response body in addition to request metadata
and request body.
replex.io 21
Kubernetes Production Readiness and Best Practices Checklist
kube-apiserver --enable-admission-plugins=AlwaysPullImage
replex.io 22
Kubernetes Production Readiness and Best Practices Checklist
You can then enable the security policy using the flag
--enable-admission-plugins=PodSecurityPolicy
This policy forces all users to run as unprivileged users and also
disables privilege escalation as well as enabling other restrictive
security policies.
replex.io 23
Kubernetes Production Readiness and Best Practices Checklist
replex.io 24
Kubernetes Production Readiness and Best Practices Checklist
replex.io 25
Kubernetes Production Readiness and Best Practices Checklist
You can do this using open source tools like Anchore and Clair
which will help you identify common vulnerabilities and
exposures (CVEs) and mitigate them.
replex.io 26
Kubernetes Production Readiness and Best Practices Checklist
replex.io 27
Kubernetes Production Readiness and Best Practices Checklist
Scalability
replex.io 28
Kubernetes Production Readiness and Best Practices Checklist
The VPA can change resource limits and requests and can do
this for new pods as well as existing pods.
replex.io 29
Kubernetes Production Readiness and Best Practices Checklist
Monitoring
replex.io 30
Kubernetes Production Readiness and Best Practices Checklist
Bonus
go get -u k8s.io/test-infra/kubetest
replex.io 31
Kubernetes Production Readiness and Best Practices Checklist
AUTHOR
Hasham Haider
Fan of all things cloud, containers and micro-services!
replex.io 32
Kubernetes Production Readiness and Best Practices Checklist
Get in touch
replex.io | [email protected]
*The information provided within this eBook is for general informational purposes only. While we try to keep the
information up-to-date and correct, there are no representations or warranties, express or implied, about the
completeness, accuracy, reliability, suitability or availability with respect to the information, products, services, or
related graphics contained in this eBook for any purpose. Any use of this information is at your own risk.
replex.io 33