{"id":1793,"date":"2022-03-04T10:22:23","date_gmt":"2022-03-04T09:22:23","guid":{"rendered":"https:\/\/nine30.info\/?p=1793"},"modified":"2022-03-04T10:22:23","modified_gmt":"2022-03-04T09:22:23","slug":"install-tanzu-community-edition-with-salt","status":"publish","type":"post","link":"https:\/\/nine30.nxt70.com\/index.php\/2022\/03\/04\/install-tanzu-community-edition-with-salt\/","title":{"rendered":"Install Tanzu Community Edition with Salt"},"content":{"rendered":"\n<p>This blog post is about two open source projects supported by VMware: <a rel=\"noreferrer noopener\" href=\"https:\/\/saltproject.io\/\" target=\"_blank\">Salt<\/a> and <a rel=\"noreferrer noopener\" href=\"https:\/\/tanzucommunityedition.io\/\" target=\"_blank\">Tanzu Community Edition<\/a>. <strong>Salt<\/strong> is event-driven automation, infrastructure management, configuration management, remote execution and much more. <strong>Tanzu Community Edition (TCE)<\/strong> is a full-featured, easy-to-manage Kubernetes platform for learners and users, especially those working in small-scale or pre-production environments.<\/p>\n\n\n\n<p>Installing TCE it is well documented <a rel=\"noreferrer noopener\" href=\"https:\/\/tanzucommunityedition.io\/docs\/latest\/cli-installation\/\" target=\"_blank\">here<\/a> and generally not a complex task, so why automating it? A colleague needs to deploy TCE over and over and I offered my help.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Requirements<\/h2>\n\n\n\n<p>Currently my state files install TCE 0.10.0 that can be installed on Linux, Mac or Windows. What I did covers only Ubuntu, my Salt state files are tested against Ubuntu 18.04 (xenial) and Ubuntu 20.04 (focal). So you need the followings: <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Ubuntu 18.04 or 20.04 x86 desktop (this can be a Virtual Machine)<\/li><li>2 CPUs and 6 GB of RAM<\/li><li>Access to internet<\/li><li>A user member of <code>sudo<\/code> group<\/li><\/ul>\n\n\n\n<p>Note: TCE doesn&#8217;t need it, however my automation creates a user named <code>tce<\/code>. This user has disabled interactive login, it is placed in <code>sudo<\/code> and <code>docker<\/code> groups and finally it is allowed for password-less sudo.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install TCE with Salt<\/h2>\n\n\n\n<p>If you are already familiar with Salt you can simply grab my State Files <a href=\"https:\/\/github.com\/paoloromagnoli\/tanzuce.git\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a> and apply <code>init.sls<\/code> against your Ubuntu minion. <\/p>\n\n\n\n<p>If you are not familiar with Salt here is the step-by-step end-to-end guide including installing Salt. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install and Configure Salt<\/h3>\n\n\n\n<p>Here I am providing instrcuctions to install Salt on Ubuntu 20.04, if you have a Ubuntu 18.04 instructions are <a href=\"https:\/\/repo.saltproject.io\/#ubuntu\">here<\/a>. Here we will install both Salt&#8217;s Master and Minion on your Ubuntu desktop.<\/p>\n\n\n\n<p>Run the following command to import the Salt repository key.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo curl -fsSL -o \/usr\/share\/keyrings\/salt-archive-keyring.gpg https:\/\/repo.saltproject.io\/py3\/ubuntu\/20.04\/amd64\/latest\/salt-archive-keyring.gpg<\/code><\/pre>\n\n\n\n<p>Run the following command to create <code>\/etc\/apt\/sources.list.d\/salt.list<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"deb &#91;signed-by=\/usr\/share\/keyrings\/salt-archive-keyring.gpg arch=amd64] https:\/\/repo.saltproject.io\/py3\/ubuntu\/20.04\/amd64\/latest focal main\" | sudo tee \/etc\/apt\/sources.list.d\/salt.list<\/code><\/pre>\n\n\n\n<p>Update you repository.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update<\/code><\/pre>\n\n\n\n<p>Install salt-master and salt-minion.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install salt-master\nsudo apt-get install salt-minion<\/code><\/pre>\n\n\n\n<p>  Configure Salt Master with the following three commands. The second command set the hostname as the Minion ID.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"master: 127:0.0.1\" | sudo tee \/etc\/salt\/minion.d\/master.conf\nhostname | sudo tee \/etc\/salt\/minion_id\necho \"timeout: 60\" | sudo tee \/etc\/salt\/master.d\/timeout.conf<\/code><\/pre>\n\n\n\n<p>Start the Master and Minion services.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable salt-master --now\nsudo systemctl enable salt-minion --now<\/code><\/pre>\n\n\n\n<p>Look for the Minion key to show up. In the screenshot below the command the minion key is named <code>ubuntu-desktop-paolo<\/code>, you will see a different name according to your hostname.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo salt-key -L<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-id=\"1799\" src=\"https:\/\/nine30.info\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-24-at-17.25.11.png\" alt=\"\" class=\"wp-image-1799\"\/><\/figure>\n<\/figure>\n\n\n\n<p>Accept your Minion key, be sure to replace <code>ubuntu-desktop-paolo<\/code> with your actual Minion key name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo salt-key \u2013a ubuntu-dektop-paolo \u2013y<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-id=\"1800\" src=\"https:\/\/nine30.info\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-24-at-17.27.33.png\" alt=\"\" class=\"wp-image-1800\"\/><\/figure>\n<\/figure>\n\n\n\n<p>If you list keys again, your Minion ID should appears under the Accepted Key in green.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-id=\"1801\" src=\"https:\/\/nine30.info\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-24-at-17.28.11.png\" alt=\"\" class=\"wp-image-1801\"\/><\/figure>\n<\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Download the State files and install TCE<\/h3>\n\n\n\n<p>Create a directory to host the State files.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir -p \/srv\/salt<\/code><\/pre>\n\n\n\n<p>Clone the repo.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/srv\/salt\ngit clone https:\/\/github.com\/paoloromagnoli\/tanzuce.git<\/code><\/pre>\n\n\n\n<p>Apply the state file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo salt-call state.apply tanzu<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-id=\"1802\" src=\"https:\/\/nine30.info\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-24-at-18.39.26-1024x388.png\" alt=\"\" class=\"wp-image-1802\"\/><\/figure>\n<\/figure>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-id=\"1803\" src=\"https:\/\/nine30.info\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-24-at-18.39.41-1024x388.png\" alt=\"\" class=\"wp-image-1803\"\/><\/figure>\n<\/figure>\n\n\n\n<p>Before strarting TCE make sure you switch to <code>tce<\/code> user.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>su - tce<\/code><\/pre>\n\n\n\n<p>You can follow the TCE documentation <a rel=\"noreferrer noopener\" href=\"https:\/\/tanzucommunityedition.io\/docs\/latest\/\" target=\"_blank\">here<\/a> to get started with TCE. Here after I am just reporting a command you can use to check your TCE is working properly:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tanzu management-cluster create --ui<\/code><\/pre>\n\n\n\n<p>Note: in my case TCE was not able to start the web browser, no big deal you can simply get to TCE UI by accessing http:\/\/127.0.0.1:8080 on your favorite browser:<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-id=\"1804\" src=\"https:\/\/nine30.info\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-24-at-18.41.02-1024x513.png\" alt=\"\" class=\"wp-image-1804\"\/><\/figure>\n<\/figure>\n\n\n\n<p>Have fun with your Kubernetes clusters!!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post is about two open source projects supported by VMware: Salt and Tanzu Community Edition. Salt is event-driven automation, infrastructure management, configuration management, remote execution and much more. Tanzu Community Edition (TCE) is a full-featured, easy-to-manage Kubernetes platform for learners and users, especially those working in small-scale or pre-production environments. Installing TCE it&hellip; <a class=\"more-link\" href=\"https:\/\/nine30.nxt70.com\/index.php\/2022\/03\/04\/install-tanzu-community-edition-with-salt\/\">Continue reading <span class=\"screen-reader-text\">Install Tanzu Community Edition with Salt<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1813,"comment_status":"open","ping_status":"open","sticky":false,"template":"templates\/template-cover.php","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[23,99,122,126,144,164],"class_list":["post-1793","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-automation","tag-linux","tag-opensource","tag-oss","tag-saltproject","tag-tanzu","entry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/nine30.nxt70.com\/index.php\/wp-json\/wp\/v2\/posts\/1793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nine30.nxt70.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nine30.nxt70.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nine30.nxt70.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nine30.nxt70.com\/index.php\/wp-json\/wp\/v2\/comments?post=1793"}],"version-history":[{"count":0,"href":"https:\/\/nine30.nxt70.com\/index.php\/wp-json\/wp\/v2\/posts\/1793\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nine30.nxt70.com\/index.php\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/nine30.nxt70.com\/index.php\/wp-json\/wp\/v2\/media?parent=1793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nine30.nxt70.com\/index.php\/wp-json\/wp\/v2\/categories?post=1793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nine30.nxt70.com\/index.php\/wp-json\/wp\/v2\/tags?post=1793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}