本操作适用于在阿里云的Container Service For Kubernetes (ACK) 容器服务上部署
使用hal搭建,有很多资源都在gcr上需要翻墙,可以直接买一台临时的硅谷服务器用来发布(hal安装不支持centos)
配置环境
为hal新建用户
adduser ops
//给它增加sudo 权限 修改/etc/sudoers
安装kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x kubectl && mv kubectl /usr/bin
安装Halyard
curl -O https://raw.githubusercontent.com/spinnaker/halyard/master/install/debian/InstallHalyard.sh
sudo bash InstallHalyard.sh
配置kubectl
切换到用户ops
su ops
配置kube config,将自己的kube config文件上传到ops目录下
mkdir $HOME/.kube
scp root@$MASTER:/etc/kubernetes/kube.conf $HOME/.kube/config
hal配置 Cloud Provider
hal config provider docker-registry enable
// 配置你的镜像源地址
echo you passwd | hal config provider docker-registry account add aliyunregistry \
--no-validate \
--address https://registry-vpc.cn-hangzhou.aliyuncs.com/ \
--repositories $REPOSITORIES \
--username 'your name' \
--password
CONTEXT=$(kubectl config current-context)
hal config provider kubernetes account add k8s-v2-account \
--provider-version v2 \
--context kubernetes-ops \
--docker-registries aliyunregistry
hal配置storage
选择Minio(Minio is an S3-compatible object store that you can host yourself)
Losing Minio’s data will mean losing all your Spinnaker application metadata, and configured pipelines
创建~/.hal/$DEPLOYMENT/profiles/front50-local.yml
spinnaker.s3.versioning: false
echo “your secret-access-key” | hal config storage s3 edit --endpoint "http://minio-service:9000" --access-key-id "your access-key-id" --secret-access-key
hal config storage edit --type s3
hal config storage s3 edit --path-style-access true
网友评论