Knative 学习记录

Last Edited Time
Aug 24, 2022 08:58 AM
date
Aug 24, 2022
slug
knative
status
Published
tags
Notebook
Command
Golang
summary
knative 学习记录
type
Post

快速开始

安装

安装 docker

# 删除旧版本
yum remove -y docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-engine

# 设置 repository
yum install -y yum-utils
yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

# 安装 docker
yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

# 启动 docker
systemctl start docker

# 开启自启动 docker
systemctl enable docker

安装 go

# 下载并安装
cd ~
wget https://go.dev/dl/go1.19.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz

# 添加以下命令到 ~/.bash_profile 或 ~/.zshrc
# Go env setting
export GOROOT=/usr/local/go
export GOPATH=/root/go
export GOPROXY=https://goproxy.cn
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

# 重载配置
source ~/.bash_profile

安装 kind

# 安装 kind
go install sigs.k8s.io/kind@v0.14.0

安装 kubectl

# 安装 kubectl
cd ~
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

安装 Knative CLI

# 安装 Knative CLI
cd ~
git clone https://github.com/knative/client.git kn-client
cd kn-client/
hack/build.sh -f
mv kn /usr/local/bin

安装 Knative quickstart plugin

# 安装 Knative quickstart plugin
cd ~
git clone https://github.com/knative-sandbox/kn-plugin-quickstart.git
cd kn-plugin-quickstart/
hack/build.sh
mv kn-quickstart /usr/local/bin

Reference