Roundup – @JetstackHQ’s Tuesday Twitter Tips for Kubernetes /

By Matt Bates

Last year we were successful with a series of Kubernetes tips shared via Twitter : it was called Tuesday Tips. Following a bit of a hiatus,
we’d like to bring it back. We’re starting with a roundup of our previous tips (those that are still valid anyway!)

This blog post compiles a summary of them, and ranks them according to popularity. Looking back it’s amazing how much the project has changed, so we’re exploring new features and running another series.

First time around the top tip was:

#1 Software engineers love shell auto-completion because it saves time and keystrokes – this tweet shows how to enable it for the kubectl command.

Add kubectl shell auto-completion for bash/zsh in 1.3+ by sourcing kubectl completion . #tuesdaytip #k8s https://t.co/bb5s6J9NZN

— Jetstack (@JetstackHQ) July 26, 2016

#2 You don’t have to do anything special to get your service distributed across nodes.

Create a service prior to a RC/RS and pods will spread across nodes. The default scheduler has service anti-affinity. #tuesdaytip

— Jetstack (@JetstackHQ) June 21, 2016

#3 We showed you a new and easy way to spin up a Job.

Use kubectl run with ‘–restart=Never’ and it’ll spin up a Job (vs Deployment+RS with default restart policy of Always) #tuesdaytip

— Jetstack (@JetstackHQ) June 7, 2016

#4 You need to be able to access certain types of pod using a predictable network identity – you can declare the DNS entry using PodSpec. This was a two-part tip – we gave you the annotations to achieve this in the previous version too.

As of #k8s v1.3, you can modify a pod’s hostname and subdomain via new field in the PodSpec: https://t.co/Gw8br7Y1Dg #tuesdaytip

— Jetstack (@JetstackHQ) July 12, 2016

To achieve the same behaviour in 1.2 you can use the https://t.co/TbFWey17Ha + https://t.co/V1zOJ2SA4S annotations #tuesdaytip

— Jetstack (@JetstackHQ) July 12, 2016

#5 A bash one-liner for copying resources from one namespace to another. This deserved to place higher.

Use kubectl’s standard streams to easily copy resources across namespaces #K8s #TuesdayTip https://t.co/zDZCPUjkeG pic.twitter.com/kKr3VRN4t2

— Jetstack (@JetstackHQ) August 2, 2016

#6 DaemonSets run on all nodes – even those where scheduling is disabled for maintenance.

Nodes that are marked with “SchedulingDisabled” will still run pods from DaemonSets #TuesdayTip #Kubernetes

— Jetstack (@JetstackHQ) August 9, 2016

#7 Add a record of what has been done to your resource annotation.

kubectl has a –record flag to store create/update commands as a resource annotation, useful for introspection #tuesdaytip #kubernetes

— Jetstack (@JetstackHQ) August 23, 2016

#8 This is an important one – use kubectl drain to decommission nodes prior to maintenance (but see #6!).

Use kubectl drain to decommission a #k8s node prior to upgrade/maintenance; cordons the node (unschedulable) + deletes all pods #tuesdaytip

— Jetstack (@JetstackHQ) June 14, 2016

#9 A guest tweet and a valuable one.

This week’s #Kubernetes #TuesdayTip, courtesy of @asynchio!! https://t.co/jwnGItvf74

— Jetstack (@JetstackHQ) August 16, 2016

#10 Last, but certainly not least, as it’s still really useful for keeping track of your infrastructure.

Add your own custom labels to nodes using kubelet param –node-labels= Eg use a node-label for role (master/worker) #tuesdaytip #kubernetes

— Jetstack (@JetstackHQ) July 5, 2016

Source

Leave a Reply

Your email address will not be published. Required fields are marked *