{"id":295,"date":"2024-05-30T21:25:05","date_gmt":"2024-05-30T21:25:05","guid":{"rendered":"https:\/\/www.xircx.com\/?p=295"},"modified":"2024-06-15T03:03:16","modified_gmt":"2024-06-15T03:03:16","slug":"microk8s-rancher-awx-setup","status":"publish","type":"post","link":"https:\/\/xircx.com\/?p=295","title":{"rendered":"MicroK8s Rancher AWX Setup"},"content":{"rendered":"\n<p>This is the process I used to get a Microk8s cluster with Rancher and AWX going. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Cluster Creation<\/strong><\/p>\n\n\n\n<p>As of today you can not run Rancher on Microk8s 1.30.x you need to install a version prior to 1.29.2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo snap install microk8s --classic --channel=1.28\/stable\nsudo microk8s enable metallb storage cert-manager ingress\nsudo microk8s add-node<\/code><\/pre>\n\n\n\n<p><strong>Your output will be different<\/strong><\/p>\n\n\n\n<p>Example: <\/p>\n\n\n\n<p>From the node you wish to join to this cluster, run the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo microk8s join 192.168.1.44:25000\/dc08961950a386667d29ef345354637\/af6c07a6b78e<\/code><\/pre>\n\n\n\n<p>Verify cluster is created and ready<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo microk8s kubectl get node\n\nNAME        STATUS   ROLES    AGE     VERSION\nmicrok8s3   Ready    &lt;none&gt;   6h11m   v1.28.7\nmicrok8s2   Ready    &lt;none&gt;   6h12m   v1.28.7\nmicrok8s1   Ready    &lt;none&gt;   6h23m   v1.28.7<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Rancher Creation<\/strong><\/p>\n\n\n\n<p>Rancher Installation<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo microk8s helm3 repo add rancher-latest https:\/\/releases.rancher.com\/server-charts\/latest\nsudo microk8s helm3 repo update\nsudo microk8s kubectl create namespace cattle-system\nsudo microk8s helm3 install rancher rancher-latest\/rancher --namespace cattle-system  --set replicas=1 --set hostname=rancher.&lt;domain.com&gt;<\/code><\/pre>\n\n\n\n<p>Verify Rancher has finished installing <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo microk8s kubectl -n cattle-system rollout status deploy\/rancher<\/code><\/pre>\n\n\n\n<p>show Rancher pods<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo microk8s kubectl get pods -n cattle-system<\/code><\/pre>\n\n\n\n<p>show all pods<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo microk8s kubectl get pods --all-namespaces<\/code><\/pre>\n\n\n\n<p>Add Loadbalancer config<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo microk8s kubectl expose deployment rancher -n cattle-system --type=LoadBalancer --name=rancher-lb --port=443\nsudo microk8s kubectl describe services<\/code><\/pre>\n\n\n\n<p>Access the page by going to <a href=\"https:\/\/rancher.xircx.com\/\">https:\/\/rancher.yourdomain.com\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/ranchermanager.docs.rancher.com\/getting-started\/installation-and-upgrade\/install-upgrade-on-a-kubernetes-cluster\" data-type=\"link\" data-id=\"https:\/\/ranchermanager.docs.rancher.com\/getting-started\/installation-and-upgrade\/install-upgrade-on-a-kubernetes-cluster\">Rancher install documentation<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>AWX Operator Creation<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install git\nsudo apt install make\nsudo git clone https:\/\/github.com\/ansible\/awx-operator.git\nsudo cd awx-operator\nsudo git checkout 0.15.0<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>export NAMESPACE=awx\nsudo make deploy<\/code><\/pre>\n\n\n\n<p>Create awx.yaml deployment file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>---\napiVersion: awx.ansible.com\/v1beta1\nkind: AWX\nmetadata:\n  name: awx\nspec:\n  service_type: LoadBalancer\n  loadbalancer_port: 8443\n  loadbalancer_protocol: https<\/code><\/pre>\n\n\n\n<p>Set default context to awx-namespace<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo kubectl config set-context --current --namespace=awx<\/code><\/pre>\n\n\n\n<p>Deploy AWX and expose the service<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo kubectl apply -f awx.yaml<\/code><\/pre>\n\n\n\n<p>Monitor the deployment process<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo kubectl logs -f deployments\/awx-operator-controller-manager -c awx-manager<\/code><\/pre>\n\n\n\n<p>When deployment is done, ensure all pods are running<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo kubectl get pods<\/code><\/pre>\n\n\n\n<p>Create admin account<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo kubectl get pods\nsudo kubectl exec --container awx-web -it awx-manage createsuperuser<\/code><\/pre>\n\n\n\n<p>Some info taken from <a href=\"https:\/\/jameysteinmann.com\/ansible-awx-operator-on-ubuntu-with-microk8s\/\" data-type=\"link\" data-id=\"https:\/\/jameysteinmann.com\/ansible-awx-operator-on-ubuntu-with-microk8s\/\">Jamey Steinmann&#8217;s Blog<\/a><\/p>\n\n\n\n<p>Add the loabalancer IP through ranchers interface<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/xircx.com\/wp-content\/uploads\/2024\/05\/awx-lb-1024x572.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>Hope this helps you out!<\/p>\n<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_295\" class=\"pvc_stats all  \" data-element-id=\"295\" style=\"\"><i class=\"pvc-stats-icon small\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/xircx.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>","protected":false},"excerpt":{"rendered":"<p>This is the process I used to get a Microk8s cluster with Rancher and AWX going. Cluster Creation As of today you can not run Rancher on Microk8s 1.30.x you need to install a version prior to 1.29.2 Your output will be different Example: From the node you wish to join to this cluster, run [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":395,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","site-transparent-header":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"pgc_sgb_lightbox_settings":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-295","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"jetpack_featured_media_url":"https:\/\/xircx.com\/wp-content\/uploads\/2024\/06\/ai_image1-jpeg.webp","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/xircx.com\/index.php?rest_route=\/wp\/v2\/posts\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xircx.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xircx.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xircx.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xircx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=295"}],"version-history":[{"count":2,"href":"https:\/\/xircx.com\/index.php?rest_route=\/wp\/v2\/posts\/295\/revisions"}],"predecessor-version":[{"id":492,"href":"https:\/\/xircx.com\/index.php?rest_route=\/wp\/v2\/posts\/295\/revisions\/492"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xircx.com\/index.php?rest_route=\/wp\/v2\/media\/395"}],"wp:attachment":[{"href":"https:\/\/xircx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xircx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xircx.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}