{"id":4463,"date":"2020-02-24T10:21:51","date_gmt":"2020-02-24T10:21:51","guid":{"rendered":"https:\/\/www.thegioimaychu.vn\/blog\/?p=4463"},"modified":"2020-02-27T07:06:16","modified_gmt":"2020-02-27T07:06:16","slug":"cai-dat-va-cau-hinh-kubectl-trong-kubernetes","status":"publish","type":"post","link":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh c\u00f4ng c\u1ee5 kubectl trong Kubernetes"},"content":{"rendered":"<style>.iblink{color:#975!important;}.iblink:hover{color:orange!important;}<\/style><p>C\u00f4ng c\u1ee5 command-line trong Kubernetes,\u00a0kubectl, cho ph\u00e9p b\u1ea1n th\u1ef1c thi c\u00e1c c\u00e2u l\u1ec7nh trong Kubernetes clusters. B\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng kubectl \u0111\u1ec3 tri\u1ec3n khai c\u00e1c \u1ee9ng d\u1ee5ng, theo d\u00f5i v\u00e0 qu\u1ea3n l\u00fd t\u00e0i nguy\u00ean c\u1ee7a cluster, v\u00e0 xem log.<\/p>\n<ul id=\"markdown-toc\">\n<li><a href=\"#tr%c6%b0%e1%bb%9bc-khi-b%e1%ba%aft-%c4%91%e1%ba%a7u\">Tr\u01b0\u1edbc khi b\u1eaft \u0111\u1ea7u<\/a><\/li>\n<li><a href=\"#c%c3%a0i-%c4%91%e1%ba%b7t-kubectl-tr%c3%aan-linux\">C\u00e0i \u0111\u1eb7t kubectl tr\u00ean Linux<\/a><\/li>\n<li><a href=\"#c%c3%a0i-%c4%91%e1%ba%b7t-kubectl-tr%c3%aan-macos\">C\u00e0i \u0111\u1eb7t kubectl tr\u00ean macOS<\/a><\/li>\n<li><a href=\"#c%c3%a0i-%c4%91%e1%ba%b7t-kubectl-tr%c3%aan-windows\">C\u00e0i \u0111\u1eb7t kubectl tr\u00ean Windows<\/a><\/li>\n<li><a href=\"#t%e1%ba%a3i-xu%e1%bb%91ng-t%e1%bb%ab-m%e1%bb%99t-ph%e1%ba%a7n-c%e1%bb%a7a-google-cloud-sdk\">T\u1ea3i xu\u1ed1ng t\u1eeb m\u1ed9t ph\u1ea7n c\u1ee7a Google Cloud SDK<\/a><\/li>\n<li><a href=\"#x%c3%a1c-minh-c%e1%ba%a5u-h%c3%acnh-kubectl\">X\u00e1c minh c\u1ea5u h\u00ecnh kubectl<\/a><\/li>\n<li><a href=\"#c%c3%a1c-l%e1%bb%b1a-ch%e1%bb%8dn-c%e1%ba%a5u-h%c3%acnh-kubectl\">C\u00e1c l\u1ef1a ch\u1ecdn c\u1ea5u h\u00ecnh kubectl<\/a><\/li>\n<\/ul>\n<h2 id=\"tr\u01b0\u1edbc-khi-b\u1eaft-\u0111\u1ea7u\">Tr\u01b0\u1edbc khi b\u1eaft \u0111\u1ea7u<\/h2>\n<p>B\u1ea1n c\u1ea7n ph\u1ea3i s\u1eed d\u1ee5ng phi\u00ean b\u1ea3n kubectl sai l\u1ec7ch kh\u00f4ng qu\u00e1 m\u1ed9t phi\u00ean b\u1ea3n v\u1edbi version c\u1ee7a cluster. V\u00ed d\u1ee5, m\u1ed9t client v1.2 n\u00ean \u0111\u01b0\u1ee3c ho\u1ea1t \u0111\u1ed9ng v\u1edbi master v1.1, v1.2 v\u00e0 v1.3. S\u1eed d\u1ee5ng phi\u00ean b\u1ea3n m\u1edbi nh\u1ea5t c\u1ee7a kubectl gi\u00fap tr\u00e1nh \u0111\u01b0\u1ee3c c\u00e1c v\u1ea5n \u0111\u1ec1 kh\u00f4ng l\u01b0\u1eddng tr\u01b0\u1edbc \u0111\u01b0\u1ee3c.<\/p>\n<h2 id=\"c\u00e0i-\u0111\u1eb7t-kubectl-tr\u00ean-linux\">C\u00e0i \u0111\u1eb7t kubectl tr\u00ean Linux<\/h2>\n<h3 id=\"c\u00e0i-\u0111\u1eb7t-kubectl-binary-v\u1edbi-curl-tr\u00ean-linux\">C\u00e0i \u0111\u1eb7t kubectl binary v\u1edbi curl tr\u00ean Linux<\/h3>\n<ol>\n<li>T\u1ea3i v\u1ec1 phi\u00ean b\u1ea3n m\u1edbi nh\u1ea5t v\u1edbi c\u00e2u l\u1ec7nh:\n<pre><code>curl -LO https:\/\/storage.googleapis.com\/kubernetes-release\/release\/`curl -s https:\/\/storage.googleapis.com\/kubernetes-release\/release\/stable.txt`\/bin\/linux\/amd64\/kubectl\r\n<\/code><\/pre>\n<p>\u0110\u1ec3 t\u1ea3i v\u1ec1 phi\u00ean b\u1ea3n c\u1ee5 th\u1ec3, h\u00e3y thay th\u1ebf ph\u1ea7n\u00a0<code>$(curl -s https:\/\/storage.googleapis.com\/kubernetes-release\/release\/stable.txt)<\/code>\u00a0trong c\u00e2u l\u1ec7nh v\u1edbi m\u1ed9t phi\u00ean b\u1ea3n c\u1ee5 th\u1ec3.<\/p>\n<p>V\u00ed d\u1ee5 nh\u01b0, \u0111\u1ec3 t\u1ea3i v\u1ec1 phi\u00ean b\u1ea3n v1.17.0 tr\u00ean Linux, h\u00e3y nh\u1eadp nh\u01b0 sau:<\/p>\n<pre><code>curl -LO https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.17.0\/bin\/linux\/amd64\/kubectl\r\n<\/code><\/pre>\n<\/li>\n<li>T\u1ea1o kubectl binary th\u1ef1c thi.\n<pre><code>chmod +x .\/kubectl\r\n<\/code><\/pre>\n<\/li>\n<li>\u0110\u01b0a b\u1ea3n binary v\u00e0o bi\u1ebfn m\u00f4i tr\u01b0\u1eddng PATH c\u1ee7a b\u1ea1n.\n<pre><code>sudo mv .\/kubectl \/usr\/local\/bin\/kubectl\r\n<\/code><\/pre>\n<\/li>\n<li>Ki\u1ec3m tra ch\u1eafc ch\u1eafn r\u1eb1ng phi\u00ean b\u1ea3n b\u1ea1n c\u00e0i l\u00e0 m\u1edbi nh\u1ea5t:\n<pre><code>kubectl version\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3 id=\"c\u00e0i-\u0111\u1eb7t-kubectl-s\u1eed-d\u1ee5ng-tr\u00ecnh-qu\u1ea3n-l\u00fd-g\u00f3i\">C\u00e0i \u0111\u1eb7t kubectl s\u1eed d\u1ee5ng tr\u00ecnh qu\u1ea3n l\u00fd g\u00f3i<\/h3>\n<div id=\"kubectl-install\" class=\"ui-tabs ui-corner-all ui-widget ui-widget-content\">\n<ul class=\"ui-tabs-nav ui-corner-all ui-helper-reset ui-helper-clearfix ui-widget-header\" role=\"tablist\">\n<li class=\"ui-tabs-tab ui-corner-top ui-state-default ui-tab ui-tabs-active ui-state-active\" tabindex=\"0\" role=\"tab\" aria-controls=\"kubectl-install-0\" aria-labelledby=\"ui-id-1\" aria-selected=\"true\" aria-expanded=\"true\"><a>Ubuntu, Debian or HypriotOS<\/a><\/li>\n<li class=\"ui-tabs-tab ui-corner-top ui-state-default ui-tab\" tabindex=\"-1\" role=\"tab\" aria-controls=\"kubectl-install-1\" aria-labelledby=\"ui-id-2\" aria-selected=\"false\" aria-expanded=\"false\"><a>CentOS, RHEL or Fedora<\/a><\/li>\n<\/ul>\n<div id=\"kubectl-install-0\" class=\"ui-tabs-panel ui-corner-bottom ui-widget-content\" role=\"tabpanel\" aria-labelledby=\"ui-id-1\" aria-hidden=\"false\">\n<div class=\"highlight\">\n<pre><code class=\"language-bash\" data-lang=\"bash\">\r\nsudo apt-get update &amp;&amp; sudo apt-get install -y apt-transport-https\r\ncurl -s https:\/\/packages.cloud.google.com\/apt\/doc\/apt-key.gpg | sudo apt-key add -\r\necho \"deb https:\/\/apt.kubernetes.io\/ kubernetes-xenial main\" | sudo tee -a \/etc\/apt\/sources.list.d\/kubernetes.list\r\nsudo apt-get update\r\nsudo apt-get install -y kubectl\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<h3 id=\"c\u00e0i-\u0111\u1eb7t-v\u1edbi-snap\">C\u00e0i \u0111\u1eb7t v\u1edbi snap<\/h3>\n<p>N\u1ebfu b\u1ea1n \u0111ang s\u1eed d\u1ee5ng Ubuntu ho\u1eb7c distro Linux kh\u00e1c h\u1ed7 tr\u1ee3 tr\u00ecnh qu\u1ea3n l\u00fd g\u00f3i\u00a0<a href=\"https:\/\/snapcraft.io\/docs\/core\/install\" target=\"_blank\" rel=\"noopener\">snap<\/a>, th\u00ec kubectl \u0111\u00e3 c\u00f3 s\u1eb5n trong\u00a0<a href=\"https:\/\/snapcraft.io\/\" target=\"_blank\" rel=\"noopener\">snap<\/a>.<\/p>\n<ol>\n<li>Chuy\u1ec3n sang user snap v\u00e0 th\u1ef1c thi c\u00e2u l\u1ec7nh c\u00e0i \u0111\u1eb7t:\n<pre><code>sudo snap install kubectl --classic\r\n<\/code><\/pre>\n<\/li>\n<li>Ki\u1ec3m tra phi\u00ean b\u1ea3n b\u1ea1n v\u1eeba c\u00e0i l\u00e0 m\u1edbi nh\u1ea5t:\n<pre><code>kubectl version\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2 id=\"c\u00e0i-\u0111\u1eb7t-kubectl-tr\u00ean-macos\">C\u00e0i \u0111\u1eb7t kubectl tr\u00ean macOS<\/h2>\n<h3 id=\"c\u00e0i-\u0111\u1eb7t-kubectl-binary-v\u1edbi-curl-tr\u00ean-macos\">C\u00e0i \u0111\u1eb7t kubectl binary v\u1edbi curl tr\u00ean macOS<\/h3>\n<ol>\n<li>T\u1ea3i v\u1ec1 phi\u00ean b\u1ea3n m\u1edbi nh\u1ea5t:\n<pre><code>curl -LO \"https:\/\/storage.googleapis.com\/kubernetes-release\/release\/$(curl -s https:\/\/storage.googleapis.com\/kubernetes-release\/release\/stable.txt)\/bin\/darwin\/amd64\/kubectl\"\r\n<\/code><\/pre>\n<p>\u0110\u1ec3 t\u1ea3i v\u1ec1 phi\u00ean b\u1ea3n c\u1ee5 th\u1ec3, h\u00e3y thay th\u1ebf ph\u1ea7n\u00a0<code>$(curl -s https:\/\/storage.googleapis.com\/kubernetes-release\/release\/stable.txt)<\/code>\u00a0trong c\u00e2u l\u1ec7nh v\u1edbi phi\u00ean b\u1ea3n c\u1ee5 th\u1ec3.<\/p>\n<p>V\u00ed d\u1ee5, \u0111\u1ec3 t\u1ea3i v\u1ec1 phi\u00ean b\u1ea3n v1.17.0 tr\u00ean macOS, g\u00f5:<\/p>\n<pre><code>curl -LO https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.17.0\/bin\/darwin\/amd64\/kubectl\r\n<\/code><\/pre>\n<\/li>\n<li>T\u1ea1o kubectl binary th\u1ef1c thi.\n<pre><code>chmod +x .\/kubectl\r\n<\/code><\/pre>\n<\/li>\n<li>\u0110\u01b0a b\u1ea3n binary v\u00e0o bi\u1ebfn m\u00f4i tr\u01b0\u1eddng PATH c\u1ee7a b\u1ea1n.\n<pre><code>sudo mv .\/kubectl \/usr\/local\/bin\/kubectl\r\n<\/code><\/pre>\n<\/li>\n<li>Ki\u1ec3m tra ch\u1eafc ch\u1eafn r\u1eb1ng phi\u00ean b\u1ea3n b\u1ea1n c\u00e0i l\u00e0 m\u1edbi nh\u1ea5t:\n<pre><code>kubectl version\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3 id=\"c\u00e0i-\u0111\u1eb7t-v\u1edbi-homebrew-tr\u00ean-macos\">C\u00e0i \u0111\u1eb7t v\u1edbi Homebrew tr\u00ean macOS<\/h3>\n<p>N\u1ebfu b\u1ea1n \u0111ang tr\u00ean macOS v\u00e0 s\u1eed d\u1ee5ng tr\u00ecnh qu\u1ea3n l\u00fd g\u00f3i\u00a0<a href=\"https:\/\/brew.sh\/\" target=\"_blank\" rel=\"noopener\">Homebrew<\/a>, b\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t kubectl v\u1edbi Homebrew.<\/p>\n<ol>\n<li>Ch\u1ea1y c\u00e2u l\u1ec7nh c\u00e0i \u0111\u1eb7t:\n<pre><code>brew install kubectl \r\n<\/code><\/pre>\n<p>ho\u1eb7c<\/p>\n<pre><code>brew install kubernetes-cli\r\n<\/code><\/pre>\n<\/li>\n<li>Ki\u1ec3m tra ch\u1eafc ch\u1eafn r\u1eb1ng phi\u00ean b\u1ea3n b\u1ea1n c\u00e0i l\u00e0 m\u1edbi nh\u1ea5t:\n<pre><code>kubectl version\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3 id=\"c\u00e0i-\u0111\u1eb7t-v\u1edbi-macports-tr\u00ean-macos\">C\u00e0i \u0111\u1eb7t v\u1edbi Macports tr\u00ean macOS<\/h3>\n<p>N\u1ebfu b\u1ea1n \u0111ang tr\u00ean macOS v\u00e0 s\u1eed d\u1ee5ng tr\u00ecnh qu\u1ea3n l\u00fd g\u00f3i\u00a0<a href=\"https:\/\/macports.org\/\" target=\"_blank\" rel=\"noopener\">Macports<\/a>, b\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t kubectl v\u1edbi Macports.<\/p>\n<ol>\n<li>Ch\u1ea1y c\u00e2u l\u1ec7nh c\u00e0i \u0111\u1eb7t:\n<pre><code>sudo port selfupdate\r\nsudo port install kubectl\r\n<\/code><\/pre>\n<\/li>\n<li>Ki\u1ec3m tra ch\u1eafc ch\u1eafn r\u1eb1ng phi\u00ean b\u1ea3n b\u1ea1n c\u00e0i l\u00e0 m\u1edbi nh\u1ea5t:\n<pre><code>kubectl version\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2 id=\"c\u00e0i-\u0111\u1eb7t-kubectl-tr\u00ean-windows\">C\u00e0i \u0111\u1eb7t kubectl tr\u00ean Windows<\/h2>\n<h3 id=\"c\u00e0i-\u0111\u1eb7t-kubectl-binary-v\u1edbi-curl-tr\u00ean-windows\">C\u00e0i \u0111\u1eb7t kubectl binary v\u1edbi curl tr\u00ean Windows<\/h3>\n<ol>\n<li>T\u1ea3i v\u1ec1 phi\u00ean b\u1ea3n m\u1edbi nh\u1ea5t v1.17.0 t\u1eeb\u00a0<a href=\"https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.17.0\/bin\/windows\/amd64\/kubectl.exe\" target=\"_blank\" rel=\"noopener\">\u0111\u01b0\u1eddng d\u1eabn n\u00e0y<\/a>.Ho\u1eb7c n\u1ebfu b\u1ea1n \u0111\u00e3 c\u00e0i \u0111\u1eb7t\u00a0<code>curl<\/code>, h\u00e3y s\u1eed d\u1ee5ng c\u00e2u l\u1ec7nh sau:\n<pre><code>curl -LO https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.17.0\/bin\/windows\/amd64\/kubectl.exe\r\n<\/code><\/pre>\n<p>\u0110\u1ec3 t\u00ecm ra phi\u00ean b\u1ea3n \u1ed5n \u0111\u1ecbnh m\u1edbi nh\u1ea5t, h\u00e3y xem\u00a0<a href=\"https:\/\/storage.googleapis.com\/kubernetes-release\/release\/stable.txt\" target=\"_blank\" rel=\"noopener\">https:\/\/storage.googleapis.com\/kubernetes-release\/release\/stable.txt<\/a>.<\/li>\n<li>\u0110\u01b0a b\u1ea3n binary v\u00e0o bi\u1ebfn m\u00f4i tr\u01b0\u1eddng PATH c\u1ee7a b\u1ea1n.<\/li>\n<li>Ki\u1ec3m tra ch\u1eafn ch\u1eafn phi\u00ean b\u1ea3n\u00a0<code>kubectl<\/code>\u00a0gi\u1ed1ng v\u1edbi b\u1ea3n \u0111\u00e3 t\u1ea3i v\u1ec1:\n<pre><code>kubectl version\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<blockquote class=\"note\">\n<div><strong>Ghi ch\u00fa:<\/strong>\u00a0<a href=\"https:\/\/docs.docker.com\/docker-for-windows\/#kubernetes\" target=\"_blank\" rel=\"noopener\">Docker Desktop cho Windows<\/a>\u00a0th\u00eam phi\u00ean b\u1ea3n\u00a0<code>kubectl<\/code>\u00a0ri\u00eang c\u1ee7a n\u00f3 v\u00e0o PATH. N\u1ebfu b\u1ea1n \u0111\u00e3 c\u00e0i \u0111\u1eb7t Docker Desktop tr\u01b0\u1edbc \u0111\u00e2y, b\u1ea1n c\u00f3 th\u1ec3 c\u1ea7n \u0111\u1eb7t \u0111\u01b0\u1eddng d\u1eabn PATH c\u1ee7a b\u1ea1n tr\u01b0\u1edbc khi b\u1ea3n c\u00e0i \u0111\u1eb7t Docker Desktop th\u00eam 1 PATH v\u00e0o ho\u1eb7c lo\u1ea1i b\u1ecf\u00a0<code>kubectl<\/code>\u00a0c\u1ee7a Docker Desktop.<\/div>\n<\/blockquote>\n<h3 id=\"c\u00e0i-\u0111\u1eb7t-v\u1edbi-powershell-t\u1eeb-psgallery\">C\u00e0i \u0111\u1eb7t v\u1edbi Powershell t\u1eeb PSGallery<\/h3>\n<p>N\u1ebfu b\u1ea1n \u0111ang \u1edf tr\u00ean Windows v\u00e0 s\u1eed d\u1ee5ng tr\u00ecnh qu\u1ea3n l\u00fd g\u00f3i\u00a0<a href=\"https:\/\/www.powershellgallery.com\/\" target=\"_blank\" rel=\"noopener\">Powershell Gallery<\/a>, b\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t v\u00e0 c\u1eadp nh\u1eadt kubectl v\u1edbi Powershell.<\/p>\n<ol>\n<li>Th\u1ef1c thi c\u00e1c c\u00e2u l\u1ec7nh c\u00e0i \u0111\u1eb7t sau (h\u00e3y \u0111\u1ea3m b\u1ea3o b\u1ea1n t\u1ef1 \u0111\u1ecbnh ngh\u0129a\u00a0<code>DownloadLocation<\/code>):\n<pre><code>Install-Script -Name install-kubectl -Scope CurrentUser -Force\r\ninstall-kubectl.ps1 [-DownloadLocation &lt;path&gt;]\r\n<\/code><\/pre>\n<blockquote class=\"note\">\n<div><strong>Ghi ch\u00fa:<\/strong>\u00a0N\u1ebfu b\u1ea1n kh\u00f4ng \u0111\u1ecbnh ngh\u0129a\u00a0<code>DownloadLocation<\/code>,\u00a0<code>kubectl<\/code>\u00a0s\u1ebd \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t \u1edf th\u01b0 m\u1ee5c temp c\u1ee7a user.<\/div>\n<\/blockquote>\n<p>B\u1ea3n c\u00e0i \u0111\u1eb7t s\u1ebd t\u1ea1o ra\u00a0<code>$HOME\/.kube<\/code>\u00a0v\u00e0 h\u01b0\u1edbng d\u1eabn \u0111\u1ec3 t\u1ea1o ra file c\u1ea5u h\u00ecnh<\/li>\n<li>Ki\u1ec3m tra ch\u1eafc ch\u1eafn r\u1eb1ng phi\u00ean b\u1ea3n b\u1ea1n c\u00e0i l\u00e0 m\u1edbi nh\u1ea5t:\n<pre><code>kubectl version\r\n<\/code><\/pre>\n<blockquote class=\"note\">\n<div><strong>Ghi ch\u00fa:<\/strong>\u00a0C\u1eadp nh\u1eadt c\u1ee7a b\u1ea3n c\u00e0i \u0111\u1eb7t s\u1ebd \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n khi ch\u1ea1y l\u1ea1i c\u00e1c c\u00e2u l\u1ec7nh t\u1eeb b\u01b0\u1edbc 1.<\/div>\n<\/blockquote>\n<\/li>\n<\/ol>\n<h3 id=\"c\u00e0i-\u0111\u1eb7t-tr\u00ean-windows-s\u1eed-d\u1ee5ng-chocolatey-ho\u1eb7c-scoop\">C\u00e0i \u0111\u1eb7t tr\u00ean Windows s\u1eed d\u1ee5ng Chocolatey ho\u1eb7c Scoop<\/h3>\n<p>\u0110\u1ec3 c\u00e0i \u0111\u1eb7t kubectl tr\u00ean Windows b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng tr\u00ecnh qu\u1ea3n l\u00fd g\u00f3i\u00a0<a href=\"https:\/\/chocolatey.org\/\" target=\"_blank\" rel=\"noopener\">Chocolatey<\/a>\u00a0ho\u1eb7c b\u1ed9 c\u00e0i \u0111\u1eb7t c\u00e2u l\u1ec7nh\u00a0<a href=\"https:\/\/scoop.sh\/\" target=\"_blank\" rel=\"noopener\">Scoop<\/a>.<\/p>\n<div id=\"kubectl-win-install\" class=\"ui-tabs ui-corner-all ui-widget ui-widget-content\">\n<ul class=\"ui-tabs-nav ui-corner-all ui-helper-reset ui-helper-clearfix ui-widget-header\" role=\"tablist\">\n<li class=\"ui-tabs-tab ui-corner-top ui-state-default ui-tab ui-tabs-active ui-state-active\" tabindex=\"0\" role=\"tab\" aria-controls=\"kubectl-win-install-0\" aria-labelledby=\"ui-id-3\" aria-selected=\"true\" aria-expanded=\"true\">\n<div id=\"kubectl-win-install\" class=\"ui-tabs ui-corner-all ui-widget ui-widget-content\">\n<ul class=\"ui-tabs-nav ui-corner-all ui-helper-reset ui-helper-clearfix ui-widget-header\" role=\"tablist\">\n<li class=\"ui-tabs-tab ui-corner-top ui-state-default ui-tab ui-tabs-active ui-state-active\" tabindex=\"0\" role=\"tab\" aria-controls=\"kubectl-win-install-0\" aria-labelledby=\"ui-id-3\" aria-selected=\"true\" aria-expanded=\"true\"><a>choco<\/a><\/li>\n<\/ul>\n<div id=\"kubectl-win-install-0\" class=\"ui-tabs-panel ui-corner-bottom ui-widget-content\" role=\"tabpanel\" aria-labelledby=\"ui-id-3\" aria-hidden=\"false\">\n<pre><code>choco install kubernetes-cli\r\n<\/code><\/pre>\n<div id=\"kubectl-win-install\" class=\"ui-tabs ui-corner-all ui-widget ui-widget-content\">\n<ul class=\"ui-tabs-nav ui-corner-all ui-helper-reset ui-helper-clearfix ui-widget-header\" role=\"tablist\">\n<li class=\"ui-tabs-tab ui-corner-top ui-state-default ui-tab ui-tabs-active ui-state-active\" tabindex=\"0\" role=\"tab\" aria-controls=\"kubectl-win-install-0\" aria-labelledby=\"ui-id-3\" aria-selected=\"true\" aria-expanded=\"true\"><a>scoop<\/a><\/li>\n<\/ul>\n<div id=\"kubectl-win-install-0\" class=\"ui-tabs-panel ui-corner-bottom ui-widget-content\" role=\"tabpanel\" aria-labelledby=\"ui-id-3\" aria-hidden=\"false\">\n<pre><code>scoop install kubectl\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Ki\u1ec3m tra ch\u1eafc ch\u1eafn r\u1eb1ng phi\u00ean b\u1ea3n b\u1ea1n c\u00e0i l\u00e0 m\u1edbi nh\u1ea5t:<\/li>\n<\/ul>\n<\/div>\n<ol>\n<li>\n<pre><code>kubectl version\r\n<\/code><\/pre>\n<\/li>\n<li>Di chuy\u1ec3n t\u1edbi th\u01b0 m\u1ee5c home c\u1ee7a b\u1ea1n:\n<pre><code>cd %USERPROFILE%\r\n<\/code><\/pre>\n<\/li>\n<li>T\u1ea1o th\u01b0 m\u1ee5c\u00a0<code>.kube<\/code>:\n<pre><code>mkdir .kube\r\n<\/code><\/pre>\n<\/li>\n<li>Di chuy\u1ec3n t\u1edbi th\u01b0 m\u1ee5c\u00a0<code>.kube<\/code>\u00a0b\u1ea1n v\u1eeba m\u1edbi t\u1ea1o:\n<pre><code>cd .kube\r\n<\/code><\/pre>\n<\/li>\n<li>C\u1ea5u h\u00ecnh kubectl \u0111\u1ec3 s\u1eed d\u1ee5ng Kubernetes cluster t\u1eeb xa:\n<pre><code>New-Item config -type file\r\n<\/code><\/pre>\n<blockquote class=\"note\">\n<div><strong>Ghi ch\u00fa:<\/strong>\u00a0Ch\u1ec9nh s\u1eeda file c\u1ea5u h\u00ecnh v\u1edbi tr\u00ecnh so\u1ea1n th\u1ea3o v\u0103n b\u1ea3n, nh\u01b0 l\u00e0 Notepad.<\/div>\n<\/blockquote>\n<\/li>\n<\/ol>\n<h2 id=\"t\u1ea3i-xu\u1ed1ng-t\u1eeb-m\u1ed9t-ph\u1ea7n-c\u1ee7a-google-cloud-sdk\">T\u1ea3i xu\u1ed1ng t\u1eeb m\u1ed9t ph\u1ea7n c\u1ee7a Google Cloud SDK<\/h2>\n<p>B\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t kubectl t\u1eeb m\u1ed9t ph\u1ea7n c\u1ee7a Google Cloud SDK.<\/p>\n<ol>\n<li>C\u00e0i \u0111\u1eb7t\u00a0<a href=\"https:\/\/cloud.google.com\/sdk\/\" target=\"_blank\" rel=\"noopener\">Google Cloud SDK<\/a>.<\/li>\n<li>Th\u1ef1c thi c\u00e2u l\u1ec7nh c\u00e0i \u0111\u1eb7t\u00a0<code>kubectl<\/code>:\n<pre><code>gcloud components install kubectl\r\n<\/code><\/pre>\n<\/li>\n<li>Ki\u1ec3m tra ch\u1eafc ch\u1eafn r\u1eb1ng phi\u00ean b\u1ea3n b\u1ea1n c\u00e0i l\u00e0 m\u1edbi nh\u1ea5t:\n<pre><code>kubectl version\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2 id=\"x\u00e1c-minh-c\u1ea5u-h\u00ecnh-kubectl\">X\u00e1c minh c\u1ea5u h\u00ecnh kubectl<\/h2>\n<p>\u0110\u1ec3 kubectl t\u00ecm ki\u1ebfm v\u00e0 truy c\u1eadp Kubernetes cluster, n\u00f3 c\u1ea7n m\u1ed9t\u00a0<a>kubeconfig file<\/a>, \u0111\u01b0\u1ee3c t\u1ef1 \u0111\u1ed9ng t\u1ea1o ra khi b\u1ea1n t\u1ea1o m\u1edbi m\u1ed9t cluster s\u1eed d\u1ee5ng\u00a0<a href=\"https:\/\/github.com\/kubernetes\/kubernetes\/blob\/master\/cluster\/kube-up.sh\" target=\"_blank\" rel=\"noopener\">kube-up.sh<\/a>\u00a0ho\u1eb7c tri\u1ec3n khai th\u00e0nh c\u00f4ng m\u1ed9t Minikube cluster. M\u1eb7c \u0111\u1ecbnh th\u00ec c\u1ea5u h\u00ecnh c\u1ee7a kubectl \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh t\u1ea1i\u00a0<code>~\/.kube\/config<\/code>.<\/p>\n<p>Ki\u1ec3m tra kubectl \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh \u0111\u00fang b\u1eb1ng vi\u1ec7c xem tr\u1ea1ng th\u00e1i c\u1ee7a cluster:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">kubectl cluster-info<\/code><\/pre>\n<\/div>\n<p>N\u1ebfu b\u1ea1n tr\u00f4ng th\u1ea5y m\u1ed9t URL ph\u1ea3n h\u1ed3i, th\u00ec kubectl \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh \u0111\u00fang \u0111\u1ec3 truy c\u1eadp v\u00e0o cluster c\u1ee7a b\u1ea1n.<\/p>\n<p>N\u1ebfu b\u1ea1n tr\u00f4ng th\u1ea5y m\u1ed9t tin nh\u1eafn t\u01b0\u01a1ng t\u1ef1 b\u00ean d\u01b0\u1edbi, th\u00ec kuberctl ch\u01b0a \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh \u0111\u00fang ho\u1eb7c ch\u01b0a th\u1ec3 k\u1ebft n\u1ed1i v\u1edbi Kubernetes cluster.<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">The connection to the server &lt;server-name:port&gt; was refused - did you specify the right host or port?<\/code><\/pre>\n<\/div>\n<p>V\u00ed d\u1ee5 nh\u01b0, n\u1ebfu b\u1ea1n \u0111ang \u0111\u1ecbnh ch\u1ea1y m\u1ed9t Kubernetes cluster tr\u00ean laptop c\u1ee7a b\u1ea1n (locally), b\u1ea1n s\u1ebd c\u1ea7n m\u1ed9t c\u00f4ng c\u1ee5 nh\u01b0 Minikube \u0111\u01b0\u1ee3c c\u00e0i tr\u01b0\u1edbc \u0111\u00f3 v\u00e0 ch\u1ea1y l\u1ea1i c\u00e1c c\u00e2u l\u1ec7nh b\u00ean tr\u00ean.<\/p>\n<p>N\u1ebfu kubectl cluster-info tr\u1ea3 v\u1ec1 url nh\u01b0ng b\u1ea1n kh\u00f4ng th\u1ec3 truy c\u1eadp v\u00e0o cluster c\u1ee7a b\u1ea1n, th\u00ec h\u00e3y ki\u1ec3m tra n\u00f3 \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh \u0111\u00fang hay ch\u01b0a, b\u1eb1ng c\u00e1ch:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">kubectl cluster-info dump<\/code><\/pre>\n<\/div>\n<h2 id=\"c\u00e1c-l\u1ef1a-ch\u1ecdn-c\u1ea5u-h\u00ecnh-kubectl\">C\u00e1c l\u1ef1a ch\u1ecdn c\u1ea5u h\u00ecnh kubectl<\/h2>\n<h3 id=\"k\u00edch-ho\u1ea1t-shell-autocompletion\">K\u00edch ho\u1ea1t shell autocompletion<\/h3>\n<p>kubectl cung c\u1ea5p autocompletion h\u1ed7 tr\u1ee3 cho Bash and Zsh, gi\u00fap b\u1ea1n gi\u1ea3m thi\u1ec3u vi\u1ec7c ph\u1ea3i g\u00f5 nhi\u1ec1u c\u00e2u l\u1ec7nh.<\/p>\n<p>B\u00ean d\u01b0\u1edbi \u0111\u00e2u l\u00e0 c\u00e1c b\u01b0\u1edbc \u0111\u1ec3 thi\u1ebft l\u1eadp autocompletion cho Bash (bao g\u1ed3m s\u1ef1 kh\u00e1c nhau gi\u1eefa Linux v\u00e0 macOS) v\u00e0 Zsh.<\/p>\n<div id=\"kubectl-autocompletion\" class=\"ui-tabs ui-corner-all ui-widget ui-widget-content\">\n<h2>Bash tr\u00ean Linux<\/h2>\n<h3 id=\"gi\u1edbi-thi\u1ec7u\">Gi\u1edbi thi\u1ec7u<\/h3>\n<p>Kubelet completion script cho Bash \u0111\u01b0\u1ee3c t\u1ea1o ra v\u1edbi c\u00e2u l\u1ec7nh\u00a0<code>kubectl completion bash<\/code>. Sau khi script \u0111\u01b0\u1ee3c t\u1ea1o ra, b\u1ea1n c\u1ea7n source (th\u1ef1c thi) script \u0111\u00f3 \u0111\u1ec3 k\u00edch ho\u1ea1t t\u00ednh n\u0103ng autocompletion.<\/p>\n<p>Tuy nhi\u00ean, completion script ph\u1ee5 thu\u1ed9c v\u00e0o\u00a0<a href=\"https:\/\/github.com\/scop\/bash-completion\" target=\"_blank\" rel=\"noopener\"><strong>bash-completion<\/strong><\/a>, n\u00ean b\u1ea1n ph\u1ea3i c\u00e0i \u0111\u1eb7t bash-completion tr\u01b0\u1edbc \u0111\u00f3 (ki\u1ec3m tra bash-completion t\u1ed3n t\u1ea1i v\u1edbi c\u00e2u l\u1ec7nh\u00a0<code>type _init_completion<\/code>).<\/p>\n<h3 id=\"c\u00e0i-\u0111\u1eb7t-bash-completion\">C\u00e0i \u0111\u1eb7t bash-completion<\/h3>\n<p>bash-completion \u0111\u01b0\u1ee3c cung c\u1ea5p b\u1edfi nhi\u1ec1u tr\u00ecnh qu\u1ea3n l\u00fd g\u00f3i (xem t\u1ea1i\u00a0<a href=\"https:\/\/github.com\/scop\/bash-completion#installation\" target=\"_blank\" rel=\"noopener\">\u0111\u00e2y<\/a>). B\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t v\u1edbi l\u1ec7nh\u00a0<code>apt-get install bash-completion<\/code>\u00a0ho\u1eb7c\u00a0<code>yum install bash-completion<\/code>.<\/p>\n<p>C\u00e1c l\u1ec7nh tr\u00ean t\u1ea1o ra\u00a0<code>\/usr\/share\/bash-completion\/bash_completion<\/code>, \u0111\u00e2y l\u00e0 script ch\u00ednh c\u1ee7a bash-completion. T\u00f9y thu\u1ed9c v\u00e0o tr\u00ecnh qu\u1ea3n l\u00fd g\u00f3i c\u1ee7a b\u1ea1n, m\u00e0 b\u1ea1n ph\u1ea3i source (th\u1ef1c thi) file n\u00e0y trong file\u00a0<code>~\/.bashrc<\/code>.<\/p>\n<p>\u0110\u1ec3 t\u00ecm ra file n\u00e0y, reload l\u1ea1i shell hi\u1ec7n t\u1ea1i c\u1ee7a b\u1ea1n v\u00e0 ch\u1ea1y l\u1ec7nh\u00a0<code>type _init_completion<\/code>. N\u1ebfu th\u00e0nh c\u00f4ng, b\u1ea1n \u0111\u00e3 thi\u1ebft l\u1eadp xong, kh\u00f4ng th\u00ec h\u00e3y th\u00eam \u0111o\u1ea1n sau v\u00e0o file\u00a0<code>~\/.bashrc<\/code>\u00a0c\u1ee7a b\u1ea1n:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">source \/usr\/share\/bash-completion\/bash_completion<\/code><\/pre>\n<\/div>\n<p>Reload l\u1ea1i shell c\u1ee7a b\u1ea1n v\u00e0 x\u00e1c nh\u1eadn bash-completion \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t \u0111\u00fang b\u1eb1ng l\u1ec7nh\u00a0<code>type _init_completion<\/code>.<\/p>\n<h3 id=\"k\u00edch-ho\u1ea1t-kubectl-autocompletion\">K\u00edch ho\u1ea1t kubectl autocompletion<\/h3>\n<p>B\u00e2y gi\u1edd b\u1ea1n c\u1ea7n \u0111\u1ea3m b\u1ea3o r\u1eb1ng kubectl completion script \u0111\u01b0\u1ee3c sourced tr\u00ean t\u1ea5t c\u1ea3 c\u00e1c session c\u1ee7a shell. C\u00f3 2 c\u00e1ch \u0111\u1ec3 l\u00e0m vi\u1ec7c n\u00e0y:<\/p>\n<ul>\n<li>Source script trong file\u00a0<code>~\/.bashrc<\/code>:\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">echo 'source &lt;(kubectl completion bash)' &gt;&gt;~\/.bashrc<\/code><\/pre>\n<\/div>\n<\/li>\n<li>Th\u00eam script v\u00e0o th\u01b0 m\u1ee5c\u00a0<code>\/etc\/bash_completion.d<\/code>:\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">kubectl completion bash &gt;\/etc\/bash_completion.d\/kubectl<\/code><\/pre>\n<\/div>\n<\/li>\n<li>N\u1ebfu b\u1ea1n c\u00f3 m\u1ed9t alias cho kubectl, b\u1ea1n c\u00f3 th\u1ec3 th\u00eam m\u1ed9t shell completion n\u1eefa cho alias \u0111\u00f3:\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">echo 'alias k=kubectl' &gt;&gt;~\/.bashrc\r\necho 'complete -F __start_kubectl k' &gt;&gt;~\/.bashrc<\/code><\/pre>\n<\/div>\n<\/li>\n<\/ul>\n<blockquote class=\"note\">\n<div><strong>Ghi ch\u00fa:<\/strong>\u00a0bash-completion sources t\u1ea5t c\u1ea3 completion scripts trong\u00a0<code>\/etc\/bash_completion.d<\/code>.<\/div>\n<\/blockquote>\n<p>C\u00e1c c\u00e1ch tr\u00ean \u0111\u1ec1u hi\u1ec7u qu\u1ea3 t\u01b0\u01a1ng \u0111\u01b0\u01a1ng nhau. Sau khi reload l\u1ea1i shell, kubectl autocompletion s\u1ebd l\u00e0m vi\u1ec7c.<\/p>\n<h2>Bash tr\u00ean macOS<\/h2>\n<h3 id=\"gi\u1edbi-thi\u1ec7u\">Gi\u1edbi thi\u1ec7u<\/h3>\n<p>Kubectl completion script tr\u00ean Bash \u0111\u01b0\u1ee3c t\u1ea1o ra b\u1edfi\u00a0<code>kubectl completion bash<\/code>. Source script n\u00e0y s\u1ebd k\u00edch ho\u1ea1t t\u00ednh n\u0103ng kubectl completion.<\/p>\n<p>Tuy nhi\u00ean, kubectl completion script ph\u1ee5 thu\u1ed9c v\u00e0o\u00a0<a href=\"https:\/\/github.com\/scop\/bash-completion\" target=\"_blank\" rel=\"noopener\"><strong>bash-completion<\/strong><\/a>\u00a0m\u00e0 b\u1ea1n c\u00e0i tr\u01b0\u1edbc \u0111\u00f3.<\/p>\n<blockquote class=\"warning\">\n<div><strong>C\u1ea3nh b\u00e1o:<\/strong>\u00a0C\u00f3 2 phi\u00ean b\u1ea3n c\u1ee7a bash-completion l\u00e0 v1 v\u00e0 v2. V1 d\u00e0nh cho Bash 3.2 (Bash m\u1eb7c \u0111\u1ecbnh tr\u00ean macOS), v\u00e0 v2 d\u00e0nh cho Bash 4.1+. Kubectl completion script\u00a0<strong>kh\u00f4ng l\u00e0m vi\u1ec7c<\/strong>\u00a0ph\u00f9 h\u1ee3p v\u1edbi bash-completion v1 v\u00e0 Bash 3.2. N\u00f3 t\u01b0\u01a1ng th\u00edch v\u1edbi\u00a0<strong>bash-completion v2<\/strong>\u00a0v\u00e0\u00a0<strong>Bash 4.1+<\/strong>. V\u00ec v\u1eady, \u0111\u1ec3 s\u1eed d\u1ee5ng kubectl completion m\u1ed9t c\u00e1ch ch\u00ednh x\u00e1c tr\u00ean macOS th\u00ec b\u1ea1n ph\u1ea3i c\u00e0i \u0111\u1eb7t Bash 4.1+ (<a href=\"https:\/\/itnext.io\/upgrading-bash-on-macos-7138bd1066ba\" target=\"_blank\" rel=\"noopener\"><em>h\u01b0\u1edbng d\u1eabn<\/em><\/a>). H\u01b0\u1edbng d\u1eabn ti\u1ebfp theo gi\u1ea3 \u0111\u1ecbnh r\u1eb1ng b\u1ea1n \u0111ang s\u1eed d\u1ee5ng Bash 4.1+ (ngh\u0129a l\u00e0, b\u1ea5t k\u1ef3 phi\u00ean b\u1ea3n Bash n\u00e0o t\u1eeb 4.1 tr\u1edf l\u00ean).<\/div>\n<\/blockquote>\n<h3 id=\"c\u00e0i-\u0111\u1eb7t-bash-completion\">C\u00e0i \u0111\u1eb7t bash-completion<\/h3>\n<blockquote class=\"note\">\n<div><strong>Ghi ch\u00fa:<\/strong>\u00a0Nh\u01b0 \u0111\u00e3 \u0111\u1ec1 c\u1eadp, nh\u1eefng h\u01b0\u1edbng d\u1eabn n\u00e0y gi\u1ea3 \u0111\u1ecbnh b\u1ea1n \u0111ang s\u1eed d\u1ee5ng Bash 4.1+, c\u00f3 ngh\u0129a r\u1eb1ng b\u1ea1n s\u1ebd c\u00e0i \u0111\u1eb7t bash-completion v2 (tr\u00e1i ng\u01b0\u1ee3c v\u1edbi Bash 3.2 v\u00e0 bash-completion v1, trong tr\u01b0\u1eddng h\u1ee3p \u0111\u00f3, kubectl completion s\u1ebd kh\u00f4ng ho\u1ea1t \u0111\u1ed9ng).<\/div>\n<\/blockquote>\n<p>B\u1ea1n c\u00f3 th\u1ec3 ki\u1ec3m tra bash-completion v2 \u0111\u00e3 c\u00e0i \u0111\u1eb7t tr\u01b0\u1edbc \u0111\u00f3 ch\u01b0a v\u1edbi l\u1ec7nh\u00a0<code>type _init_completion<\/code>. N\u1ebfu ch\u01b0a, b\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t n\u00f3 v\u1edbi Homebrew:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">brew install bash-completion@2<\/code><\/pre>\n<\/div>\n<p>T\u1eeb \u0111\u1ea7u ra c\u1ee7a l\u1ec7nh n\u00e0y, h\u00e3y th\u00eam \u0111o\u1ea1n sau v\u00e0o file\u00a0<code>~\/.bashrc<\/code>\u00a0c\u1ee7a b\u1ea1n:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">export BASH_COMPLETION_COMPAT_DIR=\"\/usr\/local\/etc\/bash_completion.d\"\r\n[[ -r \"\/usr\/local\/etc\/profile.d\/bash_completion.sh\" ]] &amp;&amp; . \"\/usr\/local\/etc\/profile.d\/bash_completion.sh\"<\/code><\/pre>\n<\/div>\n<p>T\u1ea3i l\u1ea1i shell c\u1ee7a b\u1ea1n v\u00e0 x\u00e1c minh r\u1eb1ng bash-completion v2 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t ch\u00ednh x\u00e1c ch\u01b0a b\u1eb1ng l\u1ec7nh\u00a0<code>type _init_completion<\/code>.<\/p>\n<h3 id=\"k\u00edch-ho\u1ea1t-kubectl-autocompletion\">K\u00edch ho\u1ea1t kubectl autocompletion<\/h3>\n<p>B\u00e2y gi\u1edd b\u1ea1n ph\u1ea3i \u0111\u1ea3m b\u1ea3o r\u1eb1ng kubectl completion script \u0111\u00e3 \u0111\u01b0\u1ee3c sourced trong t\u1ea5t c\u1ea3 c\u00e1c phi\u00ean shell c\u1ee7a b\u1ea1n. C\u00f3 nhi\u1ec1u c\u00e1ch \u0111\u1ec3 \u0111\u1ea1t \u0111\u01b0\u1ee3c \u0111i\u1ec1u n\u00e0y:<\/p>\n<ul>\n<li>Source completion script trong file\u00a0<code>~\/.bashrc<\/code>:\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">echo 'source &lt;(kubectl completion bash)' &gt;&gt;~\/.bashrc<\/code><\/pre>\n<\/div>\n<\/li>\n<li>Th\u00eam completion script v\u00e0o th\u01b0 m\u1ee5c\u00a0<code>\/usr\/local\/etc\/bash_completion.d<\/code>:\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">kubectl completion bash &gt;\/usr\/local\/etc\/bash_completion.d\/kubectl<\/code><\/pre>\n<\/div>\n<\/li>\n<li>N\u1ebfu b\u1ea1n c\u00f3 alias cho kubectl, b\u1ea1n c\u00f3 th\u1ec3 m\u1edf r\u1ed9ng shell completion \u0111\u1ec3 l\u00e0m vi\u1ec7c v\u1edbi alias \u0111\u00f3:\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">echo 'alias k=kubectl' &gt;&gt;~\/.bashrc\r\necho 'complete -F __start_kubectl k' &gt;&gt;~\/.bashrc<\/code><\/pre>\n<\/div>\n<\/li>\n<li>N\u1ebfu b\u1ea1n \u0111\u00e3 c\u00e0i kubectl v\u1edbi Homebrew (nh\u01b0 \u0111\u00e3 gi\u1edbi thi\u1ec7u\u00a0<a href=\"https:\/\/kubernetes.io\/vi\/docs\/tasks\/tools\/#install-with-homebrew-on-macos\">b\u00ean tr\u00ean<\/a>)) th\u00ec kubectl completion script s\u1ebd c\u00f3 trong\u00a0<code>\/usr\/local\/etc\/bash_completion.d\/kubectl<\/code>. Trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y th\u00ec b\u1ea1n kh\u00f4ng c\u1ea7n l\u00e0m g\u00ec c\u1ea3.<\/li>\n<\/ul>\n<blockquote class=\"note\">\n<div><strong>Ghi ch\u00fa:<\/strong>\u00a0C\u00e0i \u0111\u1eb7t theo c\u00e1ch Homebrew \u0111\u00e3 source t\u1ea5t c\u1ea3 c\u00e1c t\u1ec7p trong th\u01b0 m\u1ee5c\u00a0<code>BASH_COMPLETION_COMPAT_DIR<\/code>, \u0111\u00f3 l\u00e0 l\u00fd do t\u1ea1i sao hai ph\u01b0\u01a1ng th\u1ee9c sau ho\u1ea1t \u0111\u1ed9ng.<\/div>\n<\/blockquote>\n<p>Trong m\u1ecdi tr\u01b0\u1eddng h\u1ee3p, sau khi t\u1ea3i l\u1ea1i shell c\u1ee7a b\u1ea1n, kubectl completion s\u1ebd ho\u1ea1t \u0111\u1ed9ng.<\/p>\n<h2>Zsh<\/h2>\n<div id=\"kubectl-autocompletion-2\" class=\"ui-tabs-panel ui-corner-bottom ui-widget-content\" role=\"tabpanel\" aria-labelledby=\"ui-id-7\" aria-hidden=\"false\">\n<p>Kubectl completion script cho Zsh \u0111\u01b0\u1ee3c t\u1ea1o ra v\u1edbi l\u1ec7nh\u00a0<code>kubectl completion zsh<\/code>. Source completion script trong shell c\u1ee7a b\u1ea1n s\u1ebd k\u00edch ho\u1ea1t kubectl autocompletion.<\/p>\n<p>\u0110\u1ec3 n\u00f3 ho\u1ea1t \u0111\u1ed9ng cho t\u1ea5t c\u1ea3 c\u00e1c shell, th\u00eam d\u00f2ng sau v\u00e0o file\u00a0<code>~\/.zshrc<\/code>:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">source &lt;(kubectl completion zsh)<\/code><\/pre>\n<\/div>\n<p>N\u1ebfu b\u1ea1n c\u00f3 alias cho kubectl, b\u1ea1n c\u00f3 th\u1ec3 m\u1edf r\u1ed9ng shell completion \u0111\u1ec3 l\u00e0m vi\u1ec7c v\u1edbi alias \u0111\u00f3:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">echo 'alias k=kubectl' &gt;&gt;~\/.zshrc\r\necho 'complete -F __start_kubectl k' &gt;&gt;~\/.zshrc<\/code><\/pre>\n<\/div>\n<p>Sau khi t\u1ea3i l\u1ea1i shell, kubectl autocompletion s\u1ebd ho\u1ea1t \u0111\u1ed9ng.<\/p>\n<p>N\u1ebfu b\u1ea1n nh\u1eadn \u0111\u01b0\u1ee3c l\u1ed7i\u00a0<code>complete:13: command not found: compdef<\/code>, th\u00eam d\u00f2ng sau v\u00e0o \u0111\u1ea7u file\u00a0<code>~\/.zshrc<\/code>:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-shell\" data-lang=\"shell\">autoload -Uz compinit\r\ncompinit<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p><em>Ngu\u1ed3n\u00a0<\/em>kubernetes.io<\/p>\n<div>____<br \/><b>B\u00e0i vi\u1ebft li\u00ean quan<\/b><\/div>\n<ul>\n<li><a href=\"https:\/\/thegioimaychu.vn\/blog\/?post_type=post&#038;p=20284\">H\u01b0\u1edbng d\u1eabn l\u1ef1a ch\u1ecdn GPU ph\u00f9 h\u1ee3p cho AI, Machine Learning<\/a><\/li>\n<li><a href=\"https:\/\/thegioimaychu.vn\/blog\/?post_type=post&#038;p=19042\">H\u01b0\u1edbng d\u1eabn build m\u1ed9t c\u1ee5m GPU cho AI<\/a><\/li>\n<li><a href=\"https:\/\/thegioimaychu.vn\/blog\/?post_type=post&#038;p=19416\">\u0110\u01a1n gi\u1ea3n h\u00f3a ph\u00e1t tri\u1ec3n Generative AI tu\u1ef3 ch\u1ec9nh v\u1edbi NVIDIA NeMo Microservices<\/a><\/li>\n<li><a href=\"https:\/\/thegioimaychu.vn\/blog\/?post_type=post&#038;p=17069\">T\u1ea1i sao Kubernetes ch\u00ednh l\u00e0 n\u1ec1n t\u1ea3ng d\u00e0nh cho Generative AI?<\/a><\/li>\n<li><a href=\"https:\/\/thegioimaychu.vn\/blog\/?post_type=post&#038;p=16833\">C\u00e1ch tri\u1ec3n khai chatbot GPT tr\u00ean K8s v\u1edbi giao di\u1ec7n Gradio<\/a><\/li>\n<li><a href=\"https:\/\/thegioimaychu.vn\/blog\/?post_type=post&#038;p=13804\">Tri\u1ec3n khai VMware Tanzu for Kubernetes Operations tr\u00ean Dell VxRail<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>C&ocirc;ng c&#7909; command-line trong Kubernetes,&nbsp;kubectl, cho ph&eacute;p b&#7841;n th&#7921;c thi c&aacute;c c&acirc;u l&#7879;nh trong Kubernetes clusters. B&#7841;n c&oacute; th&#7875; s&#7917; d&#7909;ng kubectl &#273;&#7875; tri&#7875;n khai c&aacute;c &#7913;ng d&#7909;ng, theo d&otilde;i v&agrave; qu&#7843;n l&yacute; t&agrave;i nguy&ecirc;n c&#7911;a cluster, v&agrave; xem log. Tr&#432;&#7899;c khi b&#7855;t &#273;&#7847;u C&agrave;i &#273;&#7863;t kubectl tr&ecirc;n Linux C&agrave;i &#273;&#7863;t kubectl tr&ecirc;n macOS C&agrave;i&#8230;<\/p>\n","protected":false},"author":2,"featured_media":4464,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[2,1],"tags":[83,307,164],"class_list":["post-4463","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ao-hoa","category-tong-hop","tag-container","tag-guide","tag-kubernetes"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh c\u00f4ng c\u1ee5 kubectl trong Kubernetes - Blog | TheGioiMayChu<\/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:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh c\u00f4ng c\u1ee5 kubectl trong Kubernetes - Blog | TheGioiMayChu\" \/>\n<meta name=\"twitter:description\" content=\"C&ocirc;ng c&#7909; command-line trong Kubernetes,&nbsp;kubectl, cho ph&eacute;p b&#7841;n th&#7921;c thi c&aacute;c c&acirc;u l&#7879;nh trong Kubernetes clusters. B&#7841;n c&oacute; th&#7875; s&#7917; d&#7909;ng kubectl &#273;&#7875; tri&#7875;n khai c&aacute;c &#7913;ng d&#7909;ng, theo d&otilde;i v&agrave; qu&#7843;n l&yacute; t&agrave;i nguy&ecirc;n c&#7911;a cluster, v&agrave; xem log. Tr&#432;&#7899;c khi b&#7855;t &#273;&#7847;u C&agrave;i &#273;&#7863;t kubectl tr&ecirc;n Linux C&agrave;i &#273;&#7863;t kubectl tr&ecirc;n macOS C&agrave;i...\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/thegioimaychu.vn\/blog\/wp-content\/uploads\/2020\/02\/1_xFsO5VOqnoGR9hXR_WYkUg1.png\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vanito Hoang\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/\"},\"author\":{\"name\":\"Vanito Hoang\",\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/#\\\/schema\\\/person\\\/feccec179330cfebfaa805639a357d18\"},\"headline\":\"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh c\u00f4ng c\u1ee5 kubectl trong Kubernetes\",\"datePublished\":\"2020-02-24T10:21:51+00:00\",\"dateModified\":\"2020-02-27T07:06:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/\"},\"wordCount\":2622,\"publisher\":{\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/1_xFsO5VOqnoGR9hXR_WYkUg1.png\",\"keywords\":[\"container\",\"guide\",\"kubernetes\"],\"articleSection\":[\"\u1ea2o H\u00f3a\",\"T\u1ed5ng h\u1ee3p\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/\",\"url\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/\",\"name\":\"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh c\u00f4ng c\u1ee5 kubectl trong Kubernetes - Blog | TheGioiMayChu\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/1_xFsO5VOqnoGR9hXR_WYkUg1.png\",\"datePublished\":\"2020-02-24T10:21:51+00:00\",\"dateModified\":\"2020-02-27T07:06:16+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/1_xFsO5VOqnoGR9hXR_WYkUg1.png\",\"contentUrl\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/1_xFsO5VOqnoGR9hXR_WYkUg1.png\",\"width\":1274,\"height\":692},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/ao-hoa\\\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Trang ch\u1ee7\",\"item\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u1ea2o H\u00f3a\",\"item\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/.\\\/ao-hoa\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh c\u00f4ng c\u1ee5 kubectl trong Kubernetes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/\",\"name\":\"Blog | TheGioiMayChu\",\"description\":\"C\u1eadp nh\u1eadt xu h\u01b0\u1edbng c\u00f4ng ngh\u1ec7 m\u00e1y ch\u1ee7\",\"publisher\":{\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/#organization\",\"name\":\"Blog | TheGioiMayChu\",\"url\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/cropped-ntcnlog-logo-2.png\",\"contentUrl\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/cropped-ntcnlog-logo-2.png\",\"width\":500,\"height\":73,\"caption\":\"Blog | TheGioiMayChu\"},\"image\":{\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/thegioimaychu\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/#\\\/schema\\\/person\\\/feccec179330cfebfaa805639a357d18\",\"name\":\"Vanito Hoang\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e8187f37f72d74f9380a1367c8c530debee44f226a3301f0765c68f7cc1f3fa4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e8187f37f72d74f9380a1367c8c530debee44f226a3301f0765c68f7cc1f3fa4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e8187f37f72d74f9380a1367c8c530debee44f226a3301f0765c68f7cc1f3fa4?s=96&d=mm&r=g\",\"caption\":\"Vanito Hoang\"},\"url\":\"https:\\\/\\\/thegioimaychu.vn\\\/blog\\\/author\\\/vanito\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh c\u00f4ng c\u1ee5 kubectl trong Kubernetes - Blog | TheGioiMayChu","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:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/","twitter_card":"summary_large_image","twitter_title":"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh c\u00f4ng c\u1ee5 kubectl trong Kubernetes - Blog | TheGioiMayChu","twitter_description":"C&ocirc;ng c&#7909; command-line trong Kubernetes,&nbsp;kubectl, cho ph&eacute;p b&#7841;n th&#7921;c thi c&aacute;c c&acirc;u l&#7879;nh trong Kubernetes clusters. B&#7841;n c&oacute; th&#7875; s&#7917; d&#7909;ng kubectl &#273;&#7875; tri&#7875;n khai c&aacute;c &#7913;ng d&#7909;ng, theo d&otilde;i v&agrave; qu&#7843;n l&yacute; t&agrave;i nguy&ecirc;n c&#7911;a cluster, v&agrave; xem log. Tr&#432;&#7899;c khi b&#7855;t &#273;&#7847;u C&agrave;i &#273;&#7863;t kubectl tr&ecirc;n Linux C&agrave;i &#273;&#7863;t kubectl tr&ecirc;n macOS C&agrave;i...","twitter_image":"https:\/\/thegioimaychu.vn\/blog\/wp-content\/uploads\/2020\/02\/1_xFsO5VOqnoGR9hXR_WYkUg1.png","twitter_misc":{"Written by":"Vanito Hoang","Est. reading time":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/#article","isPartOf":{"@id":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/"},"author":{"name":"Vanito Hoang","@id":"https:\/\/thegioimaychu.vn\/blog\/#\/schema\/person\/feccec179330cfebfaa805639a357d18"},"headline":"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh c\u00f4ng c\u1ee5 kubectl trong Kubernetes","datePublished":"2020-02-24T10:21:51+00:00","dateModified":"2020-02-27T07:06:16+00:00","mainEntityOfPage":{"@id":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/"},"wordCount":2622,"publisher":{"@id":"https:\/\/thegioimaychu.vn\/blog\/#organization"},"image":{"@id":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/#primaryimage"},"thumbnailUrl":"https:\/\/thegioimaychu.vn\/blog\/wp-content\/uploads\/2020\/02\/1_xFsO5VOqnoGR9hXR_WYkUg1.png","keywords":["container","guide","kubernetes"],"articleSection":["\u1ea2o H\u00f3a","T\u1ed5ng h\u1ee3p"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/","url":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/","name":"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh c\u00f4ng c\u1ee5 kubectl trong Kubernetes - Blog | TheGioiMayChu","isPartOf":{"@id":"https:\/\/thegioimaychu.vn\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/#primaryimage"},"image":{"@id":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/#primaryimage"},"thumbnailUrl":"https:\/\/thegioimaychu.vn\/blog\/wp-content\/uploads\/2020\/02\/1_xFsO5VOqnoGR9hXR_WYkUg1.png","datePublished":"2020-02-24T10:21:51+00:00","dateModified":"2020-02-27T07:06:16+00:00","breadcrumb":{"@id":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/#primaryimage","url":"https:\/\/thegioimaychu.vn\/blog\/wp-content\/uploads\/2020\/02\/1_xFsO5VOqnoGR9hXR_WYkUg1.png","contentUrl":"https:\/\/thegioimaychu.vn\/blog\/wp-content\/uploads\/2020\/02\/1_xFsO5VOqnoGR9hXR_WYkUg1.png","width":1274,"height":692},{"@type":"BreadcrumbList","@id":"https:\/\/thegioimaychu.vn\/blog\/ao-hoa\/cai-dat-va-cau-hinh-kubectl-trong-kubernetes-p4463\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Trang ch\u1ee7","item":"https:\/\/thegioimaychu.vn\/blog\/"},{"@type":"ListItem","position":2,"name":"\u1ea2o H\u00f3a","item":"https:\/\/thegioimaychu.vn\/blog\/.\/ao-hoa\/"},{"@type":"ListItem","position":3,"name":"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh c\u00f4ng c\u1ee5 kubectl trong Kubernetes"}]},{"@type":"WebSite","@id":"https:\/\/thegioimaychu.vn\/blog\/#website","url":"https:\/\/thegioimaychu.vn\/blog\/","name":"Blog | TheGioiMayChu","description":"C\u1eadp nh\u1eadt xu h\u01b0\u1edbng c\u00f4ng ngh\u1ec7 m\u00e1y ch\u1ee7","publisher":{"@id":"https:\/\/thegioimaychu.vn\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thegioimaychu.vn\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/thegioimaychu.vn\/blog\/#organization","name":"Blog | TheGioiMayChu","url":"https:\/\/thegioimaychu.vn\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thegioimaychu.vn\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/thegioimaychu.vn\/blog\/wp-content\/uploads\/2018\/08\/cropped-ntcnlog-logo-2.png","contentUrl":"https:\/\/thegioimaychu.vn\/blog\/wp-content\/uploads\/2018\/08\/cropped-ntcnlog-logo-2.png","width":500,"height":73,"caption":"Blog | TheGioiMayChu"},"image":{"@id":"https:\/\/thegioimaychu.vn\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/thegioimaychu\/"]},{"@type":"Person","@id":"https:\/\/thegioimaychu.vn\/blog\/#\/schema\/person\/feccec179330cfebfaa805639a357d18","name":"Vanito Hoang","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e8187f37f72d74f9380a1367c8c530debee44f226a3301f0765c68f7cc1f3fa4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e8187f37f72d74f9380a1367c8c530debee44f226a3301f0765c68f7cc1f3fa4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e8187f37f72d74f9380a1367c8c530debee44f226a3301f0765c68f7cc1f3fa4?s=96&d=mm&r=g","caption":"Vanito Hoang"},"url":"https:\/\/thegioimaychu.vn\/blog\/author\/vanito\/"}]}},"_links":{"self":[{"href":"https:\/\/thegioimaychu.vn\/blog\/wp-json\/wp\/v2\/posts\/4463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thegioimaychu.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thegioimaychu.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thegioimaychu.vn\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thegioimaychu.vn\/blog\/wp-json\/wp\/v2\/comments?post=4463"}],"version-history":[{"count":6,"href":"https:\/\/thegioimaychu.vn\/blog\/wp-json\/wp\/v2\/posts\/4463\/revisions"}],"predecessor-version":[{"id":4530,"href":"https:\/\/thegioimaychu.vn\/blog\/wp-json\/wp\/v2\/posts\/4463\/revisions\/4530"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thegioimaychu.vn\/blog\/wp-json\/wp\/v2\/media\/4464"}],"wp:attachment":[{"href":"https:\/\/thegioimaychu.vn\/blog\/wp-json\/wp\/v2\/media?parent=4463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thegioimaychu.vn\/blog\/wp-json\/wp\/v2\/categories?post=4463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thegioimaychu.vn\/blog\/wp-json\/wp\/v2\/tags?post=4463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}