1

Kid1999' Blog

 2 years ago
source link: https://kid1999.github.io/2022/03/11/k8s%E7%9A%84%E9%83%A8%E7%BD%B2%E5%AE%89%E8%A3%85/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Kid1999' Blog

k8s的部署安装

发表于2022-03-11|更新于2022-03-11|运维
字数总计:239|阅读时长:1分钟|阅读量:11

基于Kind部署K8S

kind(Kubernetes IN Docker) 是一个基于 docker 构建 Kubernetes 集群的工具,非常适合用来在本地搭建基于 Kubernetes 的开发/测试环境。

kind的基础命令:

  • plaintext
    kind create cluster # 默认创建名为kind的集群
    kind create cluster --name kind2 # 创建名为kind2的集群
  • 与集群交互

    plaintext
    kind get clusters  #列出kind集群
    kubectl cluster-info --context kind-kind #与特定集群进行交互

  • plaintext
    kind delete cluster
    kind delete cluster --name kind
  • 加载images到集群

    plaintext
    kind load docker-image image-0 image-1 --name kind2
  • plaintext
    kind create cluster --config kind-example-config.yaml
    plaintext
    # three node (two workers) cluster config
    kind: Cluster
    apiVersion: kind.x-k8s.io/v1alpha4
    nodes:
    - role: control-plane
    extraPortMappings:
    - containerPort: 80
    hostPort: 80
    listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"
    protocol: tcp # Optional, defaults to tcp
    - role: worker
    - role: worker
  • plaintext
    kubectl get node
    kubectl get po -n kube-system

基于脚本部署K8S

细节参考:https://github.com/kid1999/k8s-install-shell


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK