{"id":3676,"date":"2020-04-21T02:34:24","date_gmt":"2020-04-20T18:34:24","guid":{"rendered":"https:\/\/jrblog.pentaidea.com\/john\/2020\/04\/21\/k8s-cert-manager-https-tls\/"},"modified":"2020-04-21T02:34:24","modified_gmt":"2020-04-20T18:34:24","slug":"k8s-cert-manager-https-tls","status":"publish","type":"post","link":"https:\/\/john.pentaidea.com\/?p=3676","title":{"rendered":"K8s &#8211; cert-manager (https) tls"},"content":{"rendered":"<p>ENV: GKE,\u00a01.22<\/p>\n<p>Install cert-manager by kubectl<\/p>\n<pre><code>kubectl apply -f https:\/\/github.com\/cert-manager\/cert-manager\/releases\/download\/v1.9.1\/cert-manager.yaml\n<\/code><\/pre>\n<p>Create cluster issuer &#8211; &#8220;letsencrypt-prod&#8221;<\/p>\n<pre><code>kubectl apply -f cluster-issuer.yaml\n\n-- cluster-issuer.yaml --\napiVersion: cert-manager.io\/v1 \nkind: ClusterIssuer \nmetadata: \n\u00a0 name: letsencrypt-prod \nspec: \n\u00a0 acme: \n\u00a0 \u00a0 server: https:\/\/acme-v02.api.letsencrypt.org\/directory \n\u00a0 \u00a0 email: $DOMAIN_MAIL \n\u00a0 \u00a0 privateKeySecretRef: \n\u00a0 \u00a0 \u00a0 name: letsencrypt-prod \n\u00a0 \u00a0 solvers: \n\u00a0 \u00a0 - http01: \n\u00a0 \u00a0 \u00a0 \u00a0 ingress: \n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 class: nginx\n<\/code><\/pre>\n<p>Update ingress\u00a0 (get tls secret from &#8220;letsencrypt-prod&#8221;)<\/p>\n<pre><code>kubectl -n XXX apply -f ingress.yaml\n\n--- ingress.yaml ---\nmetadata: \n\u00a0 \u00a0  kubernetes.io\/ingress.class: gce \n\u00a0 \u00a0  kubernetes.io\/ingress.allow-http: \"true\" \n\u00a0 \u00a0  kubernetes.io\/ingress.global-static-ip-name: web-ip \n+\u00a0 \u00a0 cert-manager.io\/cluster-issuer: letsencrypt-prod \n spec: \n+\u00a0 tls: \n+\u00a0 \u00a0 - secretName: $WEB_SSL \n+\u00a0 \u00a0 \u00a0 hosts: \n+\u00a0 \u00a0 \u00a0 \u00a0 - $DOMAIN_NAME\n<\/code><\/pre>\n<p>Verify<\/p>\n<pre><code>kubectl -n XXX get cert,secret\n<\/code><\/pre>\n<p>And don&#8217;t worry about the &#8220;-xxxx&#8221; behind the &#8220;WEB_SSL&#8221; secret, just wait for the certificate ready: TRUE<\/p>\n<p>(Optional) Uninstall <\/p>\n<pre><code>kubectl delete -f https:\/\/github.com\/cert-manager\/cert-manager\/releases\/download\/vX.Y.Z\/cert-manager.yaml\n<\/code><\/pre>\n<p>Ref: full doc but using just Issuer inside namespace\u00a0 <a href=\"https:\/\/cert-manager.io\/docs\/tutorials\/getting-started-with-cert-manager-on-google-kubernetes-engine-using-lets-encrypt-for-ingress-ssl\/\" rev=\"en_rl_none\">https:\/\/cert-manager.io\/docs\/tutorials\/getting-started-with-cert-manager-on-google-kubernetes-engine-using-lets-encrypt-for-ingress-ssl\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>ENV: GKE,\u00a01.22<\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-3676","post","type-post","status-publish","format-standard","hentry","category-tech"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>K8s - cert-manager (https) tls - John&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/john.pentaidea.com\/?p=3676\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"K8s - cert-manager (https) tls - John&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"ENV: GKE,\u00a01.22\" \/>\n<meta property=\"og:url\" content=\"https:\/\/john.pentaidea.com\/?p=3676\" \/>\n<meta property=\"og:site_name\" content=\"John&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-20T18:34:24+00:00\" \/>\n<meta name=\"author\" content=\"jj\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"jj\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/john.pentaidea.com\/?p=3676\",\"url\":\"https:\/\/john.pentaidea.com\/?p=3676\",\"name\":\"K8s - cert-manager (https) tls - John&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/john.pentaidea.com\/#website\"},\"datePublished\":\"2020-04-20T18:34:24+00:00\",\"dateModified\":\"2020-04-20T18:34:24+00:00\",\"author\":{\"@id\":\"https:\/\/john.pentaidea.com\/#\/schema\/person\/3d2e5980a7d3023e93b91d668d2a4a4f\"},\"breadcrumb\":{\"@id\":\"https:\/\/john.pentaidea.com\/?p=3676#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/john.pentaidea.com\/?p=3676\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/john.pentaidea.com\/?p=3676#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/john.pentaidea.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"K8s &#8211; cert-manager (https) tls\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/john.pentaidea.com\/#website\",\"url\":\"https:\/\/john.pentaidea.com\/\",\"name\":\"John's Blog\",\"description\":\"\u4e16\u754c\u56e0\u601d\u7dd2\u800c\u8907\u96dc, \u4eba\u56e0\u5922\u60f3\u800c\u5049\u5927\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/john.pentaidea.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/john.pentaidea.com\/#\/schema\/person\/3d2e5980a7d3023e93b91d668d2a4a4f\",\"name\":\"jj\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/john.pentaidea.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a685414cd92056415bc823b5cfbbf95a44a98df88d8c040b18613724c1c0724b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a685414cd92056415bc823b5cfbbf95a44a98df88d8c040b18613724c1c0724b?s=96&d=mm&r=g\",\"caption\":\"jj\"},\"sameAs\":[\"https:\/\/john.pentaidea.com\"],\"url\":\"https:\/\/john.pentaidea.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"K8s - cert-manager (https) tls - John&#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/john.pentaidea.com\/?p=3676","og_locale":"en_US","og_type":"article","og_title":"K8s - cert-manager (https) tls - John&#039;s Blog","og_description":"ENV: GKE,\u00a01.22","og_url":"https:\/\/john.pentaidea.com\/?p=3676","og_site_name":"John&#039;s Blog","article_published_time":"2020-04-20T18:34:24+00:00","author":"jj","twitter_card":"summary_large_image","twitter_misc":{"Written by":"jj","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/john.pentaidea.com\/?p=3676","url":"https:\/\/john.pentaidea.com\/?p=3676","name":"K8s - cert-manager (https) tls - John&#039;s Blog","isPartOf":{"@id":"https:\/\/john.pentaidea.com\/#website"},"datePublished":"2020-04-20T18:34:24+00:00","dateModified":"2020-04-20T18:34:24+00:00","author":{"@id":"https:\/\/john.pentaidea.com\/#\/schema\/person\/3d2e5980a7d3023e93b91d668d2a4a4f"},"breadcrumb":{"@id":"https:\/\/john.pentaidea.com\/?p=3676#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/john.pentaidea.com\/?p=3676"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/john.pentaidea.com\/?p=3676#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/john.pentaidea.com\/"},{"@type":"ListItem","position":2,"name":"K8s &#8211; cert-manager (https) tls"}]},{"@type":"WebSite","@id":"https:\/\/john.pentaidea.com\/#website","url":"https:\/\/john.pentaidea.com\/","name":"John's Blog","description":"\u4e16\u754c\u56e0\u601d\u7dd2\u800c\u8907\u96dc, \u4eba\u56e0\u5922\u60f3\u800c\u5049\u5927","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/john.pentaidea.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/john.pentaidea.com\/#\/schema\/person\/3d2e5980a7d3023e93b91d668d2a4a4f","name":"jj","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/john.pentaidea.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a685414cd92056415bc823b5cfbbf95a44a98df88d8c040b18613724c1c0724b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a685414cd92056415bc823b5cfbbf95a44a98df88d8c040b18613724c1c0724b?s=96&d=mm&r=g","caption":"jj"},"sameAs":["https:\/\/john.pentaidea.com"],"url":"https:\/\/john.pentaidea.com\/?author=1"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/john.pentaidea.com\/index.php?rest_route=\/wp\/v2\/posts\/3676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/john.pentaidea.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/john.pentaidea.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/john.pentaidea.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/john.pentaidea.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3676"}],"version-history":[{"count":0,"href":"https:\/\/john.pentaidea.com\/index.php?rest_route=\/wp\/v2\/posts\/3676\/revisions"}],"wp:attachment":[{"href":"https:\/\/john.pentaidea.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/john.pentaidea.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/john.pentaidea.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}