{"id":1985,"date":"2022-02-02T10:51:42","date_gmt":"2022-02-02T10:51:42","guid":{"rendered":"https:\/\/blog.samarthya.me\/wps\/?p=1985"},"modified":"2022-02-02T10:51:46","modified_gmt":"2022-02-02T10:51:46","slug":"jenkins-k8s","status":"publish","type":"post","link":"https:\/\/blog.samarthya.me\/wps\/2022\/02\/02\/jenkins-k8s\/","title":{"rendered":"Jenkins: K8S"},"content":{"rendered":"\n<p>Deploying Jenkins on K8S cluster is as simple as <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"add-repo\">Add Repo<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>helm repo add jenkins https:\/\/charts.jenkins.io\nhelm repo update<\/code><\/pre>\n\n\n\n<p>Deploy instance<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>helm upgrade --install myjenkins jenkins\/jenkins -n jenkins --create-namespace<\/code><\/pre>\n\n\n\n<p>On my local machine the output is as under<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Release \"myjenkins\" does not exist. Installing it now.\nNAME: myjenkins\nLAST DEPLOYED: Wed Feb  2 10:20:57 2022\nNAMESPACE: jenkins\nSTATUS: deployed\nREVISION: 1\nNOTES:\n1. Get your 'admin' user password by running:\n  kubectl exec --namespace jenkins -it svc\/myjenkins -c jenkins -- \/bin\/cat \/run\/secrets\/chart-admin-password &amp;&amp; echo\n2. Get the Jenkins URL to visit by running these commands in the same shell:\n  echo http:\/\/127.0.0.1:8080\n  kubectl --namespace jenkins port-forward svc\/myjenkins 8080:8080\n\n3. Login with the password from step 1 and the username: admin\n4. Configure security realm and authorization strategy\n5. Use Jenkins Configuration as Code by specifying configScripts in your values.yaml file, see documentation: http:\/\/\/configuration-as-code and examples: https:\/\/github.com\/jenkinsci\/configuration-as-code-plugin\/tree\/master\/demos\n\nFor more information on running Jenkins on Kubernetes, visit:\nhttps:&#47;&#47;cloud.google.com\/solutions\/jenkins-on-container-engine\n\nFor more information about Jenkins Configuration as Code, visit:\nhttps:\/\/jenkins.io\/projects\/jcasc\/\n\n\nNOTE: Consider using a custom image with pre-installed plugins<\/code><\/pre>\n\n\n\n<p>I will deploy it over ingress to be used over the web<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"420\" src=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-02-at-4.19.38-PM-1024x420.png\" alt=\"\" class=\"wp-image-1986\" srcset=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-02-at-4.19.38-PM-1024x420.png 1024w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-02-at-4.19.38-PM-300x123.png 300w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-02-at-4.19.38-PM-1536x630.png 1536w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-02-at-4.19.38-PM-2048x840.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The password for the admin can be extracted <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl exec --namespace jenkins -it svc\/myjenkins -c jenkins -- \/bin\/cat \/run\/secrets\/chart-admin-password &amp;&amp; echo<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Deploying Jenkins on K8S cluster is as simple as Add Repo Deploy instance On my local machine the output is as under I will deploy it over ingress to be used over the web The password for the admin can be extracted<\/p>\n","protected":false},"author":1,"featured_media":1986,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[195,34],"tags":[229],"class_list":["post-1985","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-kubernetes","category-technical","tag-jenkins","post_format-post-format-image"],"_links":{"self":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/1985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/comments?post=1985"}],"version-history":[{"count":0,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/1985\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media\/1986"}],"wp:attachment":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media?parent=1985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/categories?post=1985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/tags?post=1985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}