Spinnaker
概述
部署
交付minio
1. harbor上创建armory私有仓库
1 docker pull minio/minio:latest 2 docker tag 703bd3096c96 harbor.od.com/armory/minio:latest 3 docker push harbor.od.com/armory/minio:latest
2. 创建k8s集群secret资源
1 kubectl create ns armory 2 kubectl create secret docker-registry harbor --docker-server=harbor.od.com --docker-username=admin --docker-password=1 -n armory
3. 准备资源配置清单
mkdir /data/k8s-yaml/minio mkdir /data/nfs-volume/minio cd /data/nfs-volume/minio
vi dp.yaml kind: Deployment apiVersion: extensions/v1beta1 kind: Deployment metadata: labels: name: minio name: minio namespace: armory spec: progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 7 selector: matchLabels: name: minio template: metadata: labels: app: minio name: minio spec: containers: - name: minio image: harbor.od.com/armory/minio:latest imagePullPolicy: IfNotPresent ports: - containerPort: 9000 protocol: TCP args: - server - /data env: - name: MINIO_ACCESS_KEY value: admin - name: MINIO_SECRET_KEY value: admin123 readinessProbe: failureThreshold: 3 httpGet: path: /minio/health/ready port: 9000 scheme: HTTP initialDelaySeconds: 10 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 volumeMounts: - mountPath: /data name: data imagePullSecrets: - name: harbor volumes: - nfs: server: ecs182-149 path: /data/nfs-volume/minio name: data
vi svc.yaml apiVersion: v1 kind: Service metadata: name: minio namespace: armory spec: ports: - port: 80 protocol: TCP targetPort: 9000 selector: app: minio
vi ingress.yaml kind: Ingress apiVersion: extensions/v1beta1 metadata: name: minio namespace: armory spec: rules: - host: minio.od.com http: paths: - path: / backend: serviceName: minio servicePort: 80
4. 内网配置bind地址解析
minio A 172.26.28.194
systemctl restart named
交付缓存redis
1. 下载镜像
1 docker pull redis:4.0.14 2 docker tag f54239c50400 harbor.od.com/armory/redis:v4.0.14 3 docker push harbor.od.com/armory/redis:v4.0.14
2. 创建目录,准备资源配置清单
mkdir /data/k8s-yaml/redis cd /data/k8s-yaml/redis/
1 vi dp.yaml 2 3 kind: Deployment 4 apiVersion: extensions/v1beta1 5 kind: Deployment 6 metadata: 7 labels: 8 name: redis 9 name: redis 10 namespace: armory 11 spec: 12 replicas: 1 13 revisionHistoryLimit: 7 14 selector: 15 matchLabels: 16 name: redis 17 template: 18 metadata: 19 labels: 20 app: redis 21 name: redis 22 spec: 23 nodeName: ecs28-201.host.name 24 containers: 25 - name: redis 26 image: harbor.od.com/armory/redis:v4.0.14 27 imagePullPolicy: IfNotPresent 28 ports: 29 - containerPort: 6379 30 protocol: TCP 31 imagePullSecrets: 32 - name: harbor
1 # 创建service的原因是通过k8s集群内部使用service名字连接redis服务 2 vi svc.yaml 3 4 apiVersion: v1 5 kind: Service 6 metadata: 7 name: redis 8 namespace: armory 9 spec: 10 ports: 11 - port: 6379 12 protocol: TCP 13 targetPort: 6379 14 selector: 15 app: redis
交付成功,模拟自动化场景。
1. 将test和prod名称空间的pod调整为0再删除
页面会出现抖动情况,将浏览器分辨率调整为125%即可解决。
添加流水线参数
如果构建时出现jenkins job 404情况,需要配置jenkins
filebeat
修改deployjson文件,将镜像写成变量方式
1 "imageId": "harbor.od.com/${parameters.image_name}:${parameters.git_ver}_${parameters.add_tag}", 2 "registry": "harbor.od.com", 3 "repository": "${parameters.image_name}", 4 "tag": "${parameters.git_ver}_${parameters.add_tag}"
保存之后再次构建
需要对外访问的customer的配置ingress和svc