{"id":394,"date":"2018-10-16T19:35:51","date_gmt":"2018-10-16T19:35:51","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw93\/?p=394"},"modified":"2018-10-17T09:13:52","modified_gmt":"2018-10-17T09:13:52","slug":"roundup-jetstackhqs-tuesday-twitter-tips-for-kubernetes","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw93\/index.php\/2018\/10\/16\/roundup-jetstackhqs-tuesday-twitter-tips-for-kubernetes\/","title":{"rendered":"Roundup &#8211; @JetstackHQ&#8217;s Tuesday Twitter Tips for Kubernetes \/"},"content":{"rendered":"<p>By <a target=\"\">Matt Bates<\/a><\/p>\n<p>Last year we were successful with a series of Kubernetes tips shared via <a href=\"https:\/\/twitter.com\/jetstackhq\"> Twitter <\/a>: it was called Tuesday Tips. Following a bit of a hiatus,<br \/>\nwe\u2019d like to bring it back. We\u2019re starting with a roundup of our previous tips (those that are still valid anyway!)<\/p>\n<p>This blog post compiles a summary of them, and ranks them according to popularity. Looking back it\u2019s amazing how much the project has changed, so we\u2019re exploring new features and running another series.<\/p>\n<p>First time around the top tip was:<\/p>\n<h3>#1 Software engineers love shell auto-completion because it saves time and keystrokes &#8211; this tweet shows how to enable it for the kubectl command.<\/h3>\n<blockquote><p>Add kubectl shell auto-completion for bash\/zsh in 1.3+ by sourcing kubectl completion . <a href=\"https:\/\/twitter.com\/hashtag\/tuesdaytip?src=hash&amp;ref_src=twsrc%5Etfw\">#tuesdaytip<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/k8s?src=hash&amp;ref_src=twsrc%5Etfw\">#k8s<\/a> <a href=\"https:\/\/t.co\/bb5s6J9NZN\">https:\/\/t.co\/bb5s6J9NZN<\/a><\/p>\n<p>\u2014 Jetstack (@JetstackHQ) <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/757912063440195584?ref_src=twsrc%5Etfw\">July 26, 2016<\/a><\/p><\/blockquote>\n<h3>#2 You don\u2019t have to do anything special to get your service distributed across nodes.<\/h3>\n<blockquote><p>Create a service prior to a RC\/RS and pods will spread across nodes. The default scheduler has service anti-affinity. <a href=\"https:\/\/twitter.com\/hashtag\/tuesdaytip?src=hash&amp;ref_src=twsrc%5Etfw\">#tuesdaytip<\/a><\/p>\n<p>\u2014 Jetstack (@JetstackHQ) <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/745247476991528964?ref_src=twsrc%5Etfw\">June 21, 2016<\/a><\/p><\/blockquote>\n<h3>#3 We showed you a new and easy way to spin up a Job.<\/h3>\n<blockquote><p>Use kubectl run with \u2018&#8211;restart=Never\u2019 and it\u2019ll spin up a Job (vs Deployment+RS with default restart policy of Always) <a href=\"https:\/\/twitter.com\/hashtag\/tuesdaytip?src=hash&amp;ref_src=twsrc%5Etfw\">#tuesdaytip<\/a><\/p>\n<p>\u2014 Jetstack (@JetstackHQ) <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/740185707617132544?ref_src=twsrc%5Etfw\">June 7, 2016<\/a><\/p><\/blockquote>\n<h3>#4 You need to be able to access certain types of pod using a predictable network identity &#8211; you can declare the DNS entry using PodSpec. This was a two-part tip &#8211; we gave you the annotations to achieve this in the previous version too.<\/h3>\n<blockquote><p>As of <a href=\"https:\/\/twitter.com\/hashtag\/k8s?src=hash&amp;ref_src=twsrc%5Etfw\">#k8s<\/a> v1.3, you can modify a pod&#8217;s hostname and subdomain via new field in the PodSpec: <a href=\"https:\/\/t.co\/Gw8br7Y1Dg\">https:\/\/t.co\/Gw8br7Y1Dg<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/tuesdaytip?src=hash&amp;ref_src=twsrc%5Etfw\">#tuesdaytip<\/a><\/p>\n<p>\u2014 Jetstack (@JetstackHQ) <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/752869271500386304?ref_src=twsrc%5Etfw\">July 12, 2016<\/a><\/p><\/blockquote>\n<blockquote><p>To achieve the same behaviour in 1.2 you can use the <a href=\"https:\/\/t.co\/TbFWey17Ha\">https:\/\/t.co\/TbFWey17Ha<\/a> + <a href=\"https:\/\/t.co\/V1zOJ2SA4S\">https:\/\/t.co\/V1zOJ2SA4S<\/a> annotations <a href=\"https:\/\/twitter.com\/hashtag\/tuesdaytip?src=hash&amp;ref_src=twsrc%5Etfw\">#tuesdaytip<\/a><\/p>\n<p>\u2014 Jetstack (@JetstackHQ) <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/752869436034605057?ref_src=twsrc%5Etfw\">July 12, 2016<\/a><\/p><\/blockquote>\n<h3>#5 A bash one-liner for copying resources from one namespace to another. This deserved to place higher.<\/h3>\n<blockquote><p>Use kubectl\u2019s standard streams to easily copy resources across namespaces <a href=\"https:\/\/twitter.com\/hashtag\/K8s?src=hash&amp;ref_src=twsrc%5Etfw\">#K8s<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/TuesdayTip?src=hash&amp;ref_src=twsrc%5Etfw\">#TuesdayTip<\/a> <a href=\"https:\/\/t.co\/zDZCPUjkeG\">https:\/\/t.co\/zDZCPUjkeG<\/a> <a href=\"https:\/\/t.co\/kKr3VRN4t2\">pic.twitter.com\/kKr3VRN4t2<\/a><\/p>\n<p>\u2014 Jetstack (@JetstackHQ) <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/760476397592842244?ref_src=twsrc%5Etfw\">August 2, 2016<\/a><\/p><\/blockquote>\n<h3>#6 DaemonSets run on all nodes &#8211; even those where scheduling is disabled for maintenance.<\/h3>\n<blockquote><p>Nodes that are marked with \u201cSchedulingDisabled\u201d will still run pods from DaemonSets <a href=\"https:\/\/twitter.com\/hashtag\/TuesdayTip?src=hash&amp;ref_src=twsrc%5Etfw\">#TuesdayTip<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/Kubernetes?src=hash&amp;ref_src=twsrc%5Etfw\">#Kubernetes<\/a><\/p>\n<p>\u2014 Jetstack (@JetstackHQ) <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/763003680039825408?ref_src=twsrc%5Etfw\">August 9, 2016<\/a><\/p><\/blockquote>\n<h3>#7 Add a record of what has been done to your resource annotation.<\/h3>\n<blockquote><p>kubectl has a &#8211;record flag to store create\/update commands as a resource annotation, useful for introspection <a href=\"https:\/\/twitter.com\/hashtag\/tuesdaytip?src=hash&amp;ref_src=twsrc%5Etfw\">#tuesdaytip<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/kubernetes?src=hash&amp;ref_src=twsrc%5Etfw\">#kubernetes<\/a><\/p>\n<p>\u2014 Jetstack (@JetstackHQ) <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/768121477996679169?ref_src=twsrc%5Etfw\">August 23, 2016<\/a><\/p><\/blockquote>\n<h3>#8 This is an important one &#8211; use kubectl drain to decommission nodes prior to maintenance (but see #6!).<\/h3>\n<blockquote><p>Use kubectl drain to decommission a <a href=\"https:\/\/twitter.com\/hashtag\/k8s?src=hash&amp;ref_src=twsrc%5Etfw\">#k8s<\/a> node prior to upgrade\/maintenance; cordons the node (unschedulable) + deletes all pods <a href=\"https:\/\/twitter.com\/hashtag\/tuesdaytip?src=hash&amp;ref_src=twsrc%5Etfw\">#tuesdaytip<\/a><\/p>\n<p>\u2014 Jetstack (@JetstackHQ) <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/742719681165971456?ref_src=twsrc%5Etfw\">June 14, 2016<\/a><\/p><\/blockquote>\n<h3>#9 A guest tweet and a valuable one.<\/h3>\n<blockquote><p>This week&#8217;s <a href=\"https:\/\/twitter.com\/hashtag\/Kubernetes?src=hash&amp;ref_src=twsrc%5Etfw\">#Kubernetes<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/TuesdayTip?src=hash&amp;ref_src=twsrc%5Etfw\">#TuesdayTip<\/a>, courtesy of <a href=\"https:\/\/twitter.com\/asynchio?ref_src=twsrc%5Etfw\">@asynchio<\/a>!! <a href=\"https:\/\/t.co\/jwnGItvf74\">https:\/\/t.co\/jwnGItvf74<\/a><\/p>\n<p>\u2014 Jetstack (@JetstackHQ) <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/765569789385383936?ref_src=twsrc%5Etfw\">August 16, 2016<\/a><\/p><\/blockquote>\n<h3>#10 Last, but certainly not least, as it\u2019s still really useful for keeping track of your infrastructure.<\/h3>\n<blockquote><p>Add your own custom labels to nodes using kubelet param &#8211;node-labels= Eg use a node-label for role (master\/worker) <a href=\"https:\/\/twitter.com\/hashtag\/tuesdaytip?src=hash&amp;ref_src=twsrc%5Etfw\">#tuesdaytip<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/kubernetes?src=hash&amp;ref_src=twsrc%5Etfw\">#kubernetes<\/a><\/p>\n<p>\u2014 Jetstack (@JetstackHQ) <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/750315973803212800?ref_src=twsrc%5Etfw\">July 5, 2016<\/a><\/p><\/blockquote>\n<p><a href=\"https:\/\/blog.jetstack.io\/blog\/kubernetes-tuesday-tips-roundup\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u2019d like to bring it back. We\u2019re starting with a roundup of our previous tips (those that are still valid anyway!) This blog post compiles a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw93\/index.php\/2018\/10\/16\/roundup-jetstackhqs-tuesday-twitter-tips-for-kubernetes\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Roundup &#8211; @JetstackHQ&#8217;s Tuesday Twitter Tips for Kubernetes \/&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-394","post","type-post","status-publish","format-standard","hentry","category-kubernetes"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/comments?post=394"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/394\/revisions"}],"predecessor-version":[{"id":540,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/394\/revisions\/540"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/media?parent=394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/categories?post=394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/tags?post=394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}