flagflag  If you want to see English page, please click "English" Button at Left.
13: 2021-09-10 (金) 23:45:13 iseki ソース 現: 2021-09-15 (水) 13:03:38 iseki ソース
Line 10: Line 10:
#br #br
- https://qiita.com/ishida0503/items/f3b62​b02dec4f6fef42f - https://qiita.com/ishida0503/items/f3b62​b02dec4f6fef42f
 +#br
 +**** ''Check !!!! 後でチェックする.'' [#f5a64eb5]
 +- kubectl config set-context $(kubectl config current-context) --namespace k8sns
#br #br
Line 32: Line 35:
*** 本体のインストール [#sabae243] *** 本体のインストール [#sabae243]
-**** K8sリポジトリ(EL7) [#o2437fdb]+**** K8sリポジトリ(RHEL7) [#o2437fdb]
- /etc/yum.repos.d/kubernetes.repo - /etc/yum.repos.d/kubernetes.repo
 [kubernetes]  [kubernetes]
Line 48: Line 51:
#br #br
-**** EL7 ではなくて,最新版を手動で入れる. [#dae1dbdf]+**** RHEL7 ではなくて,最新版を手動で入れる. [#dae1dbdf]
- yum install -y socat iproute-tc ipvsadm conntrack-tools - yum install -y socat iproute-tc ipvsadm conntrack-tools
- バイナリのダウンロード - バイナリのダウンロード
Line 62: Line 65:
 Wants=network-online.target  Wants=network-online.target
 After=network-online.target  After=network-online.target
 + 
 [Service]  [Service]
 ExecStart=/usr/bin/kubelet  ExecStart=/usr/bin/kubelet
Line 68: Line 71:
 StartLimitInterval=0  StartLimitInterval=0
 RestartSec=10  RestartSec=10
 + 
 [Install]  [Install]
 WantedBy=multi-user.target  WantedBy=multi-user.target
Line 97: Line 100:
**** kubeadm [#e750df5b] **** kubeadm [#e750df5b]
-- kubeadm init --pod-network-cidr=10.128.0.0/16 --service-cidr 10.128.0.0/16 --control-plane-endpoint=172.22.1.75 +- kubeadm init --pod-network-cidr=10.128.0.0/16 --service-cidr 10.128.0.0/16 --control-plane-endpoint=172.22.1.75:6443 
--- --control-plane-endpoint は内部 DNSのIP:Port を指定する? (ポートは 4663?)+-- --control-plane-endpoint は内部 DNSのIP:Port を指定する? 
- 作られるファイル - 作られるファイル
-- /var/lib/etcd/ -- /var/lib/etcd/
Line 109: Line 112:
-- 何かリセットできない.... 関連ファイル削除,関連プロセス皆殺し... -- 何かリセットできない.... 関連ファイル削除,関連プロセス皆殺し...
#br #br
 +
**** minikube [#g2baeece] **** minikube [#g2baeece]
- 別のクラスター構築ツール. - 別のクラスター構築ツール.
Line 130: Line 134:
 vi custom-resources.yaml      (correct IP)  vi custom-resources.yaml      (correct IP)
 kubectl create -f custom-resources.yaml  kubectl create -f custom-resources.yaml
 + 
 watch kubectl get pods -n calico-system  watch kubectl get pods -n calico-system
 kubectl taint nodes --all node-role.kubernetes.io/master-  (マスタノードでも Podを実行できるようになる)  kubectl taint nodes --all node-role.kubernetes.io/master-  (マスタノードでも Podを実行できるようになる)
 kubectl get nodes -o wide  kubectl get nodes -o wide
 +
 +- /etc/NetworkManager/conf.d/calico.conf  で以下の設定が必要になるかもしれない
 + [keyfile]
 + unmanaged-devices=interface-name:cali*;​interface-name:tunl*;interface-name:vxla​n.calico
**** calicoctl [#t3e4c13e] **** calicoctl [#t3e4c13e]
Line 152: Line 160:
#br #br
-***** Alt 1 [#a2d229df]+***** 他の方法 [#dba04328] 
 +- その1
 curl -L https://docs.projectcalico.org/manifests​/calico.yaml | \  curl -L https://docs.projectcalico.org/manifests​/calico.yaml | \
 sed  '/            - name: CALICO_DISABLE_FILE_LOGGING/i\            # ADD' | \  sed  '/            - name: CALICO_DISABLE_FILE_LOGGING/i\            # ADD' | \
Line 162: Line 171:
 cat - >  calico.yaml  cat - >  calico.yaml
 kubectl apply -f calico.yaml  kubectl apply -f calico.yaml
 + 
 watch kubectl get pods -n calico-system  watch kubectl get pods -n calico-system
 kubectl taint nodes --all node-role.kubernetes.io/master-  kubectl taint nodes --all node-role.kubernetes.io/master-
 kubectl get nodes -o wide  kubectl get nodes -o wide
-***** Alt 2 [#i1978737]+- その2
 cat <<EOF > /etc/NetworkManager/conf.d/calico.conf  cat <<EOF > /etc/NetworkManager/conf.d/calico.conf
 [keyfile]  [keyfile]
Line 175: Line 184:
 vi calico.yaml  (correct IP)  vi calico.yaml  (correct IP)
 kubectl apply -f calico.yaml  kubectl apply -f calico.yaml
 + 
 watch kubectl get pods -n calico-system  watch kubectl get pods -n calico-system
 kubectl taint nodes --all node-role.kubernetes.io/master-  kubectl taint nodes --all node-role.kubernetes.io/master-
Line 198: Line 207:
 kubectl apply -f l2-configuration.yaml  kubectl apply -f l2-configuration.yaml
 kubectl get service  kubectl get service
 +
 +- [[l2-configuration.yaml>./l2-configurati​on.yaml]]
 +#br
** Getting first [#o1bbd83d] ** Getting first [#o1bbd83d]
Line 207: Line 219:
- https://qiita.com/suzukihi724/items/241f​7241d297a2d4a55c - https://qiita.com/suzukihi724/items/241f​7241d297a2d4a55c
#br #br
 +
 +**** MetalLB を使用した場合 [#l6b076d5]
 + kubectl run nginx --image=nginx:1.11.3
 + kubectl get pod
 + kubectl expose pod nginx  --port=80 --type=LoadBalancer --name=nginx
 + kubectl get service
 +
 + NAME        TYPE          CLUSTER-IP      EXTERNAL-IP  PORT(S)        AGE
 + kubernetes  ClusterIP      10.128.0.1      <none>        443/TCP        17m
 + nginx        LoadBalancer  10.128.44.222  172.22.1.70  80:32606/TCP  3m42s
 +
 +- 172.22.1.70:80 へのアクセスで Webに接続可
 +#br
 +
 +*** OLD: nginx [#fe881da9]
**** Start [#x082d3f7] **** Start [#x082d3f7]
 kubectl run nginx --image=nginx:1.11.3  kubectl run nginx --image=nginx:1.11.3
 kubectl get pod  kubectl get pod
- kubectl expose pod nginx--external-ip=172.22.1.75  --port=80+ kubectl expose pod nginx --external-ip=172.22.1.75  --port=80
 kubectl get service  kubectl get service
Line 263: Line 290:
 nginx        ClusterIP  10.128.175.104  192.168.27.43  80/TCP    51m  nginx        ClusterIP  10.128.175.104  192.168.27.43  80/TCP    51m
 nginx2      ClusterIP  10.128.175.124  192.168.27.44  80/TCP    4m53s  nginx2      ClusterIP  10.128.175.124  192.168.27.44  80/TCP    4m53s
 +#br
 +*** JupyterHub [#t5f59cf9]
 +- [[JupyterHub>./JupyterHub]]
#br #br


トップ   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 5月翌月
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
<今日>

オンライン状況

79 人のユーザが現在オンラインです。 (15 人のユーザが xpwiki を参照しています。)

登録ユーザ: 0
ゲスト: 79

もっと...

アクセスカウンタ

今日 : 2251225122512251
昨日 : 1185711857118571185711857
総計 : 2361397823613978236139782361397823613978236139782361397823613978
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com