{"id":1188,"date":"2022-01-04T16:57:49","date_gmt":"2022-01-04T23:57:49","guid":{"rendered":"https:\/\/bullyrooks.com\/?p=1188"},"modified":"2022-01-04T19:57:20","modified_gmt":"2022-01-05T02:57:20","slug":"cloud-kube-setup-cloud-hosting","status":"publish","type":"post","link":"https:\/\/bullyrooks.com\/index.php\/2022\/01\/04\/cloud-kube-setup-cloud-hosting\/","title":{"rendered":"Cloud Kube | Setup Cloud Hosting"},"content":{"rendered":"\n<p>We&#8217;ve got a helm chart and associated docker image.  Now we&#8217;re going to setup a cloud kubernetes provider to deploy our application to.  <a href=\"https:\/\/okteto.com\/\">Okteto<\/a> offers a very generous kubernetes hosting platform that&#8217;s free for small developer projects.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setup Okteto<\/h2>\n\n\n\n<p>First register on okteto by creating an account via your github account.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"931\" height=\"300\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-31.png?resize=931%2C300&#038;ssl=1\" alt=\"\" class=\"wp-image-1189\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-31.png?w=931&amp;ssl=1 931w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-31.png?resize=300%2C97&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-31.png?resize=768%2C247&amp;ssl=1 768w\" sizes=\"auto, (max-width: 931px) 100vw, 931px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Now we need to connect to this kubernetes environment via command line.  You should already have kubectl installed.  Otherwise, you can find instructions on how to do that.  <a href=\"https:\/\/okteto.com\/docs\/getting-started\/index.html\">The Okteto quickstart link is a good resource<\/a>.<\/p>\n\n\n\n<p>I use kubectl, so I import the okteto kube config into my environment.  <a href=\"https:\/\/okteto.com\/docs\/cloud\/credentials\/#download-your-kubernetes-credentials-from-the-okteto-cloud-ui\">The instructions are here<\/a>.<\/p>\n\n\n\n<p>Now that we&#8217;ve got kubectl configured, we&#8217;ll need to setup our regcred so that okteto can access our images in canister.io.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ kubectl create secret --namespace bullyrooks docker-registry regcred --docker-server=https:\/\/cloud.canister.io:5000 --docker-username=${your_username} --docker-password=${your_password} --docker-email=${your_email}\nsecret\/regcred created\n<\/code><\/pre>\n\n\n\n<p>Now we can manually deploy into okteto via helm on the command line.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Deploy Manually with Helm<\/h2>\n\n\n\n<p>First add your chart repo to your local helm <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ helm repo add bullyrooks https:\/\/bullyrooks.github.io\/helm-charts\/\n\"bullyrooks\" has been added to your repositories\n<\/code><\/pre>\n\n\n\n<p>Now update the repo<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ helm repo update\nHang tight while we grab the latest from your chart repositories...\n...Successfully got an update from the \"bullyrooks\" chart repository\n\n...\nUpdate Complete. \u2388Happy Helming!\u2388\n<\/code><\/pre>\n\n\n\n<p>now double check your repo<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ helm search repo bullyrooks\nNAME                            CHART VERSION   APP VERSION     DESCRIPTION                \nbullyrooks\/cloud-application    1.0.3           1.0.3           A Helm chart for Kubernetes\n<\/code><\/pre>\n\n\n\n<p>now deploy it<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ helm install cloud-application bullyrooks\/cloud-application\nNAME: cloud-application\nLAST DEPLOYED: Mon Jan  3 17:12:09 2022\nNAMESPACE: brianrook\nSTATUS: deployed\nREVISION: 1\nNOTES:\n1. Get the application URL by running these commands:\n  export NODE_PORT=$(kubectl get --namespace brianrook -o jsonpath=\"{.spec.ports&#91;0].nodePort}\" services cloud-application)\n  export NODE_IP=$(kubectl get nodes --namespace brianrook -o jsonpath=\"{.items&#91;0].status.addresses&#91;0].address}\")\n  echo http:\/\/$NODE_IP:$NODE_PORT\n<\/code><\/pre>\n\n\n\n<p>You should see your service deployed in okteto<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"504\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-34-1024x538.png?resize=960%2C504&#038;ssl=1\" alt=\"\" class=\"wp-image-1198\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-34.png?resize=1024%2C538&amp;ssl=1 1024w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-34.png?resize=300%2C157&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-34.png?resize=768%2C403&amp;ssl=1 768w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-34.png?w=1261&amp;ssl=1 1261w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Grab the url from the endpoints section and copy that into postman to confirm you can access it<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"681\" height=\"412\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-35.png?resize=681%2C412&#038;ssl=1\" alt=\"\" class=\"wp-image-1199\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-35.png?w=681&amp;ssl=1 681w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-35.png?resize=300%2C181&amp;ssl=1 300w\" sizes=\"auto, (max-width: 681px) 100vw, 681px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>anytime that we make an update into the main branch now, we should be getting an updated chart pushed to our repository.  We can deploy that into okteto with the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ helm repo update\nHang tight while we grab the latest from your chart repositories...\n...Successfully got an update from the \"bullyrooks\" chart repository\nUpdate Complete. \u2388Happy Helming!\u2388\n\n$ helm upgrade cloud-application bullyrooks\/cloud-application\nRelease \"cloud-application\" has been upgraded. Happy Helming!\nNAME: cloud-application\nLAST DEPLOYED: Tue Jan  4 16:55:18 2022\nNAMESPACE: bullyrooks\nSTATUS: deployed\nREVISION: 2\nNOTES:\n1. Get the application URL by running these commands:\n  export NODE_PORT=$(kubectl get --namespace bullyrooks -o jsonpath=\"{.spec.ports&#91;0].nodePort}\" services cloud-application)\n  export NODE_IP=$(kubectl get nodes --namespace bullyrooks -o jsonpath=\"{.items&#91;0].status.addresses&#91;0].address}\")\n  echo http:\/\/$NODE_IP:$NODE_PORT\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"entry-summary\">\nWe&#8217;ve got a helm chart and associated docker image. Now we&#8217;re going&hellip;\n<\/div>\n<div class=\"link-more\"><a href=\"https:\/\/bullyrooks.com\/index.php\/2022\/01\/04\/cloud-kube-setup-cloud-hosting\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &ldquo;Cloud Kube | Setup Cloud Hosting&rdquo;<\/span>&hellip;<\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[82,80,55,153],"course":[149],"class_list":["post-1188","post","type-post","status-publish","format-standard","hentry","category-software-development","tag-kubectl","tag-kubernetes","tag-microservice","tag-okteto","course-kubernetes-application-hosted-in-the-cloud","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":1230,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/01\/23\/kube-cloud-pt2-database-configuration-in-kubernetes\/","url_meta":{"origin":1188,"position":0},"title":"Kube Cloud Pt2 | Database Configuration in Kubernetes","author":"Bullyrook","date":"January 23, 2022","format":false,"excerpt":"We now have an application that will connect to our MongoDB locally, but we'll need to tell it how to connect when its deployed to Okteto. Create Kubernetes Configuration First, create a secret in okteto with the database details. Run this command on your terminal. The uri should look like\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-43.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-43.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-43.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1205,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/01\/04\/kube-cloud-automate-kube-deploy\/","url_meta":{"origin":1188,"position":1},"title":"Kube Cloud | Automate Kube Deploy","author":"Bullyrook","date":"January 4, 2022","format":false,"excerpt":"Lets improve our CD pipeline by automating deployment. Update Build Pipeline I only want main to deploy on successful build. So add these lines to the end of the main.yaml github action workflow - name: Deploy uses: WyriHaximus\/github-action-helm3@v2 with: exec: | helm repo add bullyrooks https:\/\/bullyrooks.github.io\/helm-charts\/ helm repo update helm\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-36.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-36.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-36.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1258,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/02\/13\/kube-cloud-pt3-rest-interaction\/","url_meta":{"origin":1188,"position":2},"title":"Kube Cloud Pt3 | REST Interaction","author":"Bullyrook","date":"February 13, 2022","format":false,"excerpt":"Now that we've got a new service, we're going to make it discoverable via kubernetes and call it from the cloud application service. Enable Kubernetes Features Let's start a new branch in our cloud_application project $ git checkout -b kube Switched to a new branch 'kube' Edit the pom.xml and\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":1296,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/02\/19\/kube-cloud-pt4-tracing\/","url_meta":{"origin":1188,"position":3},"title":"Kube Cloud Pt4 | Tracing","author":"Bullyrook","date":"February 19, 2022","format":false,"excerpt":"For this portion we're going to use OpenTelemetry for tracing. OpenTelemetry projects intent is to solve all of the observability space in an opensource way. Unfortunately, at this time the logging and metrics portions are still in development, so we won't be able to use them. However the tracing piece\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/bullyrooks.com\/index.php\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image-35.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image-35.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image-35.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image-35.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image-35.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1242,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/02\/13\/kube-cloud-pt3-synchronous-service-interaction\/","url_meta":{"origin":1188,"position":4},"title":"Kube Cloud Pt3 | Synchronous Service Interaction","author":"Bullyrook","date":"February 13, 2022","format":false,"excerpt":"In this course I'm going to show you how to make another spring boot microservice (message-generator), deploy it with our first service (cloud-application). I'll show how cloud-application service can discover message-generator via kubernetes services, call an endpoint in message-generator with a feign based REST client as well as how to\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-45.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-45.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-45.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-45.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-45.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1402,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/03\/08\/kube-cloud-pt6-fulfill-the-consumer-contract-test-for-rest-endpoint\/","url_meta":{"origin":1188,"position":5},"title":"Kube Cloud Pt6 | Fulfill the Consumer Contract Test for REST Endpoint","author":"Bullyrook","date":"March 8, 2022","format":false,"excerpt":"Now we need to fulfill our contract with the consumer. We just need to add a few pieces that that a consumer build will trigger a provider verification. Add a Verification Workflow Go back to your branch in message-generator and add a new github action workflow called verify-changed-pact.yaml with this\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-15.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-15.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-15.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/comments?post=1188"}],"version-history":[{"count":4,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1188\/revisions"}],"predecessor-version":[{"id":1202,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1188\/revisions\/1202"}],"wp:attachment":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/media?parent=1188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/categories?post=1188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/tags?post=1188"},{"taxonomy":"course","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/course?post=1188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}