Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixiu Control Plane Build and Deploy Guide #490

Open
AlbumenJ opened this issue Sep 8, 2022 · 5 comments
Open

Pixiu Control Plane Build and Deploy Guide #490

AlbumenJ opened this issue Sep 8, 2022 · 5 comments
Assignees

Comments

@AlbumenJ
Copy link
Member

AlbumenJ commented Sep 8, 2022

What happened:

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

@AlbumenJ AlbumenJ mentioned this issue Sep 8, 2022
@bobtthp
Copy link
Contributor

bobtthp commented Sep 9, 2022

let me have a try

@bobtthp
Copy link
Contributor

bobtthp commented Sep 11, 2022

1、默认镜像仓库修改 -done
2、默认镜像修改 -done
3、编译脚本 -done
4、部署文档
5、开发调试文档

@thehackercat
Copy link

thehackercat commented Sep 11, 2022

I am also following this issue, anything I can do to help?

@bobtthp
Copy link
Contributor

bobtthp commented Sep 18, 2022

dubbo-pilot Control Plane 部署

1 总体目标

  • 控制面编译和镜像构建
  • 使用 istioctl 在 kubernetes 环境部署
  • 如何对控制面程序 debug

2 基本流程

这个例子将演示如何在编译 dubbo-pilot 控制平面并在 kubernetes 环境下如何使用 istioctl 进行部署
  1. 本地启动控制平面,对 dubbo-pilot 进行启动和 debug
  2. 使用 istioctl 在 k8s 环境启动和 debug

3 详细步骤

3.1 环境要求

  • Golang
  • Docker
  • Minikube/Kind
  • Kubectl

3.2 本地部署

3.2.1 编译

编译 docker-builder

cd dubbo-go-pixiu/tools/docker-builder && go install

docker-builder -h:

Builds Istio docker images

Usage:
   [flags]

Flags:
      --architecures strings   architectures to build (default [linux/amd64])
      --base-version string    base version to use (default "latest")
      --builder string         type of builder to use. options are crane or docker (default "docker")
  -h, --help                   help for this command
      --hub strings            docker hub(s) (default [localhost:5000])
      --istio-version string   istio version to use (default "1.14-dev")
      --kind-load              kind cluster to load into
      --no-cache               disable caching
      --no-clobber             do not allow pushing images that already exist
      --proxy-version string   proxy version to use (default "7ae8e27f274b33dc2f4d83100aea5971ed6698d3")
      --push                   push targets to registry
      --save                   save targets to tar.gz
      --tag strings            docker tag(s) (default [latest])
      --targets strings        targets to build (default [app,app_sidecar_centos_7,app_sidecar_debian_11,app_sidecar_ubuntu_jammy,app_sidecar_ubuntu_xenial,ext-authz,install-cni,istioctl,operator,pilot,proxyv2])
      --variants strings       variants to build (default [default])
      --version                show build version

使用 docker-builder 编译 && 构建镜像

编译 istioctl

docker-builder --targets istioctl

编译完成:

ls ls out/linux_amd64/
istioctl  logs  pilot-agent  pilot-discovery

编译 dubbo-pilot 并推送到私有镜像仓库

tools/docker-builder/docker-builder --targets pilot --hub docker.io/{repo_name} --push

16647226514805

3.2.2 部署

本地启动方式:
./out/linux_amd64/pilot-discovery

启动日志:
2022-09-24T15:31:56.751245Z	info	FLAG: --caCertFile=""
2022-09-24T15:31:56.751277Z	info	FLAG: --clusterAliases="[]"
2022-09-24T15:31:56.751280Z	info	FLAG: --clusterID="Kubernetes"
2022-09-24T15:31:56.751282Z	info	FLAG: --clusterRegistriesNamespace="istio-system"
2022-09-24T15:31:56.751284Z	info	FLAG: --configDir=""
2022-09-24T15:31:56.751286Z	info	FLAG: --ctrlz_address="localhost"
2022-09-24T15:31:56.751289Z	info	FLAG: --ctrlz_port="9876"
2022-09-24T15:31:56.751291Z	info	FLAG: --domain="cluster.local"
...
2022-09-24T15:31:56.753814Z	info	initializing mesh configuration ./etc/istio/config/mesh

3.3 容器部署

3.3.1 镜像构建

构建远程 debug 镜像

下载 dlv

git clone https://github.com/go-delve/delve.git
make install

which dlv
/root/go/bin/dlv

Dockerfile 增加dlv dubbo-go-pixiu/pilot/docker/Dockerfile.pilot:

COPY ${TARGETARCH:-amd64}/dlv /usr/local/bin/dlv

拷贝 dlv 至镜像挂载目录中:

cp /root/go/bin/dlv out/linux_amd64/dockerx_build/build.docker.pilot/amd64/dlv

镜像构建:

docker-builder --targets pilot --hub docker.io/bobtthp --push --tag debug

16647249484357

3.3.1 部署

使用刚构建的镜像部署:

out/linux_amd64/istioctl --set .values.pilot.image=bobtthp/pilot:latest install

远程 debug:

dlv --listen=:8015 --headless=true --api-version=2 --log attach `ps -ef |grep pilot-discovery| awk '{print $2}'`

4.0 错误 tips

如果遇到这个错误:

 => ERROR [internal] booting buildkit                                                                                                      15.0s
 => => pulling image gcr.io/istio-testing/buildkit:v0.10.3                                                                                 15.0s
------
 > [internal] booting buildkit:
------
ERROR: Error response from daemon: Get "https://gcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

修改: ~/.docker/buildx/instances/container-builder
pulling image gcr.io/istio-testing/buildkit:v0.10.3 ==> "image":"moby/buildkit:buildx-stable-1"

@bobtthp
Copy link
Contributor

bobtthp commented Oct 8, 2022

PR: #504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

3 participants