安装Spinnaker

安装Spinnaker安装 Spinnaker

视频地址:https://www.bilibili.com/video/BV1eS4y1F7pN/

0. 准备一个Kubernetes集群(略)

$ kubectl get nodes NAME STATUS ROLES AGE VERSION myoci.site Ready control-plane,master 3d12h v1.21.4 

1. 为了更方便外部访问,安装Nginx Ingress

kubectl label node myoci.site ingress-ready=true 
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml 

2. 使用Docker容器安装Halyard

mkdir ~/.hal docker run -d --name halyard --restart=always -v ~/.hal:/home/spinnaker/.hal -v ~/.kube:/home/spinnaker/.kube gcr.io/spinnaker-marketplace/halyard:stable 

确认安装,

docker exec -it halyard bash 
hal -v 

3. 选择云提供商

hal config provider kubernetes enable 

添加Kubernetes集群账户

hal config provider kubernetes account add spinnaker-admin --context $(kubectl config current-context) 

选择运行环境

hal config deploy edit --account-name spinnaker-admin --type distributed --location spinnaker 

4. 部署Storageclass(可选)

Kubernetes集群需要有Storageclass动态提供存储,如果没有的话需要创建一个默认的Storageclass。

安装nfs-server

sudo su - echo "/nfs/data/ *(insecure,rw,sync,no_root_squash)" > /etc/exports mkdir -p /nfs/data sudo yum install -y nfs-utils systemctl enable rpcbind --now systemctl enable nfs-server --now # 设置生效 exportfs -r exportfs 

通过nfs-subdir-external-provisioner创建Storageclass

helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/ helm repo update 
helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \ --set nfs.server=xxx.xxx.xxx.xxx \ --set nfs.path=/nfs/data 

nfs-client设置为默认storageclass

kubectl patch storageclass nfs-client -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' 

5. 选择存储方式(本例使用minio)

kubectl create ns minio 

安装Minio

helm repo add minio https://helm.min.io/ helm install -n minio --generate-name minio/minio 

获取ACCESS_KEY和SECRET_KEY

kubectl -n minio get secret minio- 
  
    -o jsonpath="{.data.accesskey}" | base64 -d kubectl -n minio get secret minio- 
   
     -o jsonpath="{.data.secretkey}" | base64 -d 
    
  

配置Minio存储

hal config storage s3 edit --endpoint http://minio- 
  
    .minio.svc.cluster.local:9000 --access-key-id 
   
     --secret-access-key 
    
      --path-style-access true 
     
    
  
hal config storage edit --type s3 

Minio不支持对象版本控制,需要在Spinnaker中将其禁用

mkdir -p ~/.hal/default/profiles/ cat > ~/.hal/default/profiles/front50-local.yaml < 
  

6. 部署Spinnaker

hal version list hal config version edit --version 1.26.6 

执行部署(如果发生错误,再次执行一次)

hal deploy apply 

确认

kubectl get pods -n spinnaker 

部署Ingress

cat < 
  

修改Spinnaker Deck和Gate的域名配置

hal config security ui edit --override-base-url http://spinnaker.spinbook.local hal config security api edit --override-base-url http://spinnaker-gate.spinbook.local 

重新部署Spinnaker,使配置生效

hal deploy apply 

修改/etc/hosts

sudo vi /etc/hosts --- add 127.0.0.1 spinnaker-gate.spinbook.local spinnaker.spinbook.local --- 

7. 访问Spinnaker

打开浏览器,访问http://spinnaker.spinbook.local

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7SqFEzsq-02)(images/image-.png)]在这里插入图片描述

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/217546.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月18日 上午9:20
下一篇 2026年3月18日 上午9:20


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号