{"id":4226,"date":"2020-03-21T00:08:56","date_gmt":"2020-03-20T15:08:56","guid":{"rendered":"https:\/\/higherhope.net\/?p=4226"},"modified":"2024-04-11T22:08:12","modified_gmt":"2024-04-11T13:08:12","slug":"centos-8%e3%81%a7kubernetes-cluster%e3%82%92%e6%a7%8b%e7%af%89%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f_1","status":"publish","type":"post","link":"https:\/\/higherhope.net\/?p=4226","title":{"rendered":"CentOS 8\u3067Kubernetes Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f_1"},"content":{"rendered":"<p>CentOS 8\u3067Kubernetes\u3000Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u307e\u3059\u3002<br \/>\nKVM\u306eVM\u3067\u69cb\u7bc9\u3057\u307e\u3059\u3002<br \/>\nmaster\u00d71\u3068node\u00d72\u306e\u69cb\u6210\u3067\u3059\u3002<\/p>\n<p>selinux\u3084firewalld\u306f\u7121\u52b9\u306b\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001swap\u304c\u6709\u308b\u3068\u30c0\u30e1\u306a\u306e\u3067swap\u306f\u7121\u52b9\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<blockquote><p># free -m<br \/>\n              total        used        free      shared  buff\/cache   available<br \/>\nMem:           1989         216         754           8        1017        1612<br \/>\nSwap:          2115           0        2115<br \/>\n# swapoff -a<br \/>\n# free -m<br \/>\n              total        used        free      shared  buff\/cache   available<br \/>\nMem:           1989         215         756           8        1016        1614<br \/>\nSwap:             0           0           0<\/p><\/blockquote>\n<p>hosts\u306b\u5404\u30b5\u30fc\u30d0\u30fc\u3092\u8a18\u8f09<\/p>\n<blockquote><p>cat <<EOF>> \/etc\/hosts<br \/>\n192.168.5.101   master  master.hoge.net<br \/>\n192.168.5.102   node-01 node-01.hoge.net<br \/>\n192.168.5.103   node-02 node-02.hoge.net<br \/>\nEOF<\/p><\/blockquote>\n<p>\u3053\u308c\u3089\u306f3\u53f0\u3059\u3079\u3066\u3067\u5b9f\u65bd\u3057\u307e\u3059\u3002<\/p>\n<p>\u6e96\u5099\u304c\u51fa\u6765\u305f\u3089master\u30b5\u30fc\u30d0\u30fc\u306bdocker\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\n\u81ea\u5206\u304c\u884c\u3063\u305f\u624b\u9806\u306f\u3053\u3061\u3089<a href=\"https:\/\/higherhope.net\/?p=4219\">centos8\u306bdocker\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u305f\u3002<\/a><\/p>\n<p>docker\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51fa\u6765\u305f\u3089\u3044\u3088\u3044\u3088kubernetes\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u3059\u3002<br \/>\n\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<blockquote><p># cat <<EOF > \/etc\/yum.repos.d\/kubernetes.repo<br \/>\n> [kubernetes]<br \/>\n> name=Kubernetes<br \/>\n> baseurl=https:\/\/packages.cloud.google.com\/yum\/repos\/kubernetes-el7-x86_64<br \/>\n> enabled=1<br \/>\n> gpgcheck=1<br \/>\n> repo_gpgcheck=1<br \/>\n> gpgkey=https:\/\/packages.cloud.google.com\/yum\/doc\/yum-key.gpg https:\/\/packages.cloud.google.com\/yum\/doc\/rpm-package-key.gpg<br \/>\n> EOF<\/p><\/blockquote>\n<p>kubeadm\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<blockquote><p># dnf install kubeadm<br \/>\nKubernetes                                      378  B\/s | 454  B     00:01<br \/>\nKubernetes                                       30 kB\/s | 1.8 kB     00:00<br \/>\nImporting GPG key 0xA7317B0F:<br \/>\n Userid     : &#8220;Google Cloud Packages Automatic Signing Key <gc-team@google.com>&#8221;<br \/>\n Fingerprint: D0BC 747F D8CA F711 7500 D6FA 3746 C208 A731 7B0F<br \/>\n From       : https:\/\/packages.cloud.google.com\/yum\/doc\/yum-key.gpg<br \/>\nIs this ok [y\/N]: y<br \/>\nImporting GPG key 0xBA07F4FB:<br \/>\n Userid     : &#8220;Google Cloud Packages Automatic Signing Key <gc-team@google.com>&#8221;<br \/>\n Fingerprint: 54A6 47F9 048D 5688 D7DA 2ABE 6A03 0B21 BA07 F4FB<br \/>\n From       : https:\/\/packages.cloud.google.com\/yum\/doc\/yum-key.gpg<br \/>\nIs this ok [y\/N]: y<br \/>\nKubernetes                                      8.3 kB\/s | 975  B     00:00<br \/>\nImporting GPG key 0x3E1BA8D5:<br \/>\n Userid     : &#8220;Google Cloud Packages RPM Signing Key <gc-team@google.com>&#8221;<br \/>\n Fingerprint: 3749 E1BA 95A8 6CE0 5454 6ED2 F09C 394C 3E1B A8D5<br \/>\n From       : https:\/\/packages.cloud.google.com\/yum\/doc\/rpm-package-key.gpg<br \/>\nIs this ok [y\/N]: y<br \/>\nKubernetes                                       48 kB\/s |  87 kB     00:01<br \/>\nDependencies resolved.<br \/>\n================================================================================<br \/>\n Package                    Arch       Version             Repository      Size<br \/>\n================================================================================<br \/>\nInstalling:<br \/>\n kubeadm                    x86_64     1.17.4-0            kubernetes     8.7 M<br \/>\nInstalling dependencies:<br \/>\n socat                      x86_64     1.7.3.2-6.el8       AppStream      298 k<br \/>\n conntrack-tools            x86_64     1.4.4-9.el8         BaseOS         205 k<br \/>\n libnetfilter_cthelper      x86_64     1.0.0-13.el8        BaseOS          24 k<br \/>\n libnetfilter_cttimeout     x86_64     1.0.0-11.el8        BaseOS          24 k<br \/>\n libnetfilter_queue         x86_64     1.0.2-11.el8        BaseOS          30 k<br \/>\n cri-tools                  x86_64     1.13.0-0            kubernetes     5.1 M<br \/>\n kubectl                    x86_64     1.17.4-0            kubernetes     9.4 M<br \/>\n kubelet                    x86_64     1.17.4-0            kubernetes      20 M<br \/>\n kubernetes-cni             x86_64     0.7.5-0             kubernetes      10 M<\/p>\n<p>Transaction Summary<br \/>\n================================================================================<br \/>\nInstall  10 Packages<\/p>\n<p>Total download size: 54 M<br \/>\nInstalled size: 244 M<br \/>\nIs this ok [y\/N]: y<br \/>\nDownloading Packages:<br \/>\n(1\/10): libnetfilter_cthelper-1.0.0-13.el8.x86_ 633 kB\/s |  24 kB     00:00<br \/>\n(2\/10): libnetfilter_cttimeout-1.0.0-11.el8.x86 2.5 MB\/s |  24 kB     00:00<br \/>\n(3\/10): conntrack-tools-1.4.4-9.el8.x86_64.rpm  3.4 MB\/s | 205 kB     00:00<br \/>\n(4\/10): libnetfilter_queue-1.0.2-11.el8.x86_64. 1.1 MB\/s |  30 kB     00:00<br \/>\n(5\/10): socat-1.7.3.2-6.el8.x86_64.rpm          2.5 MB\/s | 298 kB     00:00<br \/>\n(6\/10): 0767753f85f415bbdf1df0e974eafccb653bee0  16 MB\/s | 8.7 MB     00:00<br \/>\n(7\/10): 14bfe6e75a9efc8eca3f638eb22c7e2ce759c67 5.2 MB\/s | 5.1 MB     00:00<br \/>\n(8\/10): 06400b25ef3577561502f9a7a126bf4975c03b3 9.9 MB\/s | 9.4 MB     00:00<br \/>\n(9\/10): 548a0dcd865c16a50980420ddfa5fbccb8b5962  10 MB\/s |  10 MB     00:00<br \/>\n(10\/10): 0c45baca5fcc05bb75f1e953ecaf85844efac0 8.0 MB\/s |  20 MB     00:02<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nTotal                                            13 MB\/s |  54 MB     00:04<br \/>\nwarning: \/var\/cache\/dnf\/kubernetes-33343725abd9cbdc\/packages\/14bfe6e75a9efc8eca3f638eb22c7e2ce759c67f95b43b16fae4ebabde1549f3-cri-tools-1.13.0-0.x86_64.rpm: Header V4 RSA\/SHA512 Signature, key ID 3e1ba8d5: NOKEY<br \/>\nKubernetes                                       28 kB\/s | 1.8 kB     00:00<br \/>\nImporting GPG key 0xA7317B0F:<br \/>\n Userid     : &#8220;Google Cloud Packages Automatic Signing Key <gc-team@google.com>&#8221;<br \/>\n Fingerprint: D0BC 747F D8CA F711 7500 D6FA 3746 C208 A731 7B0F<br \/>\n From       : https:\/\/packages.cloud.google.com\/yum\/doc\/yum-key.gpg<br \/>\nIs this ok [y\/N]: y<br \/>\nKey imported successfully<br \/>\nImporting GPG key 0xBA07F4FB:<br \/>\n Userid     : &#8220;Google Cloud Packages Automatic Signing Key <gc-team@google.com>&#8221;<br \/>\n Fingerprint: 54A6 47F9 048D 5688 D7DA 2ABE 6A03 0B21 BA07 F4FB<br \/>\n From       : https:\/\/packages.cloud.google.com\/yum\/doc\/yum-key.gpg<br \/>\nIs this ok [y\/N]: y<br \/>\nKey imported successfully<br \/>\nKubernetes                                      9.2 kB\/s | 975  B     00:00<br \/>\nImporting GPG key 0x3E1BA8D5:<br \/>\n Userid     : &#8220;Google Cloud Packages RPM Signing Key <gc-team@google.com>&#8221;<br \/>\n Fingerprint: 3749 E1BA 95A8 6CE0 5454 6ED2 F09C 394C 3E1B A8D5<br \/>\n From       : https:\/\/packages.cloud.google.com\/yum\/doc\/rpm-package-key.gpg<br \/>\nIs this ok [y\/N]: y<br \/>\nKey imported successfully<br \/>\nRunning transaction check<br \/>\nTransaction check succeeded.<br \/>\nRunning transaction test<br \/>\nTransaction test succeeded.<br \/>\nRunning transaction<br \/>\n  Preparing        :                                                        1\/1<br \/>\n  Installing       : kubectl-1.17.4-0.x86_64                               1\/10<br \/>\n  Installing       : cri-tools-1.13.0-0.x86_64                             2\/10<br \/>\n  Installing       : libnetfilter_queue-1.0.2-11.el8.x86_64                3\/10<br \/>\n  Running scriptlet: libnetfilter_queue-1.0.2-11.el8.x86_64                3\/10<br \/>\n  Installing       : libnetfilter_cttimeout-1.0.0-11.el8.x86_64            4\/10<br \/>\n  Running scriptlet: libnetfilter_cttimeout-1.0.0-11.el8.x86_64            4\/10<br \/>\n  Installing       : libnetfilter_cthelper-1.0.0-13.el8.x86_64             5\/10<br \/>\n  Running scriptlet: libnetfilter_cthelper-1.0.0-13.el8.x86_64             5\/10<br \/>\n  Installing       : conntrack-tools-1.4.4-9.el8.x86_64                    6\/10<br \/>\n  Running scriptlet: conntrack-tools-1.4.4-9.el8.x86_64                    6\/10<br \/>\n  Installing       : socat-1.7.3.2-6.el8.x86_64                            7\/10<br \/>\n  Installing       : kubernetes-cni-0.7.5-0.x86_64                         8\/10<br \/>\n  Installing       : kubelet-1.17.4-0.x86_64                               9\/10<br \/>\n  Installing       : kubeadm-1.17.4-0.x86_64                              10\/10<br \/>\n  Running scriptlet: kubeadm-1.17.4-0.x86_64                              10\/10<br \/>\n  Verifying        : socat-1.7.3.2-6.el8.x86_64                            1\/10<br \/>\n  Verifying        : conntrack-tools-1.4.4-9.el8.x86_64                    2\/10<br \/>\n  Verifying        : libnetfilter_cthelper-1.0.0-13.el8.x86_64             3\/10<br \/>\n  Verifying        : libnetfilter_cttimeout-1.0.0-11.el8.x86_64            4\/10<br \/>\n  Verifying        : libnetfilter_queue-1.0.2-11.el8.x86_64                5\/10<br \/>\n  Verifying        : cri-tools-1.13.0-0.x86_64                             6\/10<br \/>\n  Verifying        : kubeadm-1.17.4-0.x86_64                               7\/10<br \/>\n  Verifying        : kubectl-1.17.4-0.x86_64                               8\/10<br \/>\n  Verifying        : kubelet-1.17.4-0.x86_64                               9\/10<br \/>\n  Verifying        : kubernetes-cni-0.7.5-0.x86_64                        10\/10<\/p>\n<p>Installed:<br \/>\n  kubeadm-1.17.4-0.x86_64<br \/>\n  socat-1.7.3.2-6.el8.x86_64<br \/>\n  conntrack-tools-1.4.4-9.el8.x86_64<br \/>\n  libnetfilter_cthelper-1.0.0-13.el8.x86_64<br \/>\n  libnetfilter_cttimeout-1.0.0-11.el8.x86_64<br \/>\n  libnetfilter_queue-1.0.2-11.el8.x86_64<br \/>\n  cri-tools-1.13.0-0.x86_64<br \/>\n  kubectl-1.17.4-0.x86_64<br \/>\n  kubelet-1.17.4-0.x86_64<br \/>\n  kubernetes-cni-0.7.5-0.x86_64<\/p>\n<p>Complete!<\/p><\/blockquote>\n<p>kubelet\u306e\u81ea\u52d5\u8d77\u52d5\u3092\u6709\u52b9\u306b\u3057\u3066\u8d77\u52d5\u3002<\/p>\n<blockquote><p> systemctl enable kubelet<br \/>\n\/etc\/systemd\/system\/multi-user.target.wants\/kubelet.service \u2192 \/usr\/lib\/systemd\/system\/kubelet.service.<br \/>\n# systemctl start kubelet<\/p><\/blockquote>\n<\/blockquote>\n<p>kubeadm\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<blockquote><p># kubeadm init<br \/>\nW0316 23:27:57.301449    4904 validation.go:28] Cannot validate kube-proxy config &#8211; no validator is available<br \/>\nW0316 23:27:57.301498    4904 validation.go:28] Cannot validate kubelet config &#8211; no validator is available<br \/>\n[init] Using Kubernetes version: v1.17.4<br \/>\n[preflight] Running pre-flight checks<br \/>\n        [WARNING IsDockerSystemdCheck]: detected &#8220;cgroupfs&#8221; as the Docker cgroup driver. The recommended driver is &#8220;systemd&#8221;. Please follow the guide at https:\/\/kubernetes.io\/docs\/setup\/cri\/<br \/>\n        [WARNING FileExisting-tc]: tc not found in system path<br \/>\n[preflight] Pulling images required for setting up a Kubernetes cluster<br \/>\n[preflight] This might take a minute or two, depending on the speed of your internet connection<br \/>\n[preflight] You can also perform this action in beforehand using &#8216;kubeadm config images pull&#8217;<br \/>\n[kubelet-start] Writing kubelet environment file with flags to file &#8220;\/var\/lib\/kubelet\/kubeadm-flags.env&#8221;<br \/>\n[kubelet-start] Writing kubelet configuration to file &#8220;\/var\/lib\/kubelet\/config.yaml&#8221;<br \/>\n[kubelet-start] Starting the kubelet<br \/>\n[certs] Using certificateDir folder &#8220;\/etc\/kubernetes\/pki&#8221;<br \/>\n[certs] Generating &#8220;ca&#8221; certificate and key<br \/>\n[certs] Generating &#8220;apiserver&#8221; certificate and key<br \/>\n[certs] apiserver serving cert is signed for DNS names [master.hogehoge.net kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.5.101]<br \/>\n[certs] Generating &#8220;apiserver-kubelet-client&#8221; certificate and key<br \/>\n[certs] Generating &#8220;front-proxy-ca&#8221; certificate and key<br \/>\n[certs] Generating &#8220;front-proxy-client&#8221; certificate and key<br \/>\n[certs] Generating &#8220;etcd\/ca&#8221; certificate and key<br \/>\n[certs] Generating &#8220;etcd\/server&#8221; certificate and key<br \/>\n[certs] etcd\/server serving cert is signed for DNS names [master.hogehoge.net localhost] and IPs [192.168.5.101 127.0.0.1 ::1]<br \/>\n[certs] Generating &#8220;etcd\/peer&#8221; certificate and key<br \/>\n[certs] etcd\/peer serving cert is signed for DNS names [master.hogehoge.net localhost] and IPs [192.168.5.101 127.0.0.1 ::1]<br \/>\n[certs] Generating &#8220;etcd\/healthcheck-client&#8221; certificate and key<br \/>\n[certs] Generating &#8220;apiserver-etcd-client&#8221; certificate and key<br \/>\n[certs] Generating &#8220;sa&#8221; key and public key<br \/>\n[kubeconfig] Using kubeconfig folder &#8220;\/etc\/kubernetes&#8221;<br \/>\n[kubeconfig] Writing &#8220;admin.conf&#8221; kubeconfig file<br \/>\n[kubeconfig] Writing &#8220;kubelet.conf&#8221; kubeconfig file<br \/>\n[kubeconfig] Writing &#8220;controller-manager.conf&#8221; kubeconfig file<br \/>\n[kubeconfig] Writing &#8220;scheduler.conf&#8221; kubeconfig file<br \/>\n[control-plane] Using manifest folder &#8220;\/etc\/kubernetes\/manifests&#8221;<br \/>\n[control-plane] Creating static Pod manifest for &#8220;kube-apiserver&#8221;<br \/>\n[control-plane] Creating static Pod manifest for &#8220;kube-controller-manager&#8221;<br \/>\nW0316 23:28:22.896741    4904 manifests.go:214] the default kube-apiserver authorization-mode is &#8220;Node,RBAC&#8221;; using &#8220;Node,RBAC&#8221;<br \/>\n[control-plane] Creating static Pod manifest for &#8220;kube-scheduler&#8221;<br \/>\nW0316 23:28:22.897850    4904 manifests.go:214] the default kube-apiserver authorization-mode is &#8220;Node,RBAC&#8221;; using &#8220;Node,RBAC&#8221;<br \/>\n[etcd] Creating static Pod manifest for local etcd in &#8220;\/etc\/kubernetes\/manifests&#8221;<br \/>\n[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory &#8220;\/etc\/kubernetes\/manifests&#8221;. This can take up to 4m0s<br \/>\n[apiclient] All control plane components are healthy after 35.502341 seconds<br \/>\n[upload-config] Storing the configuration used in ConfigMap &#8220;kubeadm-config&#8221; in the &#8220;kube-system&#8221; Namespace<br \/>\n[kubelet] Creating a ConfigMap &#8220;kubelet-config-1.17&#8221; in namespace kube-system with the configuration for the kubelets in the cluster<br \/>\n[upload-certs] Skipping phase. Please see &#8211;upload-certs<br \/>\n[mark-control-plane] Marking the node master.hogehoge.net as control-plane by adding the label &#8220;node-role.kubernetes.io\/master=&#8221;&#8221;<br \/>\n[mark-control-plane] Marking the node master.hogehoge.net as control-plane by adding the taints [node-role.kubernetes.io\/master:NoSchedule]<br \/>\n[bootstrap-token] Using token: vb94zf.j2un0ry3aunvx9y3<br \/>\n[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles<br \/>\n[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials<br \/>\n[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token<br \/>\n[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster<br \/>\n[bootstrap-token] Creating the &#8220;cluster-info&#8221; ConfigMap in the &#8220;kube-public&#8221; namespace<br \/>\n[kubelet-finalize] Updating &#8220;\/etc\/kubernetes\/kubelet.conf&#8221; to point to a rotatable kubelet client certificate and key<br \/>\n[addons] Applied essential addon: CoreDNS<br \/>\n[addons] Applied essential addon: kube-proxy<\/p>\n<p>Your Kubernetes control-plane has initialized successfully!<\/p>\n<p>To start using your cluster, you need to run the following as a regular user:<\/p>\n<p>  mkdir -p $HOME\/.kube<br \/>\n  sudo cp -i \/etc\/kubernetes\/admin.conf $HOME\/.kube\/config<br \/>\n  sudo chown $(id -u):$(id -g) $HOME\/.kube\/config<\/p>\n<p>You should now deploy a pod network to the cluster.<br \/>\nRun &#8220;kubectl apply -f [podnetwork].yaml&#8221; with one of the options listed at:<br \/>\n  https:\/\/kubernetes.io\/docs\/concepts\/cluster-administration\/addons\/<\/p>\n<p>Then you can join any number of worker nodes by running the following on each as root:<\/p>\n<p>kubeadm join 192.168.5.101:6443 &#8211;token vb94zf.j2un0ry3aunvx9y3 \\<br \/>\n    &#8211;discovery-token-ca-cert-hash sha256:f42734223e79931159a470fe37a27677c51bcca051feccefbb8a050fbbfcad43<\/p><\/blockquote>\n<p>kubeadm join 192.168.5.101:6443 &#8211;token\uff5e\u306e\u30b3\u30de\u30f3\u30c9\u306fnode\u8ffd\u52a0\u306e\u6642\u306b\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u4e0a\u306e\u30ed\u30b0\u304c\u304a\u3057\u3048\u3066\u304f\u308c\u3066\u308b\u5fc5\u8981\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3084config\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<blockquote><p># mkdir -p $HOME\/.kube<br \/>\n# cp -i \/etc\/kubernetes\/admin.conf $HOME\/.kube\/config<br \/>\n# chown $(id -u):$(id -g) $HOME\/.kube\/config<\/p><\/blockquote>\n<p>\u3053\u3053\u307e\u3067\u6765\u305f\u3089kubectl\u304c\u4f7f\u3048\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<blockquote><p># kubectl get nodes<br \/>\nNAME                       STATUS     ROLES    AGE    VERSION<br \/>\nmaster.hogehoge.net   NotReady   master   3m2s   v1.17.4<\/p><\/blockquote>\n<p>NotReady\u3068\u306a\u3063\u3066\u307e\u3059\u304c\u3001\u3053\u306e\u6642\u70b9\u3067\u306f\u554f\u984c\u306a\u3044\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001pod\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3068\u3084\u3089\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<blockquote><p># export kubever=$(kubectl version | base64 | tr -d &#8216;\\ n&#8217;)<br \/>\n# kubectl apply -f &#8220;https:\/\/cloud.weave.works\/k8s\/net?k8s-version=$kubever<br \/>\n> &#8221;<br \/>\nerror: unable to read URL &#8220;https:\/\/cloud.weave.works\/k8s\/net?k8s-version=Q2xpZW50IFZlcNpb246IHZlcNpb24uSW5mb3tNYWpvcjoiMSIsIE1pbm9yOiIxNyIsIEdpdFZl&#8221;, server reported 400 Bad Request, status code=400<br \/>\nhttps:\/\/github.com\/weaveworks\/weave\/issues\/3048<\/p><\/blockquote>\n<p>\u30b3\u30b1\u307e\u3057\u305f\u30fb\u30fb\u30fb\u3002<br \/>\n\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u98df\u308f\u3057\u3066\u5b9f\u884c\u3057\u3066\u3044\u308b\u3088\u3046\u306a\u306e\u3067<\/p>\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d<\/p>\n<blockquote><p># kubectl version<br \/>\nClient Version: version.Info{Major:&#8221;1&#8243;, Minor:&#8221;17&#8243;, GitVersion:&#8221;v1.17.4&#8243;, GitCommit:&#8221;8d8aa39598534325ad77120c120a22b3a990b5ea&#8221;, GitTreeState:&#8221;clean&#8221;, BuildDate:&#8221;2020-03-12T21:03:42Z&#8221;, GoVersion:&#8221;go1.13.8&#8243;, Compiler:&#8221;gc&#8221;, Platform:&#8221;linux\/amd64&#8243;}<br \/>\nServer Version: version.Info{Major:&#8221;1&#8243;, Minor:&#8221;17&#8243;, GitVersion:&#8221;v1.17.4&#8243;, GitCommit:&#8221;8d8aa39598534325ad77120c120a22b3a990b5ea&#8221;, GitTreeState:&#8221;clean&#8221;, BuildDate:&#8221;2020-03-12T20:55:23Z&#8221;, GoVersion:&#8221;go1.13.8&#8243;, Compiler:&#8221;gc&#8221;, Platform:&#8221;linux\/amd64&#8243;}<\/p><\/blockquote>\n<p>kubernetes\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306fv1.17.4\u306a\u3088\u3046\u306a\u306e\u3067<\/p>\n<p>\u76f4\u6253\u3061\u3067\u6311\u6226<\/p>\n<blockquote><p># kubectl apply -n kube-system -f &#8220;https:\/\/cloud.weave.works\/k8s\/v1.17.4\/net&#8221;<br \/>\nserviceaccount\/weave-net created<br \/>\nclusterrole.rbac.authorization.k8s.io\/weave-net created<br \/>\nclusterrolebinding.rbac.authorization.k8s.io\/weave-net created<br \/>\nrole.rbac.authorization.k8s.io\/weave-net created<br \/>\nrolebinding.rbac.authorization.k8s.io\/weave-net created<br \/>\ndaemonset.apps\/weave-net created<\/p><\/blockquote>\n<p>\u51fa\u6765\u305f\u3088\u3046\u3067\u3059\u3002<br \/>\n\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<blockquote><p># kubectl get nodes<br \/>\nNAME                       STATUS     ROLES    AGE   VERSION<br \/>\nmaster.hogehoge.net   NotReady   master   58m   v1.17.4<\/p><\/blockquote>\n<\/blockquote>\n<p>\u3057\u3070\u3089\u304f\u3059\u308b\u3068\u30fb\u30fb\u30fb\u3002<\/p>\n<blockquote><p>[root@master ~]# kubectl get nodes<br \/>\nNAME                       STATUS   ROLES    AGE   VERSION<br \/>\nmaster.hogehoge.net   Ready    master   59m   v1.17.4<\/p><\/blockquote>\n<p>Ready\u306b\u306a\u308a\u307e\u3057\u305f\uff01<br \/>\n\u53d6\u308a\u5408\u3048\u305akubernetes\u306emaster node\u306e\u69cb\u7bc9\u306f\u51fa\u6765\u305f\u3088\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS 8\u3067Kubernetes\u3000Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u307e\u3059\u3002 KVM\u306eVM\u3067\u69cb\u7bc9\u3057\u307e\u3059\u3002 master\u00d71\u3068node\u00d72\u306e\u69cb\u6210\u3067\u3059\u3002 selinux\u3084firewalld\u306f\u7121\u52b9\u306b\u3057\u307e\u3059\u3002 \u307e\u305f\u3001swap\u304c\u6709\u308b\u3068&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/higherhope.net\/?p=4226\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182,4],"tags":[183],"class_list":["post-4226","post","type-post","status-publish","format-standard","hentry","category-kubernetes","category-linux","tag-kubernetes"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CentOS 8\u3067Kubernetes Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f_1 - \u697d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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:\/\/higherhope.net\/?p=4226\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CentOS 8\u3067Kubernetes Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f_1 - \u697d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta property=\"og:description\" content=\"CentOS 8\u3067Kubernetes\u3000Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u307e\u3059\u3002 KVM\u306eVM\u3067\u69cb\u7bc9\u3057\u307e\u3059\u3002 master\u00d71\u3068node\u00d72\u306e\u69cb\u6210\u3067\u3059\u3002 selinux\u3084firewalld\u306f\u7121\u52b9\u306b\u3057\u307e\u3059\u3002 \u307e\u305f\u3001swap\u304c\u6709\u308b\u3068... Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/higherhope.net\/?p=4226\" \/>\n<meta property=\"og:site_name\" content=\"\u697d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-20T15:08:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-11T13:08:12+00:00\" \/>\n<meta name=\"author\" content=\"higherhope\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@higherhope5963\" \/>\n<meta name=\"twitter:site\" content=\"@higherhope5963\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"higherhope\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"9\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/higherhope.net\/?p=4226#article\",\"isPartOf\":{\"@id\":\"https:\/\/higherhope.net\/?p=4226\"},\"author\":{\"name\":\"higherhope\",\"@id\":\"https:\/\/higherhope.net\/#\/schema\/person\/d8206977903d5a243c56f95f977122af\"},\"headline\":\"CentOS 8\u3067Kubernetes Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f_1\",\"datePublished\":\"2020-03-20T15:08:56+00:00\",\"dateModified\":\"2024-04-11T13:08:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/higherhope.net\/?p=4226\"},\"wordCount\":1772,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/higherhope.net\/#\/schema\/person\/d8206977903d5a243c56f95f977122af\"},\"keywords\":[\"kubernetes\"],\"articleSection\":[\"kubernetes\",\"linux\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/higherhope.net\/?p=4226#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/higherhope.net\/?p=4226\",\"url\":\"https:\/\/higherhope.net\/?p=4226\",\"name\":\"CentOS 8\u3067Kubernetes Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f_1 - \u697d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\",\"isPartOf\":{\"@id\":\"https:\/\/higherhope.net\/#website\"},\"datePublished\":\"2020-03-20T15:08:56+00:00\",\"dateModified\":\"2024-04-11T13:08:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/higherhope.net\/?p=4226#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/higherhope.net\/?p=4226\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/higherhope.net\/?p=4226#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\/\/higherhope.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CentOS 8\u3067Kubernetes Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f_1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/higherhope.net\/#website\",\"url\":\"https:\/\/higherhope.net\/\",\"name\":\"\u697d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\",\"description\":\"\u304a\u3063\u3055\u3093\u307e\u3060\u307e\u3060\u697d\u3067\u304d\u307e\u305b\u3093\u3002\",\"publisher\":{\"@id\":\"https:\/\/higherhope.net\/#\/schema\/person\/d8206977903d5a243c56f95f977122af\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/higherhope.net\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/higherhope.net\/#\/schema\/person\/d8206977903d5a243c56f95f977122af\",\"name\":\"higherhope\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/higherhope.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/higherhope.net\/wp-content\/uploads\/2018\/09\/DSC_0367.jpg\",\"contentUrl\":\"https:\/\/higherhope.net\/wp-content\/uploads\/2018\/09\/DSC_0367.jpg\",\"width\":700,\"height\":394,\"caption\":\"higherhope\"},\"logo\":{\"@id\":\"https:\/\/higherhope.net\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/higherhope5963\"],\"url\":\"https:\/\/higherhope.net\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CentOS 8\u3067Kubernetes Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f_1 - \u697d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002","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:\/\/higherhope.net\/?p=4226","og_locale":"ja_JP","og_type":"article","og_title":"CentOS 8\u3067Kubernetes Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f_1 - \u697d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002","og_description":"CentOS 8\u3067Kubernetes\u3000Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u307e\u3059\u3002 KVM\u306eVM\u3067\u69cb\u7bc9\u3057\u307e\u3059\u3002 master\u00d71\u3068node\u00d72\u306e\u69cb\u6210\u3067\u3059\u3002 selinux\u3084firewalld\u306f\u7121\u52b9\u306b\u3057\u307e\u3059\u3002 \u307e\u305f\u3001swap\u304c\u6709\u308b\u3068... Continue reading &rarr;","og_url":"https:\/\/higherhope.net\/?p=4226","og_site_name":"\u697d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002","article_published_time":"2020-03-20T15:08:56+00:00","article_modified_time":"2024-04-11T13:08:12+00:00","author":"higherhope","twitter_card":"summary_large_image","twitter_creator":"@higherhope5963","twitter_site":"@higherhope5963","twitter_misc":{"\u57f7\u7b46\u8005":"higherhope","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"9\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/higherhope.net\/?p=4226#article","isPartOf":{"@id":"https:\/\/higherhope.net\/?p=4226"},"author":{"name":"higherhope","@id":"https:\/\/higherhope.net\/#\/schema\/person\/d8206977903d5a243c56f95f977122af"},"headline":"CentOS 8\u3067Kubernetes Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f_1","datePublished":"2020-03-20T15:08:56+00:00","dateModified":"2024-04-11T13:08:12+00:00","mainEntityOfPage":{"@id":"https:\/\/higherhope.net\/?p=4226"},"wordCount":1772,"commentCount":0,"publisher":{"@id":"https:\/\/higherhope.net\/#\/schema\/person\/d8206977903d5a243c56f95f977122af"},"keywords":["kubernetes"],"articleSection":["kubernetes","linux"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/higherhope.net\/?p=4226#respond"]}]},{"@type":"WebPage","@id":"https:\/\/higherhope.net\/?p=4226","url":"https:\/\/higherhope.net\/?p=4226","name":"CentOS 8\u3067Kubernetes Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f_1 - \u697d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002","isPartOf":{"@id":"https:\/\/higherhope.net\/#website"},"datePublished":"2020-03-20T15:08:56+00:00","dateModified":"2024-04-11T13:08:12+00:00","breadcrumb":{"@id":"https:\/\/higherhope.net\/?p=4226#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/higherhope.net\/?p=4226"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/higherhope.net\/?p=4226#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/higherhope.net\/"},{"@type":"ListItem","position":2,"name":"CentOS 8\u3067Kubernetes Cluster\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f_1"}]},{"@type":"WebSite","@id":"https:\/\/higherhope.net\/#website","url":"https:\/\/higherhope.net\/","name":"\u697d\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002","description":"\u304a\u3063\u3055\u3093\u307e\u3060\u307e\u3060\u697d\u3067\u304d\u307e\u305b\u3093\u3002","publisher":{"@id":"https:\/\/higherhope.net\/#\/schema\/person\/d8206977903d5a243c56f95f977122af"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/higherhope.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":["Person","Organization"],"@id":"https:\/\/higherhope.net\/#\/schema\/person\/d8206977903d5a243c56f95f977122af","name":"higherhope","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/higherhope.net\/#\/schema\/person\/image\/","url":"https:\/\/higherhope.net\/wp-content\/uploads\/2018\/09\/DSC_0367.jpg","contentUrl":"https:\/\/higherhope.net\/wp-content\/uploads\/2018\/09\/DSC_0367.jpg","width":700,"height":394,"caption":"higherhope"},"logo":{"@id":"https:\/\/higherhope.net\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/x.com\/higherhope5963"],"url":"https:\/\/higherhope.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/higherhope.net\/index.php?rest_route=\/wp\/v2\/posts\/4226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/higherhope.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/higherhope.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/higherhope.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/higherhope.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4226"}],"version-history":[{"count":9,"href":"https:\/\/higherhope.net\/index.php?rest_route=\/wp\/v2\/posts\/4226\/revisions"}],"predecessor-version":[{"id":5767,"href":"https:\/\/higherhope.net\/index.php?rest_route=\/wp\/v2\/posts\/4226\/revisions\/5767"}],"wp:attachment":[{"href":"https:\/\/higherhope.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/higherhope.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/higherhope.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}