{"id":377,"date":"2018-10-16T14:26:44","date_gmt":"2018-10-16T14:26:44","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw93\/?p=377"},"modified":"2018-10-17T08:56:06","modified_gmt":"2018-10-17T08:56:06","slug":"whats-new-in-navigator-jetstack-blog","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw93\/index.php\/2018\/10\/16\/whats-new-in-navigator-jetstack-blog\/","title":{"rendered":"What&#8217;s New in Navigator? &#8211; Jetstack Blog"},"content":{"rendered":"<p>18\/Jan 2018<\/p>\n<p>By <a target=\"\">Richard Wall<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/jetstack\/navigator\">Navigator<\/a> is a Kubernetes extension for managing distributed databases.<br \/>\nIn this post we\u2019ll tell you about all the improvements we\u2019ve made since we <a href=\"..\/introducing-navigator\">unveiled it last year<\/a>, including:<br \/>\nexperimental support for Apache Cassandra clusters,<br \/>\nimproved support for Elasticsearch clusters,<br \/>\nand a Helm chart for easy installation!<br \/>\nWe\u2019ll also give you an overview of the Navigator roadmap for 2018.<\/p>\n<p>The <a href=\"https:\/\/cassandra.apache.org\/\">Apache Cassandra database<\/a> is a leading NoSQL database designed for scalability and high availability without compromising performance.<br \/>\nIt\u2019s an ideal candidate for running on a scalable, highly available, distributed platform such as Kubernetes.<br \/>\nFor that reason it was the <a href=\"http:\/\/blog.kubernetes.io\/2016\/07\/thousand-instances-of-cassandra-using-kubernetes-pet-set.html\">database chosen to showcase the potential of Kubernetes StatefulSets<\/a> (or PetSet as it was known initially).<br \/>\nSince then a <a href=\"https:\/\/kubernetes.io\/docs\/tutorials\/stateful-application\/cassandra\/\">Cassandra example<\/a> has been added to the official Kubernetes documentation but it is only an example; it is not sufficient if you want to run a Cassandra cluster on Kubernetes <em>in production<\/em>.<\/p>\n<p>Enter Navigator!<br \/>\nNavigator now has experimental support the Apache Cassandra database.<br \/>\nNavigator codifies and automates many of the processes that would previously have been performed by a database administrator or SRE (Site Reliability Engineer) (<a href=\"https:\/\/coreos.com\/blog\/introducing-operators.html\">the operator<\/a>).<br \/>\nFor example it will bootstrap a Cassandra cluster and create a load balancer for distributing CQL connections to all the cluster nodes.<br \/>\nIt performs regular node health checks which means that if a node becomes unresponsive, that node will be automatically bypassed by the loadbalancer and eventually the node will be restarted.<br \/>\nNavigator can also scale up your Cassandra cluster, and it\u2019s as simple as using Helm to increment the replicas field on the CassandraCluster API resource.<br \/>\nSee the demo below.<\/p>\n<p>This is what\u2019s currently possible and our goal is to make it simple enough that any developer can request a secure, highly available, scalable Cassandra database and Navigator will take care of the rest, ensuring that:<\/p>\n<ul>\n<li>there are adequate database nodes running to service the database clients,<\/li>\n<li>that failed or unresponsive database nodes are restarted.<\/li>\n<li>Database nodes are distributed across zones \/ data center.<\/li>\n<li>Database seed nodes are established in each data center.<\/li>\n<li>Database nodes are cleanly removed from the cluster before being removed or upgaded.<\/li>\n<li>A quorum of database nodes is maintained.<\/li>\n<li>Database state is backed.<\/li>\n<li>Database state can be recovered in the event of a catastrophic failure.<\/li>\n<\/ul>\n<p>Now for a demo.<\/p>\n<h2>Demo<\/h2>\n<p>In this short screen cast we demonstrate how to install Navigator and then install a Cassandra cluster, using Helm.<br \/>\nWe also show how to examine the status and logs of Navigator components and of the Cassandra database nodes.<br \/>\nWe demonstrate how to scale up the Cassandra database and then connect to the database using cqlsh to create a key space, a table and insert some data.<\/p>\n<p>The <a href=\"https:\/\/github.com\/jetstack\/navigator\/pull\/189\">commands used in the demo<\/a> are available in the Navigator repository.<\/p>\n<p>Elasticsearch was the first database supported by Navigator and we\u2019ve made dozens of improvements in the last six months,<br \/>\nworking closely with customers and the community.<\/p>\n<p>Here are some examples:<\/p>\n<h2>Pilot Resources<\/h2>\n<p>The Navigator Pilot is a process which is injected into the container of the target database and becomes the entry point for the container.<br \/>\nSo instead of starting the database process immediately, Kubernetes will actually start a \/pilot process which first connects to the Navigator API to discover the desired database configuration.<br \/>\nIt then configures and starts up an Elasticsearch sub-process.<\/p>\n<p>We\u2019ve introduced a new Pilot API resource.<br \/>\nThis is a place where the controller can publish the desired configuration (<em>spec<\/em>) of each database node.<br \/>\nAnd it\u2019s where a Pilot process can publish the actual state of its database sub-process (<em>status<\/em>).<\/p>\n<p>The Navigator controller creates a Pilot resource for every pod under its control.<\/p>\n<h2>Sub-process Management<\/h2>\n<p>We\u2019ve made many improvements to the Pilot to ensure that:<\/p>\n<ul>\n<li>It cleanly starts the database sub-process.<\/li>\n<li>It catches TERM signals and allows its database sub-process to be cleanly stopped.<\/li>\n<li>It can reliably detect when its database sub-process has stopped.<\/li>\n<\/ul>\n<h2>Health Checks<\/h2>\n<p>And the Pilot now has a new REST endpoint (\/healthz ) through which it responds to Kubernetes Readiness and Liveness probes.<br \/>\nWhile the database is running, the Pilot queries the Elasticsearch API to gather the current state of the database and publishes it via the \/healthz endpoint.<\/p>\n<h2>Leader Election<\/h2>\n<p>Pilots now have a leader election mechanism.<br \/>\nThis allows a single \u201cleader\u201d Pilot process to perform cluster-wide administrative functions.<\/p>\n<h2>Scale Down Safely<\/h2>\n<p>This is all groundwork which will allow us to safely scale down Elasticsearch clusters.<\/p>\n<p>Navigator now runs in (and is tested in) Kubernetes environments where RBAC is enabled.<br \/>\nThe Navigator API server, the Navigator controller, and the Pilots all run with the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Principle_of_least_privilege\">least necessary privilege<\/a>.<\/p>\n<p>And if you prefer, you can run a separate Navigator controller for each database namespace.<br \/>\nWe\u2019ve implemented a new <a href=\"https:\/\/github.com\/kubernetes\/kubernetes\/pull\/54660\">Filtered Informer mechanism<\/a> so that, in this mode, the Navigator controller will only be able to interact with API resources in a single namespace.<\/p>\n<p>Navigator now has its own API server which is <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/api-extension\/apiserver-aggregation\/\">aggregated into the Kubernetes API<\/a>.<\/p>\n<p>The reason for this change was to overcome the <a href=\"https:\/\/blog.heptio.com\/an-introduction-to-extending-kubernetes-with-customresourcedefinitions-76deb675b27a\">limitations<\/a> of <a href=\"https:\/\/kubernetes.io\/docs\/tasks\/access-kubernetes-api\/extend-api-custom-resource-definitions\/\">CRDs (Custom Resource Definitions)<\/a>.<br \/>\nMost importantly it allows us to assign versions to our Navigator API resource types, as they evolve.<br \/>\nAnd it allows seamless conversion between different versions of the resources.<\/p>\n<p>And while the Navigator architecture has become somewhat more complex, the installation of Navigator has been vastly simplified by the introduction of a Navigator Helm chart (see below).<\/p>\n<p>Navigator now has a tried and tested <a href=\"https:\/\/github.com\/jetstack\/navigator\/tree\/master\/docs\/quick-start#quick-start-navigator---elasticsearch\">Helm chart<\/a>.<\/p>\n<p>This allows you to install and configure the Navigator API server, and the Navigator Controller, and all the supporting Kubernetes resources, in a single fool-proof step.<br \/>\nWe use that same Helm chart to install Navigator before running our end-to-end tests, so we (and you) can be confident that this installation mechanism is reliable.<br \/>\nThe Helm chart is quite configurable and allows you to tweak the logging level of the Navigator components for example.<\/p>\n<p>We have also been working on a suite of end-to-end tests for Navigator.<\/p>\n<p>These verify that the Navigator API server and the Navigator controller can be installed, using Helm, as documented.<br \/>\nThey verify that the Navigator API server is successfully aggregated in all the versions of Kubernetes we support.<br \/>\nThat the Navigator controller starts an Elasticsearch or Cassandra database cluster matching the desired configuration in the API server.<br \/>\nAnd most importantly that the databases are actually usable after they have been launched.<\/p>\n<p>We now use <a href=\"https:\/\/github.com\/kubernetes\/test-infra\">Kubernetes test infrastructure<\/a> to run unit tests and end-to-end tests.<\/p>\n<p>We initially tried <a href=\"https:\/\/blog.travis-ci.com\/2017-10-26-running-kubernetes-on-travis-ci-with-minikube\">running tests against Minikube on Travis CI<\/a> and it <a href=\"https:\/\/twitter.com\/JetstackHQ\/status\/925340551272194048\">totally worked<\/a>!<br \/>\nBut we soon encountered limitations. We needed to use the minikube start &#8211;bootstrapper=kubeadm option, in order to properly set up the Navigator API server aggregation; but that doesn\u2019t work on the Ubuntu 14.04 operating system provided by Travis-CI.<\/p>\n<p>Additionally some of our end-to-end tests were attempting to launch (and scale-up) multi-node Elasticsearch and Cassandra databases.<br \/>\nA single Travis-CI virtual machine just doesn\u2019t cut the mustard.<\/p>\n<p>So we\u2019ve installed our own test infrastructure on Google Cloud and installed and tweaked the Kubernetes Test-Infra for our own purposes and it works great!<\/p>\n<p>We\u2019ll write more about this in a future blog post but for now take a look at: <a href=\"https:\/\/bentheelder.io\/posts\/prow\">\u2018Prow: Testing the way to Kubernetes Next\u2019<\/a> and <a href=\"http:\/\/blog.michali.net\/2017\/06\/07\/making-use-of-kubernetes-test-infra-tools\/\">\u2018Making Use of Kubernetes Test Infra Tools\u2019<\/a>, which give a great introduction to the Kubernetes Test-Infra tools.<\/p>\n<p>The Navigator API is subject to change and the project is still in an alpha state so we ask that you do not use it in production, yet!<br \/>\nBut we\u2019re working flat out to add more features and to make Navigator as robust as possible.<br \/>\nHere are some of the features that we\u2019re working on:<\/p>\n<ul>\n<li>Scale Down: Safely scale down all supported databases<\/li>\n<li>Database Upgrade: Rolling upgrades of all supported databases<\/li>\n<li>Backup and Restore: Scheduled database backup and automated restore<\/li>\n<\/ul>\n<p>So stay tuned!<br \/>\nAnd join us if you can at <a href=\"https:\/\/qconlondon.com\/\">QCon London, in March 2018<\/a>, where we plan to announce and demonstrate a new Navigator release.<br \/>\nHope to see you there!<\/p>\n<p><a href=\"https:\/\/blog.jetstack.io\/blog\/navigator-status-update-2018-01\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>18\/Jan 2018 By Richard Wall Navigator is a Kubernetes extension for managing distributed databases. In this post we\u2019ll tell you about all the improvements we\u2019ve made since we unveiled it last year, including: experimental support for Apache Cassandra clusters, improved support for Elasticsearch clusters, and a Helm chart for easy installation! We\u2019ll also give you &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw93\/index.php\/2018\/10\/16\/whats-new-in-navigator-jetstack-blog\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;What&#8217;s New in Navigator? &#8211; Jetstack Blog&#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-377","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\/377","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=377"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/377\/revisions"}],"predecessor-version":[{"id":524,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/377\/revisions\/524"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/media?parent=377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/categories?post=377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/tags?post=377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}