<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>kubernetes Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/tag/kubernetes/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/tag/kubernetes/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Thu, 27 Apr 2023 11:28:04 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://serverstadium.com/wp-content/uploads/2023/04/cropped-favicon-1-32x32.png</url>
	<title>kubernetes Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/tag/kubernetes/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Kubernetes Ingress Controller using SSL in ServerStadium</title>
		<link>https://serverstadium.com/knowledge-base/kubernetes-ingress-controller-using-ssl-in-serverstadium/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 20 Jan 2022 09:27:16 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=1798</guid>

					<description><![CDATA[<p>&#160; Kubernetes has two techniques when deploying applications for external Access, Egress and Ingress. Egress is outgoing traffic from the pod, and Ingress is incoming traffic to the pod. But here, we will talk about Ingress Controller in Kubernetes. Ingress Controller Kubernetes Ingress Controller is an L7 Load Balancer that allows a simple host or&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/kubernetes-ingress-controller-using-ssl-in-serverstadium/">Kubernetes Ingress Controller using SSL in ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">Kubernetes has two techniques when deploying applications for external Access, Egress and Ingress. Egress is outgoing traffic from the pod, and Ingress is incoming traffic to the pod.</p>



<p class="wp-block-paragraph">But here, we will talk about Ingress Controller in Kubernetes.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Ingress Controller</strong></h2>



<p class="wp-block-paragraph">Kubernetes Ingress Controller is an L7 Load Balancer that allows a simple host or URL-based HTTP routing.<br />Usually, Kubernetes Ingress Controller always uses a third-party proxy. There are many Ingress Controller applications today, i.e.:<br /><br />Nginx: Official ingress for NGINX and NGINX Plus<br />Kong: Nginx-based API Gateway or enterprise option using KongHQ<br />Istio: Ingress Gateway for Istio-enabled clusters<br />HAProxy: HAProxy Ingress Controller<br />F5: Support F5’s BIG-IP Container Ingress Services<br />Ambassador: API Gateway and L7 Load Balancer with Kubernetes Ingress support</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Ingress Controller in ServerStadium</strong></h2>



<p class="wp-block-paragraph">In ServerStadium Cloud, we can implement Ingress Controller using Nginx. In the previous article, we configured Rancher Kubernetes, which installed Nginx reverse proxy as the default Ingress Controller. Nginx is a popular option for simple HTTP/S routing and SSL termination cases.<br /><br />This tutorial will teach using Ingress Controller, like routing http/s routing and installing SSL in Kubernetes.<br />With Rancher, we will create ingress with a simple click.<br /><br />Below is step by step what we will do in this article:</p>



<p class="wp-block-paragraph"><br />a. Make sure Nginx Ingress Controller has been installed on Kubernetes<br />b. Create a new project with the name “IngressCR” and a Namespace named “IngressNS.”<br />c. Create two subdomains with the names apple.serverstadium.com  and orange.serverstadium.com<br />d. Install SSL in Kubernetes<br />e. Configure the Ingress controller for both subdomains with SSL<br />f. Configure Load Balancer in ServerStadium Cloud for both subdomains</p>



<h4 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>A. Make Sure Nginx Ingress Controller has been Installed on Kubernetes</strong></h4>



<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">Before implementing Nginx Ingress Controller in ServerStadium Cloud, we must ensure that Nginx has been installed in our Kubernetes. When we deploy Rancher for the first time, make sure the cluster.yml already has the following line :<br /><br /></p>



<p class="wp-block-paragraph"># <code>Required for external TLS termination with</code><br /><code># ingress-nginx v0.22+<br />ingress:<br />  provider: nginx<br />  options:<br />    use-forwarded-headers: "true"</code></p>



<p class="wp-block-paragraph">After Nginx has been installed in Kubernetes, we can verify it using Rancher Web UI<br /><br />1. Change your namespace to <strong>ingress-nginx<br /></strong>2. Click <strong>Workload – DaemonSets,</strong> then we will see <strong>nginx-ingress-controller</strong></p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1157" height="286" class="wp-image-1800" src="https://serverstadium.com/wp-content/uploads/2022/01/image.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-300x74.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-1024x253.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-768x190.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<h4 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><br /><strong>B. Create a New Project with the Name “IngressCR”</strong></h4>



<p class="wp-block-paragraph">Next step, we will create a new Project in Kubernetes.<br /><br />1. Change the view using <strong>“All Namespaces”</strong> – Click <strong>“Cluster” </strong>– Click <strong>“Project/Namespaces” </strong>then Click<strong> “Create Project”</strong> Button</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1157" height="374" class="wp-image-1801" src="https://serverstadium.com/wp-content/uploads/2022/01/image-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-1.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-1-300x97.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-1-1024x331.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-1-768x248.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">2. We will be redirected to the new Window. Fill Name of the Project with <strong>IngressCR, </strong>then click <strong>Create</strong>.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1157" height="451" class="wp-image-1802" src="https://serverstadium.com/wp-content/uploads/2022/01/image-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-2.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-2-300x117.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-2-1024x399.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-2-768x299.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">3. Next, we will create a new namespace for our website. In Project, <strong>IngressCR, </strong>click “<strong>Create Namespace</strong>” button.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1157" height="113" class="wp-image-1803" src="https://serverstadium.com/wp-content/uploads/2022/01/image-3.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-3.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-3-300x29.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-3-1024x100.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-3-768x75.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">4. In the new Window, fill the Name with “<strong>ingressns</strong>” to create our namespace.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1139" height="454" class="wp-image-1810" src="https://serverstadium.com/wp-content/uploads/2022/01/image-8.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-8.png 1139w, https://serverstadium.com/wp-content/uploads/2022/01/image-8-300x120.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-8-1024x408.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-8-768x306.png 768w" sizes="(max-width: 1139px) 100vw, 1139px" /></figure>



<p class="wp-block-paragraph">Now we have namespace <strong>IngressNS </strong>in our Kubernetes server.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1157" height="99" class="wp-image-1811" src="https://serverstadium.com/wp-content/uploads/2022/01/image-9.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-9.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-9-300x26.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-9-1024x88.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-9-768x66.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">&nbsp;</p>



<h4 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>C. Create Two Subdomains with Names apple.serverstadium.com and orange.serverstadium.com</strong></h4>



<p class="wp-block-paragraph">In the next steps, we will create two subdomains and a simple site for both websites because we only want to know how the Nginx Ingress Controller works with SSL.</p>



<p class="wp-block-paragraph">Change our namespace to ingressns then we will create a deployment for both websites. <br /><br />Click <strong>Workload – Deployment</strong></p>



<p class="wp-block-paragraph">The first subdomain fills the field as follows:<br /><br /><code>Namespace : ingressns<br />Name : apple</code><br /><code>Container Name : nginx<br />Container Image : nginx<br />Ports  :<br />                Service Type : ClusterIP<br />                Name             : nginx-svc<br />                Private Container Port : 80<br />                Protocol : TCP</code></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1157" height="567" class="wp-image-1813" src="https://serverstadium.com/wp-content/uploads/2022/01/image-10.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-10.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-10-300x147.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-10-1024x502.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-10-768x376.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">Then click <strong>Create</strong>. Please wait for a while until deployment creates the pods.</p>



<p class="wp-block-paragraph">After Apple’s Deployment state is Active,  we can create a new deployment for orange.serverstadium.com with the same steps.</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1814" src="https://serverstadium.com/wp-content/uploads/2022/01/image-11.png" alt="" /></figure>



<p class="wp-block-paragraph">Below is the screenshot after we create two subdomains in Rancher.</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1815" src="https://serverstadium.com/wp-content/uploads/2022/01/image-12.png" alt="" /></figure>



<h4 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>D. Install SSL in Kubernetes</strong></h4>



<p class="wp-block-paragraph">In the next steps, we will add our SSL certificate in Rancher. <br />Click <strong>Storage – Secrets, </strong>then Choose <strong>Create </strong>Button</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1816" src="https://serverstadium.com/wp-content/uploads/2022/01/image-13.png" alt="" /></figure>



<p class="wp-block-paragraph">In the new windows, we choose <strong>TLS Certificate</strong></p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1817" src="https://serverstadium.com/wp-content/uploads/2022/01/image-14.png" alt="" /></figure>



<p class="wp-block-paragraph">Fill in the field as follow :<br /><br /><code>Name        : Cloudraya (name of your certificate)<br />Certificate : Insert your Private key and Certificate</code><br />Click Create</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1157" height="645" class="wp-image-1818" src="https://serverstadium.com/wp-content/uploads/2022/01/image-15.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-15.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-15-300x167.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-15-1024x571.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-15-768x428.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">Below is the screenshot after we successfully added the certificate.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1157" height="330" class="wp-image-1819" src="https://serverstadium.com/wp-content/uploads/2022/01/image-16.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-16.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-16-300x86.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-16-1024x292.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-16-768x219.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">&nbsp;</p>



<h4 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>E. Configure Ingress Controller for Both Subdomains with SSL</strong></h4>



<p class="wp-block-paragraph">After we configure the website and certificate, we are ready to create an ingress for both domains (apple.serverstadium.com and orange.serverstadium.com)<br /><br />Please make sure our namespace is in ingresses. On the left page, choose Service Discovery – Ingresses, then click Create</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1157" height="311" class="wp-image-1821" src="https://serverstadium.com/wp-content/uploads/2022/01/image-17.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-17.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-17-300x81.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-17-1024x275.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-17-768x206.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph"><br />In the new Window, fill the field as follow:<br /><code>Name : apple.serverstadium.com</code><br /><code>Request Host : apple.serverstadium.com<br />Path : Prefix</code><br />            /<br /><code>Target Service :  apple<br />Port : 80</code></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1157" height="643" class="wp-image-1822" src="https://serverstadium.com/wp-content/uploads/2022/01/image-18.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-18.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-18-300x167.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-18-1024x569.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-18-768x427.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">Select Certificates<br />Certificate-Secret Name: Choose <strong>serverstadium </strong>secret that we have created before.<br />Fill the hostname with <strong>apple.serverstadium.com</strong><br />Then click Create<br /><br /></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1157" height="553" class="wp-image-1823" src="https://serverstadium.com/wp-content/uploads/2022/01/image-19.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-19.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-19-300x143.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-19-1024x489.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-19-768x367.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">Below is the screenshot after we successfully created the Ingress</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1157" height="295" class="wp-image-1824" src="https://serverstadium.com/wp-content/uploads/2022/01/image-20.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-20.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-20-300x76.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-20-1024x261.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-20-768x196.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">Please do the same step to create orange.serverstadium.com until we have two ingresses in Kubernetes</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1825" src="https://serverstadium.com/wp-content/uploads/2022/01/image-21.png" alt="" /></figure>



<p class="wp-block-paragraph">&nbsp;</p>



<h4 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>F. Configure ServerStadium Cloud Load Balancer</strong></h4>



<p class="wp-block-paragraph">Like the previous article at this <a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-2/" target="_blank" rel="noreferrer noopener">link</a>, we assign Load Balancer IP Address for Rancher. <br />This IP Address is the same IP Address for Ingress Controller for Kubernetes.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1157" height="397" class="wp-image-1826" src="https://serverstadium.com/wp-content/uploads/2022/01/image-22.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/01/image-22.png 1157w, https://serverstadium.com/wp-content/uploads/2022/01/image-22-300x103.png 300w, https://serverstadium.com/wp-content/uploads/2022/01/image-22-1024x351.png 1024w, https://serverstadium.com/wp-content/uploads/2022/01/image-22-768x264.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">Point A record of both subdomains to IP 202.43.248.249; then we can browse it via browser.</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1827" src="https://serverstadium.com/wp-content/uploads/2022/01/image-23.png" alt="" /></figure>



<p class="wp-block-paragraph">Wow, we have successfully created Ingress in Kubernetes with SSL in ServerStadium Cloud!</p>



<p class="wp-block-paragraph">Get more applicable articles on tutorials in our <strong><a href="https://serverstadium.com/knowledge-base/" target="_blank" rel="noreferrer noopener">Knowledge Base</a></strong>. Or, if you have questions, feel free to contact us!<strong><a href="https://serverstadium.com/id/" target="_blank" rel="noreferrer noopener"><br /></a></strong></p>
<p>The post <a href="https://serverstadium.com/knowledge-base/kubernetes-ingress-controller-using-ssl-in-serverstadium/">Kubernetes Ingress Controller using SSL in ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>High Availability Kubernetes Using RKE in ServerStadium Part 3</title>
		<link>https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-3/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Sun, 31 Oct 2021 07:48:43 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=1552</guid>

					<description><![CDATA[<p>After Kubernetes and Rancher is ready, we can continue to create simple application run on our Kubernetes ClusterPlease login to Rancher WEB UI using your Rancher URL Create a Project in Rancher Click Cluster Name; for this application, we choose local, then click Add Project button Insert the project name with the name Website, then&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-3/">High Availability Kubernetes Using RKE in ServerStadium Part 3</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">After Kubernetes and Rancher is ready, we can continue to create simple application run on our Kubernetes Cluster<br />Please login to Rancher WEB UI using your Rancher URL</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Create a Project in Rancher </strong></h2>



<p class="wp-block-paragraph">Click Cluster Name; for this application, we choose<strong> local,</strong> then click <strong>Add Project </strong>button</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1433" src="https://serverstadium.com/wp-content/uploads/2021/09/image-38.png" alt="" /></figure>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1434" src="https://serverstadium.com/wp-content/uploads/2021/09/image-39.png" alt="" /></figure>



<p class="wp-block-paragraph">Insert the project name with the<strong> name Website,</strong> then <strong>click Create</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1435" src="https://serverstadium.com/wp-content/uploads/2021/09/image-40.png" alt="" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Add Namespace</strong></h2>



<p class="wp-block-paragraph">Select <strong>Website </strong>project, then we create a namespace in which the application will be deployed.<br />Click Add <strong>Namespace </strong>button, then Insert <strong>Name </strong>with<strong> nginx-ns</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1436" src="https://serverstadium.com/wp-content/uploads/2021/09/image-41.png" alt="" /></figure>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1437" src="https://serverstadium.com/wp-content/uploads/2021/09/image-42.png" alt="" /></figure>



<p class="wp-block-paragraph">Click the <strong>dashboard, </strong>then Choose Project <strong>Website</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1438" src="https://serverstadium.com/wp-content/uploads/2021/09/image-43.png" alt="" /></figure>



<p class="wp-block-paragraph">Click the <strong>Deploy </strong>button on the right side to deploy a simple application.</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1439" src="https://serverstadium.com/wp-content/uploads/2021/09/image-44.png" alt="" /></figure>



<p class="wp-block-paragraph">Fill in the value as the following screenshot<br />Name: nginx<br />Docker Image: nginx<br />Namespace: nginx-ns<br />Port Mapping:<br />    Port Name: nginx<br />    Public the container port: 80<br />    Protocol: TCP<br />&#8220;As a&#8221; : NodePort<br />Then click Launch</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1440" src="https://serverstadium.com/wp-content/uploads/2021/09/image-45.png" alt="" /></figure>



<p class="wp-block-paragraph">Let’s monitor until the deployment status is <strong>Active</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1441" src="https://serverstadium.com/wp-content/uploads/2021/09/image-46.png" alt="" /></figure>



<p class="wp-block-paragraph">After deployment is successful, the Nginx application uses port 30350. In the next step, we will add this port to the Load Balancer in ServerStadium Cloud</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1442" src="https://serverstadium.com/wp-content/uploads/2021/09/image-47.png" alt="" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Add Port to Load Balancer</strong></h2>



<p class="wp-block-paragraph">Create a Load balancer with Name <strong>nginx </strong>with Public Port <strong>80 </strong>and the Private Port <strong>30350</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1443" src="https://serverstadium.com/wp-content/uploads/2021/09/image-48.png" alt="" /></figure>



<p class="wp-block-paragraph">Edit <strong>nginx </strong>Load Balancer to assign <strong>All nodes</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1444" src="https://serverstadium.com/wp-content/uploads/2021/09/image-49.png" alt="" /></figure>



<p class="wp-block-paragraph">Edit <strong>nginx </strong>Load balancer, then assign all <strong>nodes </strong>to the LB</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1445" src="https://serverstadium.com/wp-content/uploads/2021/09/image-50.png" alt="" /></figure>



<p class="wp-block-paragraph">Add all nodes to the Load Balancer; we can access the Nginx using the IP Address of the Load Balancer</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1446" src="https://serverstadium.com/wp-content/uploads/2021/09/image-51.png" alt="" /></figure>



<p class="wp-block-paragraph"><br />Scaling a pod using Rancher is very simple. We only need to click the plus button on the right side.</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1587" src="https://serverstadium.com/wp-content/uploads/2021/10/image-2.png" alt="" /></figure>



<p class="wp-block-paragraph">After a while, we will see two dots under Active which means the nginx already has 2 pods</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1588" src="https://serverstadium.com/wp-content/uploads/2021/10/image-3.png" alt="" /></figure>



<p class="wp-block-paragraph">Also, we can verify it using kubectl command. Please run the command below to verify the pods</p>



<pre class="wp-block-preformatted"># kubectl get pods</pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1589" src="https://serverstadium.com/wp-content/uploads/2021/10/image-4.png" alt="" /></figure>



<p class="wp-block-paragraph">We can see the Rancher and kubectl command has the same result.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Add Helm Repository through Rancher</strong></h2>



<p class="wp-block-paragraph">Helm is Package Manager of Kubernetes like apt and yum. We can add the repository and then choose the application that you would like to be installed. Click Apps, then choose Manage Catalogs.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-1591" src="https://serverstadium.com/wp-content/uploads/2021/10/image-5.png" alt="" width="755" height="144" /></figure>



<p class="wp-block-paragraph">After that, we will see the default three repositories of rancher</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-1592" src="https://serverstadium.com/wp-content/uploads/2021/10/image-6.png" alt="" width="740" height="232" /></figure>



<p class="wp-block-paragraph">Click Add Catalog button to add the repository. In this tutorial, we will add the Bitnami Helm repository<br />Name: Bitnami<br />Catalog URL: https://charts.bitnami.com/bitnami<br />Helm Version: Helm v3<br /><br />Then click Create</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-1595" src="https://serverstadium.com/wp-content/uploads/2021/10/image-9.png" alt="" width="657" height="367" srcset="https://serverstadium.com/wp-content/uploads/2021/10/image-9.png 735w, https://serverstadium.com/wp-content/uploads/2021/10/image-9-300x168.png 300w" sizes="(max-width: 657px) 100vw, 657px" /></figure>



<p class="wp-block-paragraph">After Bitnami Repository has been added, we can continue to deploy the application.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Deploy / Launch Apache from Helm Repository</strong></h2>



<p class="wp-block-paragraph">We will deploy Apache in the Kubernetes cluster. Click the Launch Button the search Apache</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-1596" src="https://serverstadium.com/wp-content/uploads/2021/10/image-10.png" alt="" width="817" height="169" srcset="https://serverstadium.com/wp-content/uploads/2021/10/image-10.png 1294w, https://serverstadium.com/wp-content/uploads/2021/10/image-10-300x62.png 300w, https://serverstadium.com/wp-content/uploads/2021/10/image-10-1024x213.png 1024w, https://serverstadium.com/wp-content/uploads/2021/10/image-10-768x160.png 768w" sizes="(max-width: 817px) 100vw, 817px" /></figure>



<p class="wp-block-paragraph">On the new screen, we will see many applications on Kubernetes. Just type Apache the click the Apache to continue the deployment</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-1597" src="https://serverstadium.com/wp-content/uploads/2021/10/image-11.png" alt="" width="731" height="197" srcset="https://serverstadium.com/wp-content/uploads/2021/10/image-11.png 1303w, https://serverstadium.com/wp-content/uploads/2021/10/image-11-300x81.png 300w, https://serverstadium.com/wp-content/uploads/2021/10/image-11-1024x277.png 1024w, https://serverstadium.com/wp-content/uploads/2021/10/image-11-768x207.png 768w" sizes="(max-width: 731px) 100vw, 731px" /></figure>



<p class="wp-block-paragraph">Fill the field as follow :<br />Name: apache<br />Namespace: apache<br />Then Click the Launch button</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-1598" src="https://serverstadium.com/wp-content/uploads/2021/10/image-12.png" alt="" width="762" height="401" srcset="https://serverstadium.com/wp-content/uploads/2021/10/image-12.png 1166w, https://serverstadium.com/wp-content/uploads/2021/10/image-12-300x158.png 300w, https://serverstadium.com/wp-content/uploads/2021/10/image-12-1024x539.png 1024w, https://serverstadium.com/wp-content/uploads/2021/10/image-12-768x404.png 768w" sizes="(max-width: 762px) 100vw, 762px" /></figure>



<p class="wp-block-paragraph">Click Apps to see the status of Apache deployment</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="644" height="330" class="wp-image-1600" src="https://serverstadium.com/wp-content/uploads/2021/10/image-14.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/10/image-14.png 644w, https://serverstadium.com/wp-content/uploads/2021/10/image-14-300x154.png 300w" sizes="(max-width: 644px) 100vw, 644px" /></figure>



<p class="wp-block-paragraph">Let&#8217;s find the service port of the Apache using kubectl in the Apache namespace</p>



<pre class="wp-block-preformatted"># kubectl get svc -n apache</pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="600" height="44" class="wp-image-1602" src="https://serverstadium.com/wp-content/uploads/2021/10/image-15.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/10/image-15.png 600w, https://serverstadium.com/wp-content/uploads/2021/10/image-15-300x22.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></figure>



<p class="wp-block-paragraph">In here, we get port 30560, which we can set on the Load Balancer of ServerStadium Cloud. Add new Load Balancer configuration as follow.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="262" height="568" class="wp-image-1603" src="https://serverstadium.com/wp-content/uploads/2021/10/image-16.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/10/image-16.png 262w, https://serverstadium.com/wp-content/uploads/2021/10/image-16-138x300.png 138w" sizes="(max-width: 262px) 100vw, 262px" /></figure>



<p class="wp-block-paragraph">Then assign all nodes to this Load Balancer IP Address. Verify the Apache deployment by accessing the website using the URL</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="349" height="179" class="wp-image-1604" src="https://serverstadium.com/wp-content/uploads/2021/10/image-17.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/10/image-17.png 349w, https://serverstadium.com/wp-content/uploads/2021/10/image-17-300x154.png 300w" sizes="(max-width: 349px) 100vw, 349px" /></figure>



<p class="wp-block-paragraph"><br />Finally, we successfully installed Kubernetes and deployed a simple application, Nginx and Apache, in ServerStadium Cloud.<br />Please feel free to submit your question to our Support if you need more assistance.</p>



<p class="wp-block-paragraph">Missed something? You can always re-read the article<strong> <a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-1/" target="_blank" rel="noreferrer noopener">part 1</a></strong> and <strong><a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-1/" target="_blank" rel="noreferrer noopener">part 2.</a></strong> Ready to have your High Availability in Kubernetes Using RKE? Try it in ServerStadium Cloud now; <a href="https://cp.serverstadium.com/regist-user"><strong>sign up here</strong></a>.</p>



<p class="wp-block-paragraph">&nbsp;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-3/">High Availability Kubernetes Using RKE in ServerStadium Part 3</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>High Availability Kubernetes Using RKE in ServerStadium Part 2</title>
		<link>https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-2/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Sat, 30 Oct 2021 05:22:47 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=1551</guid>

					<description><![CDATA[<p>After we complete installing Kubernetes on Part 1, we can continue to install the Rancher.Rancher has a nice Web UI in which we can manage our Kubernetes cluster. There are several ways to install Rancher on the server: Install Rancher in standalone docker Install Rancher as a container under Kubernetes cluster itself In this tutorial,&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-2/">High Availability Kubernetes Using RKE in ServerStadium Part 2</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">After we complete installing Kubernetes <strong><a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-1/" target="_blank" rel="noreferrer noopener">on Part 1</a></strong>, we can continue to install the Rancher.<br />Rancher has a nice Web UI in which we can manage our Kubernetes cluster. There are several ways to install Rancher on the server:</p>



<ol class="wp-block-list" type="1">
<li>Install Rancher in standalone docker</li>
<li>Install Rancher as a container under Kubernetes cluster itself</li>
</ol>



<p class="wp-block-paragraph">In this tutorial, we will install Rancher as a container deployed on the Kubernetes cluster on every node. If one of the servers is down, we can still access Rancher from our end.</p>



<p class="wp-block-paragraph">Before we install the rancher, we need to install helm on the server.<br />Helm is package management for Kubernetes like apt. Please install Helm from the latest source, or we can install it using snap package on Ubuntu.</p>



<pre class="wp-block-code"><code># snap install helm --classic</code></pre>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-1401" src="https://serverstadium.com/wp-content/uploads/2021/09/image-9.png" alt="" width="211" height="17" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Add Stable Rancher Chart</strong></h2>



<p class="wp-block-paragraph">After we install Helm, we can add the Helm chart repository. In this tutorial, we will use the stable repository.</p>



<pre class="wp-block-code"><code># helm repo add rancher-stable https://releases.rancher.com/server-charts/stable</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1403" src="https://serverstadium.com/wp-content/uploads/2021/09/image-10.png" alt="" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Create a Namespace for Rancher: cattle-system</strong></h2>



<p class="wp-block-paragraph">The next step creates Kubernetes namespace with the name cattle-system where the Chart will be installed.<br />Namespace helps us organize clusters into virtual sub-clusters and is helpful when working with another team or sharing the project on the Kubernetes cluster.</p>



<pre class="wp-block-code"><code>#kubectl create namespace cattle-system</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1404" src="https://serverstadium.com/wp-content/uploads/2021/09/image-11.png" alt="" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Install Cert-Manager</strong></h2>



<p class="wp-block-paragraph">Rancher management is designed to use SSL/ TLS for a secure connection. There are three recommended options for TLS termination for Rancher.</p>



<ul class="wp-block-list">
<li>Rancher-generated TLS certificate. This option needs to install cert-manager into the cluster. Cert-manager will issue and maintain the certificate for Rancher, including generating CA certificate and signing the cert.</li>
<li>Let’s encrypt. This option also needs cert-manager and combine with Issuer Let’s Encrypt to issue cert for rancher.</li>
<li>Using own certificate. This option allows you to use private or public CA-signed certificate.</li>
</ul>



<p class="wp-block-paragraph">In this tutorial, we will use the option Rancher-generated TLS cert.</p>



<pre class="wp-block-code"><code># kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.0.4/cert-manager.crds.yaml</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1405" src="https://serverstadium.com/wp-content/uploads/2021/09/image-12.png" alt="" /></figure>



<p class="wp-block-paragraph">Create a namespace for cert-manager.</p>



<pre class="wp-block-code"><code># kubectl create namespace cert-manager</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1406" src="https://serverstadium.com/wp-content/uploads/2021/09/image-13.png" alt="" /></figure>



<p class="wp-block-paragraph">Add the Jetstack Helm repository.</p>



<pre class="wp-block-code"><code># helm repo add jetstack https://charts.jetstack.io</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1407" src="https://serverstadium.com/wp-content/uploads/2021/09/image-14.png" alt="" /></figure>



<p class="wp-block-paragraph">Update the local helm chart repository.</p>



<pre class="wp-block-code"><code># helm repo update</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1412" src="https://serverstadium.com/wp-content/uploads/2021/09/image-17.png" alt="" /></figure>



<p class="wp-block-paragraph">Now we can install the cert-manager</p>



<pre class="wp-block-code"><code>#helm install cert-manager jetstack/cert-manager  --namespace cert-manager</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1413" src="https://serverstadium.com/wp-content/uploads/2021/09/image-18.png" alt="" /></figure>



<p class="wp-block-paragraph">List pods status on cert-manager. Make sure all pods are running</p>



<pre class="wp-block-code"><code># kubectl get pods --namespace cert-manager</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1414" src="https://serverstadium.com/wp-content/uploads/2021/09/image-19.png" alt="" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Install Rancher Using Rancher-Generated Certificate</strong></h2>



<p class="wp-block-paragraph">We are ready to install rancher using self-sign certificate. We will use domain rancher.serverstadium.com for self-generated certificate just for this tutorial. Please use the following command to install Rancher.</p>



<pre class="wp-block-code"><code># helm install rancher rancher-stable/rancher --namespace cattle-system --set hostname=rancher.serverstadium.com</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1415" src="https://serverstadium.com/wp-content/uploads/2021/09/image-20.png" alt="" /></figure>



<p class="wp-block-paragraph">Monitor the deployment status using the following command.</p>



<pre class="wp-block-code"><code>#kubectl -n cattle-system rollout status deploy/rancher</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1416" src="https://serverstadium.com/wp-content/uploads/2021/09/image-21.png" alt="" /></figure>



<p class="wp-block-paragraph">After Rancher has been rolled out successfully. We can continue to the next step.</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1417" src="https://serverstadium.com/wp-content/uploads/2021/09/image-22.png" alt="" /></figure>



<pre class="wp-block-code"><code># kubectl -n cattle-system get deploy rancher</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="441" height="42" class="wp-image-1418" src="https://serverstadium.com/wp-content/uploads/2021/09/image-23.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/09/image-23.png 441w, https://serverstadium.com/wp-content/uploads/2021/09/image-23-300x29.png 300w" sizes="(max-width: 441px) 100vw, 441px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Add Port of Rancher to Load Balancer</strong></h2>



<p class="wp-block-paragraph">Now Rancher has already deployed on the server, the next step is to configure the Rancher Web UI using Load Balancer in ServerStadium Cloud.<br />Please Click Networking – Load Balancer, then Click Add New Load Balancer with the name rancher80. Fill in the field for the new load balancer as follow:</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1450" src="https://serverstadium.com/wp-content/uploads/2021/09/image-52.png" alt="" /></figure>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1451" src="https://serverstadium.com/wp-content/uploads/2021/09/image-53.png" alt="" /></figure>



<p class="wp-block-paragraph">After Load Balancer has been created with the name rancher80, edit the Load Balancer to assign it to All nodes.</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1425" src="https://serverstadium.com/wp-content/uploads/2021/09/image-30.png" alt="" /></figure>



<p class="wp-block-paragraph">Click the Assign New VM button the choose node1, node2 and ndoe3</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="501" height="243" class="wp-image-1426" src="https://serverstadium.com/wp-content/uploads/2021/09/image-31.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/09/image-31.png 501w, https://serverstadium.com/wp-content/uploads/2021/09/image-31-300x146.png 300w" sizes="(max-width: 501px) 100vw, 501px" /></figure>



<p class="wp-block-paragraph">Add new Load Balancer for port 443 with name rancher443</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1427" src="https://serverstadium.com/wp-content/uploads/2021/09/image-32.png" alt="" /></figure>



<p class="wp-block-paragraph">Edit rancher443, then assign all nodes to the load balancer as we did on rancher80.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Access from Browser</strong></h2>



<p class="wp-block-paragraph">Don’t forget to create A record of your rancher domain to the Public IP of the Load Balancer.<br />After that, you can browse the domain name from your browser. In this tutorial, we use rancher.serverstadium.com</p>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1428" src="https://serverstadium.com/wp-content/uploads/2021/09/image-33.png" alt="" /></figure>



<p class="wp-block-paragraph">Please click Proceed if you get the warning message. Insert your password, then choose default View with Multiple Cluster.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="450" height="312" class="wp-image-1429" src="https://serverstadium.com/wp-content/uploads/2021/09/image-34.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/09/image-34.png 450w, https://serverstadium.com/wp-content/uploads/2021/09/image-34-300x208.png 300w" sizes="(max-width: 450px) 100vw, 450px" /></figure>



<p class="wp-block-paragraph">Insert the Rancher Server URL</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="458" height="290" class="wp-image-1430" src="https://serverstadium.com/wp-content/uploads/2021/09/image-35.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/09/image-35.png 458w, https://serverstadium.com/wp-content/uploads/2021/09/image-35-300x190.png 300w" sizes="(max-width: 458px) 100vw, 458px" /></figure>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1431" src="https://serverstadium.com/wp-content/uploads/2021/09/image-36.png" alt="" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="612" height="219" class="wp-image-1432" src="https://serverstadium.com/wp-content/uploads/2021/09/image-37.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/09/image-37.png 612w, https://serverstadium.com/wp-content/uploads/2021/09/image-37-300x107.png 300w" sizes="(max-width: 612px) 100vw, 612px" /></figure>



<p class="wp-block-paragraph">In the next article, we can deploy a simple application and learn how to add helm repository through Rancher.</p>



<p class="wp-block-paragraph">You can <strong><a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-1/" target="_blank" rel="noreferrer noopener">re-read Part 1</a></strong> to make sure you did not miss anything.<br />Next, we will continue to deploy simple applicationa in Kubernetes <strong><a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-3/" target="_blank" rel="noreferrer noopener">part 3</a></strong></p>
<p>The post <a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-2/">High Availability Kubernetes Using RKE in ServerStadium Part 2</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>High Availability Kubernetes Using RKE in ServerStadium Part 1</title>
		<link>https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-1/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Wed, 27 Oct 2021 07:22:51 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=1387</guid>

					<description><![CDATA[<p>Kubernetes is an Opensource platform that manages workloads or containerized applications on servers.Google first developed this platform. Now it’s managed by the Cloud Native Computing Foundation (CNCF). In short, Its function is to make us easy to configure, deploy, manage, or monitor the largest scale of a containerized application in different deployment environments. Before we&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-1/">High Availability Kubernetes Using RKE in ServerStadium Part 1</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Kubernetes is an Opensource platform that manages workloads or containerized applications on servers.<br />Google first developed this platform. Now it’s managed by the Cloud Native Computing Foundation (CNCF).</p>



<p class="wp-block-paragraph">In short, Its function is to make us easy to configure, deploy, manage, or monitor the largest scale of a containerized application in different deployment environments.</p>



<p class="wp-block-paragraph">Before we talk about containers, let&#8217;s talk about Docker because Docker is a popular application that is often used with Kubernetes.</p>



<p class="wp-block-paragraph">Docker is an open-source application that only uses the required program and elements that a program needs to be a complete unit as an image.  We can use that image to run an application like Nginx, WordPress, etc.<br />The collection of these images we will call a Container.</p>



<p class="wp-block-paragraph">The container will run on a pod, where the pod is the smallest deployable unit in Kubernetes.<br />Installing Kubernetes is tricky because there are multiple ways to install it. Also, Kubernetes deployments container creation is not limited to using docker. We can use another container runtime like CoreOS, Mesos, LXC, Podman, etc.<br /><br />In RKE1 (Rancher Kubernetes Engine), we will use Docker as the container runtime to deploy Kubernetes with simple installation.</p>



<p class="wp-block-paragraph">RKE1 is a CNCF-certified Kubernetes distribution that runs within Docker Container, and it will make us easier to install Kubernetes in our infrastructure with a single YAML file.<br /><br />After Kubernetes has been installed, we will install Rancher to manage it.<br />Rancher has a nice web UI that we can use to add, manage, monitor, remove the nodes, create a deployment, create the persistent volume of Kubernetes, and many things.</p>



<p class="wp-block-paragraph">In Part 1, we will deploy Kubernetes in ServerStadium Cloud as follow:</p>



<ul class="wp-block-list">
<li>Launch at least 3 VM on the ServerStadium Cloud for High Availability workload.</li>
<li>Enable SSH passwordless login for each Kubernetes node.</li>
<li>Install docker on each node.</li>
<li>Download RKE binary file and configure the Kubernetes.</li>
</ul>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Launch at Least 3 VM on ServerStadium Cloud for High Availability Workload</strong></h2>



<p class="wp-block-paragraph">For High Availability Kubernetes, we need three VMs as Kubernetes nodes in ServerStadium Cloud. Below is the specification for every node:</p>



<p class="wp-block-paragraph">Operating System: Ubuntu 20.04<br />Memory: 4GB<br />CPU: 2 Core<br />Disk: 20 GB<br />Public IP Address only for node1 because we will install RKE from node1. <br />For node2 and node3, we only need the Private IP Address.</p>



<p class="wp-block-paragraph">Below is the IP Address of every node:<br /><strong>node1 :</strong><br />Public IP Address: 198.167.141.249<br />Private IP Address: 10.1.1.205</p>



<p class="wp-block-paragraph"><strong>node2:</strong><br />Private IP Address: 10.1.1.47</p>



<p class="wp-block-paragraph"><strong>node3 : </strong><br />Private IP Address: 10.1.1.238</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Enable SSH Passwordless Login for Each Kubernetes Node</strong></h2>



<p class="wp-block-paragraph">Before deploying RKE on the server, we must enable SSH passwordless for easy installation with a custom domain internal. Instead of remembering the IP Address, it&#8217;s easy to remember the node using its names.</p>



<pre class="wp-block-code"><code># vim /etc/hosts</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1389" src="https://serverstadium.com/wp-content/uploads/2021/09/image.png" alt="" /></figure>



<p class="wp-block-paragraph">Let’s generate the ssh key pair using the following command.</p>



<pre class="wp-block-preformatted"># ssh-keygen</pre>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-1390" src="https://serverstadium.com/wp-content/uploads/2021/09/image-1.png" alt="" width="396" height="227" /></figure>



<p class="wp-block-paragraph">After generating the ssh keypair is completed, we can upload the Public key to each node using command ssh-copy-id<br />Please run the following command from node1.</p>



<pre class="wp-block-code"><code># ssh-copy-id node3
# ssh-copy-id node2
# ssh-copy-id node1</code></pre>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-1391" src="https://serverstadium.com/wp-content/uploads/2021/09/image-2.png" alt="" width="666" height="151" /></figure>



<p class="wp-block-paragraph"><strong>Install docker on each node</strong>:<strong><br /></strong>Since we need docker for Kubernetes, we will install it on every node using the following command:</p>



<p class="wp-block-paragraph">Firstly, we need to update our repository and allow our server to access the Docker repository using HTTPS</p>



<pre class="wp-block-preformatted">sudo apt-get update &amp;&amp; sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y</pre>



<p class="wp-block-paragraph">Add a GPG key to ensure the authenticity of the software package</p>



<pre class="wp-block-preformatted"># curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -</pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="790" height="33" class="wp-image-1567" src="https://serverstadium.com/wp-content/uploads/2021/10/image.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/10/image.png 790w, https://serverstadium.com/wp-content/uploads/2021/10/image-300x13.png 300w, https://serverstadium.com/wp-content/uploads/2021/10/image-768x32.png 768w" sizes="(max-width: 790px) 100vw, 790px" /></figure>



<p class="wp-block-paragraph">Now, we can add Docker repository to our server and then install the stable Docker version using the following command :</p>



<pre id="block-0b46ee22-d40b-468e-90a2-cd60d24891a7" class="wp-block-preformatted"># sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 

# sudo apt-get update &amp;&amp; sudo apt-get install docker-ce containerd.io -y</pre>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Download RKE Binary File and Configure the Kubernetes</strong></h2>



<p class="wp-block-paragraph">Before we deploy Kubernetes on the server, we need to download rke binary from the following link.<br />Download latest rke from <a href="https://github.com/rancher/rke/releases/">https://github.com/rancher/rke/releases/</a></p>



<pre class="wp-block-code"><code># wget https://github.com/rancher/rke/releases/download/v1.2.12/rke_linux-amd64</code></pre>



<p class="wp-block-paragraph">Rename the file as rke</p>



<pre class="wp-block-code"><code> # mv rke_linux-amd64 rke</code></pre>



<p class="wp-block-paragraph">Then, make rke as executable file</p>



<pre class="wp-block-code"><code># chmod +x rke</code></pre>



<p class="wp-block-paragraph">In ServerStadium Cloud, we will create a simple cluster from three nodes using the following yml.</p>



<p class="wp-block-paragraph">Create a simple cluster.yml</p>



<pre class="wp-block-code"><code>nodes:
    - address: node1
      user: root
      internal_address: 10.1.1.205
      role: [controlplane, etcd, worker]
    - address: node2
      user: root
      internal_address: 10.1.1.47
      role: [controlplane, etcd, worker]
    - address: node3
      user: root
      internal_address: 10.1.1.238
      role: [controlplane, etcd, worker]
services:
  etcd:
    snapshot: true
    creation: 6h
    retention: 24h
# Required for external TLS termination with
# ingress-nginx v0.22+
ingress:
  provider: nginx
  options:
    use-forwarded-headers: "true"

</code></pre>



<p class="wp-block-paragraph">Save the file, then we can continue to deploy Kubernetes using the command rke up. The installation will take around 10-15 minutes.</p>



<pre class="wp-block-code"><code># ./rke up</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1394" src="https://serverstadium.com/wp-content/uploads/2021/09/image-3.png" alt="" /></figure>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1395" src="https://serverstadium.com/wp-content/uploads/2021/09/image-4.png" alt="" /></figure>



<p class="wp-block-paragraph">After the installation is completed. It will create three files, and please save them in a secure location:<br /><strong>rancher-cluster.yml</strong>: The RKE cluster configuration file that we have created previously.<br />kube_config_rancher-cluster.yml: The Kubeconfig file for the cluster.<br /><strong>rancher-cluster.rkestate</strong>: The Kubernetes Cluster State file</p>



<p class="wp-block-paragraph">If you want to know the status of the cluster node, we can use the kubectl command. <br />kubectl is a command-line tool that we can use to send a command to the Kubernetes cluster. <br />kubectl is authenticating with the Master node and making API calls to perform various management actions.<br />Copy the kube_config_rancher-cluster.yml as a config file. You can follow the following steps:</p>



<pre class="wp-block-code"><code># mkdir /root/.kube
# cp kube_config_cluster.yml /root/.kube/config</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1396" src="https://serverstadium.com/wp-content/uploads/2021/09/image-5.png" alt="" /></figure>



<p class="wp-block-paragraph">Now, install kubectl on the master node</p>



<pre class="wp-block-preformatted"># snap install kubectl --classic</pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1570" src="https://serverstadium.com/wp-content/uploads/2021/10/image-1.png" alt="" /></figure>



<p class="wp-block-paragraph">Run kubectl command to get the status of the nodes</p>



<pre class="wp-block-code"><code>#kubectl get nodes</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1398" src="https://serverstadium.com/wp-content/uploads/2021/09/image-7.png" alt="" /></figure>



<pre class="wp-block-code"><code>#kubectl get namespace</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-1399" src="https://serverstadium.com/wp-content/uploads/2021/09/image-8.png" alt="" /></figure>



<p class="wp-block-paragraph">Now it has been deployed. Next step, we will install Rancher to manage our Kubernetes Server.<br />Let&#8217;s go to continue to <strong><a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-2/" target="_blank" rel="noreferrer noopener">the next part</a></strong></p>



<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">&nbsp;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/high-availability-kubernetes-using-rke-in-serverstadium-part-1/">High Availability Kubernetes Using RKE in ServerStadium Part 1</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
