当前位置: 首页 > news >正文

KubeVela交付

有什么用我也不想说了,这个是k8s CI/CD,进阶玩家玩的了,比你们喜欢Arg CD更科学,更现代

在 Kubernetes 中安装 KubeVela
helm repo add kubevela https://charts.kubevela.net/core
helm repo update
helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wait
启动VelaUX 控制台
#启用控制台wget https://github.com/kubevela/kubevela/releases/download/v1.9.6/kubectl-vela-v1.9.6-linux-amd64.zip
mv kubectl-vela /usr/bin/
vela addon enable velaux
#暴露端口
vela addon enable velaux serviceType=NodePort
vela status addon-velaux -n vela-system --endpoint# 你的链接地址http://192.168.0.193:30000/
登录完控制台配置集群

在这里插入图片描述

创建一个你的应用

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:name: first-vela-app
spec:components:- name: express-servertype: webserviceproperties:image: oamdev/hello-worldports:- port: 8000expose: truetraits:- type: scalerproperties:replicas: 1policies:- name: target-defaulttype: topologyproperties:# local 集群即 Kubevela 所在的集群clusters: ["你的K8s集群名字"]namespace: "default"- name: target-prodtype: topologyproperties:clusters: ["你的K8s集群名字"]# 此命名空间需要在应用部署前完成创建namespace: "prod"- name: deploy-hatype: overrideproperties:components:- type: webservicetraits:- type: scalerproperties:replicas: 2workflow:steps:- name: deploy2defaulttype: deployproperties:policies: ["target-default"]- name: manual-approvaltype: suspend- name: deploy2prodtype: deployproperties:policies: ["target-prod", "deploy-ha"]

创建你的应用

vela env init prod --namespace prod
# 执行
vela up -f first-app.yamlvela status first-vela-app

在这里插入图片描述

最后集成你的喜欢的GitLab或者jnekins,(本人比较喜欢Jenkins技术含量比较丰富,gitlab-ci就不做例子了,太幼稚简单了)

下面一条是jenkinsfile CI/CD(配置了动态slave,docker in docker)

pipeline {agent {kubernetes {inheritFrom 'devops'}}stages {stage('Get Code') {steps {checkout scmGit(branches: [[name: '*/release']], extensions: [], userRemoteConfigs: [[credentialsId: 'll', url: 'http://git.XXXX.com/wallet-pay/api.git']])}}stage('Test-docker....') {steps {//建议使用docker阶级构建一个容器即可container('docker'){sh 'docker BUILD'//script{//dockerlmage =  docker.build name + ":" + ${BUILD_ID}}}stage ('Deploy') {steps {sh '''curl -X POST -H 'content-type: application/json' --url http://192.168.0.193:30000/api/v1/webhook/9349hjwlasmpbo41 -d '{"upgrade": {"express-server": {//你的镜像"image": "${image}"}},"codeInfo": {"commit": "","branch": "","user": ""}}''''}}	}}
http://www.lryc.cn/news/195079.html

相关文章:

  • 【SpringCloud-10】SCA-nacos
  • 卡顿分析与布局优化
  • 【Vivado HLS Bug】Ubuntu环境下Vivado HLS导出IP报错:HLS ERROR: [IMPL 213-28]
  • 2022最新版-李宏毅机器学习深度学习课程-P14 批次(batch)与动量(momentum)
  • 谜题(Puzzle, ACM/ICPC World Finals 1993, UVa227)rust解法
  • acwing算法基础之数据结构--双链表
  • 将中文名格式化输出为英文名
  • 设计模式_迭代器模式
  • 【数据结构】:栈的实现
  • 微前端一:技术选型
  • FPGA project : flash_continue_write
  • 论文阅读:Rethinking Range View Representation for LiDAR Segmentation
  • 本地配置免费的https咋做?
  • 微信小程序框架---详细教程
  • 【LeetCode刷题(数组and排序)】:存在重复元素
  • 半导体产业链解析:晶圆厂、无晶圆厂与代工厂的比较与作用
  • Apipost一键压测已支持导入CSV文件
  • RabbitMQ的5种模式——再探RabbitMQ的模式,简单、工作,发布订阅(广播),路由、主题 页面分析
  • 初识华为云数据库GaussDB for openGauss
  • 深圳寄包裹到德国
  • 系统架构师备考倒计时22天(每日知识点)Redis篇
  • 现有库存(on-hand inventory),库存水平(inventory level),库存位置(inventory position)
  • 智慧空开让用电更安全、管理更智能——电脑APP远程控制开合闸
  • PyTorch 中张量运算广播
  • Blender:使用立方体制作动漫头像
  • 【ppt技巧】ppt里的图片如何提取出来?
  • Python学习基础笔记七十三——调试程序
  • BOSHIDA DC电源模块关于电容器的电解液位置
  • 如何实现 Es 全文检索、高亮文本略缩处理(封装工具接口极致解耦)
  • C++多线程编程(第四章 案例1,C++11和C++17 多核并行计算样例)