{"id":4024,"date":"2022-06-21T09:33:36","date_gmt":"2022-06-21T01:33:36","guid":{"rendered":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/?p=4024"},"modified":"2022-06-21T09:33:42","modified_gmt":"2022-06-21T01:33:42","slug":"microk8sokd-web-console","status":"publish","type":"post","link":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/2022\/06\/microk8sokd-web-console\/","title":{"rendered":"microk8s+okd web console"},"content":{"rendered":"\n<p>\u770b\u5230\u9019\u7bc7\uff1a<a href=\"https:\/\/engineering.cloudflight.io\/running-the-openshift-console-in-plain-kubernetes\" target=\"_blank\" rel=\"noreferrer noopener\">Running the OpenShift console in plain Kubernetes<\/a><\/p>\n\n\n\n<p>\u525b\u597d\u624b\u982d\u4e0a\u6709 microk8s \uff0c\u5c31\u88dd\u4f86\u8a66\u8a66\u770b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u74b0\u5883\">\u74b0\u5883<\/h2>\n\n\n\n<p>\u4f7f\u7528 Ubuntu 22.04<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u6b65\u9a5f\">\u6b65\u9a5f<\/h2>\n\n\n\n<p>\u5148\u5b89\u88dd nodejs 16\uff0c\u6ce8\u610f\uff0c17 \u4ee5\u5f8c\u7684\u7248\u672c\u56e0\u70ba\u7528\u4e86 OpenSSL3 \uff0c\u6240\u4ee5\u7de8\u8b6f\u904e\u7a0b\u6703\u6709\u932f\u8aa4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -fsSL https:\/\/deb.nodesource.com\/setup_16.x | sudo -E bash -\nsudo apt-get install -y nodejs<\/code><\/pre>\n\n\n\n<p>\u53d6\u5f97 web console \u539f\u59cb\u78bc<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/openshift\/console.git<\/code><\/pre>\n\n\n\n<p>\u9032\u5165 console \u8cc7\u6599\u593e\uff0c\u9032\u884c\u7de8\u8b6f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/build.sh<\/code><\/pre>\n\n\n\n<p>\u518d\u4f86\u662f\u555f\u52d5<\/p>\n\n\n\n<p>\u5148\u6aa2\u67e5 default \u9019\u500b service account \u6709\u6c92\u6709 token\uff0c\u9019\u500b service account \u662f\u5728 kube-system \u9019\u500b namespace \u88e1\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get serviceaccount default --namespace=kube-system -o jsonpath='{.secrets&#91;0].name}'<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u6c92\u6709\uff0c\u5c31\u5efa\u7acb token<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl create token default -n kube-system<\/code><\/pre>\n\n\n\n<p>\u8907\u88fd\u8f38\u51fa\u7d50\u679c\uff0c\u7136\u5f8c\u5efa\u7acb secret<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl create secret generic default-token-0621 --from-literal=token=&lt;\u524d\u9762\u7684\u8f38\u51fa\u7d50\u679c><\/code><\/pre>\n\n\n\n<p>\u597d\u4e86\u4ee5\u5f8c\uff0c\u7de8\u8f2f service account<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl edit secret default-token-0621 -n kube-system<\/code><\/pre>\n\n\n\n<p>\u5728 yaml \u88e1\u52a0\u5165 secrets<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: default\n  namespace: kube-system\nsecrets:\n- name: default-token-0621<\/code><\/pre>\n\n\n\n<p>\u7d66\u6b0a\u9650<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl create clusterrolebinding default-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default<\/code><\/pre>\n\n\n\n<p>\u6700\u5f8c\u8981\u555f\u52d5\u4e86\uff0c\u56e0\u70ba\u6211\u662f\u7528 microk8s \uff0c\u5148\u53d6\u5f97 kubeconfig<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>microk8s config > ~\/.kube\/config\nexport KUBECONFIG=~\/.kube\/config\nsource .\/contrib\/environment.sh\n.\/bin\/bridge<\/code><\/pre>\n\n\n\n<p>\u9810\u8a2d\u6703\u555f\u52d5\u5728 <code>:9000<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u770b\u5230\u9019\u7bc7\uff1aRunning the OpenShift console in plain Kubernetes \u525b\u597d\u624b\u982d\u4e0a\u6709 microk8s \uff0c\u5c31\u88dd\u4f86\u8a66\u8a66\u770b\u3002 \u74b0\u5883 \u4f7f\u7528 Ubuntu 22.04 \u6b65\u9a5f \u5148\u5b89\u88dd nodejs 16\uff0c\u6ce8\u610f\uff0c17 \u4ee5\u5f8c\u7684\u7248\u672c\u56e0\u70ba\u7528\u4e86 OpenSSL3 \uff0c\u6240\u4ee5\u7de8\u8b6f\u904e\u7a0b\u6703\u6709\u932f\u8aa4\u3002 \u53d6\u5f97 web console \u539f\u59cb\u78bc \u9032\u5165 console \u8cc7\u6599\u593e\uff0c\u9032\u884c\u7de8\u8b6f \u518d\u4f86\u662f\u555f\u52d5 \u5148\u6aa2\u67e5 default \u9019\u500b service account \u6709\u6c92\u6709 token\uff0c\u9019\u500b service account \u662f\u5728 kube-system \u9019\u500b namespace \u88e1\u3002 \u5982\u679c\u6c92\u6709\uff0c\u5c31\u5efa\u7acb token \u8907\u88fd\u8f38\u51fa\u7d50\u679c\uff0c\u7136\u5f8c\u5efa\u7acb secret \u597d\u4e86\u4ee5\u5f8c\uff0c\u7de8\u8f2f service account \u5728 yaml \u88e1\u52a0\u5165 secrets \u7d66\u6b0a\u9650 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/2022\/06\/microk8sokd-web-console\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;microk8s+okd web console&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[243,244,245],"class_list":["post-4024","post","type-post","status-publish","format-standard","hentry","category-idea","tag-kubernetes","tag-microk8s","tag-okd"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2MOxp-12U","_links":{"self":[{"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/posts\/4024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/comments?post=4024"}],"version-history":[{"count":1,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/posts\/4024\/revisions"}],"predecessor-version":[{"id":4025,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/posts\/4024\/revisions\/4025"}],"wp:attachment":[{"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/media?parent=4024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/categories?post=4024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/tags?post=4024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}