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

自己做的网站注册用户无法收到激活邮箱的邮件国家企业信用公示信息系统入口

自己做的网站注册用户无法收到激活邮箱的邮件,国家企业信用公示信息系统入口,二十条优化,做网站开发需要什么tekton 发布 kubernetes 应用 基于Kubernetes 服务部署 Tekton Pipeline 实例#xff0c;部署完成后使用tekton来完成源码拉取、应用打包、镜像推送和应用部署。 本文实现一个 golang-helloworld 项目 CI/CD 的完整流程#xff0c;具体包括以下步骤#xff1a; 从 gitee…tekton 发布 kubernetes 应用 基于Kubernetes 服务部署 Tekton Pipeline 实例部署完成后使用tekton来完成源码拉取、应用打包、镜像推送和应用部署。 本文实现一个 golang-helloworld 项目 CI/CD 的完整流程具体包括以下步骤 从 gitee 仓库拉取代码将源码构建成二进制文件根据 Dockerfile 构建镜像并推送到阿里云ACR镜像仓库使用sed命令替换yaml文件中的镜像地址为上一步构建的镜像使用 kubectl apply -f 命令部署yaml文件到kubernetes集群 示例git仓库https://gitee.com/willzhangee/tekton-golang-demo 创建serviceaccount 镜推送到外部镜像仓库需要进行认证创建登录阿里云ACR仓库的secret kubectl create secret docker-registry aliyun-acr \ --docker-serverhttps://registry.cn-shenzhen.aliyuncs.com \ --docker-usernameyour-username \ --docker-passwordyour-password \ --dry-runclient -o json | jq -r .data..dockerconfigjson | base64 -d /tmp/config.jsonkubectl create secret generic docker-config --from-file/tmp/config.json创建kubernetes secret kubectl create secret generic kubernetes-config --from-file/root/.kube/config创建serviceAccount $ cat serviceaccount.yaml apiVersion: v1 kind: ServiceAccount metadata:name: build-bot secrets:- name: docker-config- name: kubernetes-config --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata:name: tekton-kubectl-role rules: - apiGroups:- *resources:- pods- deployments- deployments/scale- deployments/statusverbs:- get- list- watch- create- delete- patch- update --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata:name: tekton-kubectl-binding subjects: - kind: ServiceAccountname: build-bot roleRef:apiGroup: rbac.authorization.k8s.iokind: Rolename: tekton-kubectl-role应用yaml文件 kubectl apply -f serviceaccount.yaml创建 git-clone task 在执行镜像构建前Dockerfile存放在git仓库中需要将代码克隆到本地需要安装git-clone task这里使用官方task。 kubectl apply -f \ https://raw.githubusercontent.com/tektoncd/catalog/main/task/git-clone/0.9/git-clone.yaml创建kaniko-build task 创建kaniko-build task用于构建dokcer镜像基于官方kaniko-task改造。 $ cat kaniko-build-task.yaml apiVersion: tekton.dev/v1beta1 kind: Task metadata:name: kaniko-build spec:params:- name: IMAGE_URLdescription: Name (reference) of the image to build.- name: IMAGE_TAGdescription: Tag to apply to the built imagedefault: latest- name: DOCKERFILEdescription: Path to the Dockerfile to build.default: ./Dockerfile- name: CONTEXTdescription: The build context used by Kaniko.default: ./- name: EXTRA_ARGStype: arraydefault: []- name: BUILDER_IMAGEdescription: The image on which builds will run (default is v1.5.1)default: gcr.io/kaniko-project/executor:v1.5.1sha256:c6166717f7fe0b7da44908c986137ecfeab21f31ec3992f6e128fff8a94be8a5workspaces:- name: sourcedescription: Holds the context and Dockerfile- name: dockerconfigdescription: Includes a docker config.jsonoptional: truemountPath: /kaniko/.dockerresults:- name: IMAGE_DIGESTdescription: Digest of the image just built.- name: IMAGE_URLdescription: URL of the image just built.steps:- name: build-and-pushworkingDir: $(workspaces.source.path)image: $(params.BUILDER_IMAGE)args:- $(params.EXTRA_ARGS)- --dockerfile$(params.DOCKERFILE)- --context$(workspaces.source.path)/$(params.CONTEXT)- --destination$(params.IMAGE_URL):$(params.IMAGE_TAG)- --digest-file$(results.IMAGE_DIGEST.path)securityContext:runAsUser: 0应用yaml文件 kubectl apply -f kaniko-build-task.yaml创建kubernetes-deploy task 创建kubernetes-deploy task用于部署yaml文件到kubernetes集群。 $ cat kubernetes-deploy-task.yaml apiVersion: tekton.dev/v1beta1 kind: Task metadata:name: kubernetes-deploy spec:workspaces:- name: manifest-dir- name: kubeconfig-dirmountPath: /root/.kubeparams:- name: pathToYamlFiledescription: The path to the yaml file to deploy within the git sourcedefault: deployment.yaml- name: IMAGE_URL- name: IMAGE_TAG- name: KUBECTL_IMAGEdefault: docker.io/bitnami/kubectl:lateststeps:- name: run-kubectlimage: $(params.KUBECTL_IMAGE)workingDir: $(workspaces.manifest-dir.path)script: |sed -i s#IMAGE#$(params.IMAGE_URL)#g $(params.pathToYamlFile)sed -i s#TAG#$(params.IMAGE_TAG)#g $(params.pathToYamlFile)kubectl apply -f $(params.pathToYamlFile)应用yaml文件 kubectl apply -f kubernetes-deploy-task.yaml创建pipeline和pipelinerun $ cat pipeline-run.yaml apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata:name: devops-hello-world-pipeline spec:workspaces:- name: shared-data- name: docker-config- name: kubernetes-configparams:# git-clone- name: git_urltype: string- name: revisiontype: string- name: gitInitImagetype: string# kaniko-build- name: dockerfiletype: stringdescription: reference of the image to build- name: builder_imagetype: stringdescription: reference of the image to build- name: image_urldescription: Url of image repository- name: image_tagdescription: Tag to apply to the built imagedefault: latest# kubernetes-deploy- name: kubectl_imagetype: stringtasks:- name: clonetaskRef:name: git-cloneworkspaces:- name: outputworkspace: shared-dataparams:- name: urlvalue: $(params.git_url)- name: revisionvalue: $(params.revision)- name: gitInitImagevalue: $(params.gitInitImage)- name: build-push-imageparams:- name: DOCKERFILEvalue: $(params.dockerfile)- name: IMAGE_URLvalue: $(params.image_url)- name: IMAGE_TAGvalue: $(tasks.clone.results.commit)- name: BUILDER_IMAGEvalue: $(params.builder_image)taskRef:name: kanikorunAfter:- cloneworkspaces:- name: sourceworkspace: shared-data- name: dockerconfigworkspace: docker-config- name: deploy-to-k8staskRef:name: kubernetes-deployparams:- name: KUBECTL_IMAGEvalue: $(params.kubectl_image)- name: IMAGE_URLvalue: $(params.image_url)- name: IMAGE_TAGvalue: $(tasks.clone.results.commit)- name: pathToYamlFilevalue: deployment.yamlworkspaces:- name: manifest-dirworkspace: shared-data- name: kubeconfig-dirworkspace: kubernetes-configrunAfter:- build-push-image --- apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata:generateName: devops-hello-world-pipeline-run- spec:serviceAccountName: build-botpipelineRef:name: devops-hello-world-pipelineparams:# git-clone- name: git_urlvalue: https://gitee.com/willzhangee/tekton-golang-demo.git- name: revisionvalue: master- name: gitInitImage#value: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:latestvalue: dyrnq/tektoncd-pipeline-cmd-git-init:latest# kaniko- name: dockerfilevalue: ./Dockerfile- name: builder_image# value: gcr.io/kaniko-project/executor:v1.5.1sha256:c6166717f7fe0b7da44908c986137ecfeab21f31ec3992f6e128fff8a94be8a5value: docker.io/bitnami/kaniko:latest- name: image_urlvalue: registry.cn-shenzhen.aliyuncs.com/cnmirror/devops-hello-world- name: image_tagvalue: latest# kubernetes-deploy- name: kubectl_imagevalue: docker.io/bitnami/kubectl:latestworkspaces:- name: shared-datavolumeClaimTemplate:spec:accessModes:- ReadWriteOncestorageClassName: openebs-hostpathresources:requests:storage: 1Gi- name: docker-configsecret:secretName: docker-config- name: kubernetes-configsecret:secretName: kubernetes-config参数说明 gitInitImage执行git clone任务的镜像官方镜像无法访问推荐在docekrhub中查找替代镜像builder_image执行kaniko 构建任务的镜像官方镜像无法访问推荐在docekrhub中查找替代镜像image_url最终构建的应用镜像serviceAccountName指定serviceAccountName用于认证shared-data workspace用于在不同任务之间共享数据PipelineRun中定义了volumeClaimTemplate类型的workspaces能够动态申请所需的持久卷使用kubectl get storageclass命令确认k8s集群有默认可用的storageclass资源可用本示例输出为openebs-hostpath (default)docker-config workspace用于镜像仓库认证的secret卷将secret中的config.json挂载到/kaniko/.docker下kubernetes-config用于访问kubernetes挂载到/root/.kube目录下 应用yaml文件 kubectl create -f pipeline-run.yaml查看pipelinerun执行结果 连接到kubernetes 确认部署的应用 rootkube001:~# kubectl get pods -l rungo-web-app NAME READY STATUS RESTARTS AGE go-web-app-79454cfdd7-dcz7p 1/1 Running 0 64s查看镜像信息 rootkube001:~# kubectl get pods go-web-app-79454cfdd7-dcz7p -o jsonpath{.spec.containers[0].image} registry.cn-shenzhen.aliyuncs.com/cnmirror/devops-hello-world:927ec5cc665690ad798ffbbd02a8db520692951e参考https://juejin.cn/post/7073347226772340749
http://www.hkea.cn/news/14488689/

相关文章:

  • 建网站需要哪些条件苏州妙笔网络科技有限公司
  • 石墨网站开发帝国cms做英文网站
  • 专门为98k做的网站杭州网站制作公司排名
  • 做网站的公司地址网站无法打开网页是怎么回事
  • 设计制作网站的公司有哪些做企业网站的
  • 鹤壁公司做网站市场营销价格策略
  • 榆次网站建设网站通栏设计素材
  • 在阿里云做的网站怎么进后台推广下载app
  • 做网站与全网营销搜索推广排名优化网站是怎么赢利的
  • 百度打开百度搜索整站seo怎么做
  • 电商网站可以用dw做搜索引擎优化介绍
  • 凯杰建设有限公司官方网站域名可以绑定网站吗
  • 燕十八html教程网站建设asp网站开发教程pdf
  • wordpress只能做博客吗巩义企业网站快速优化多少钱
  • 做前端常用的网站及软件南戴河区网站建设哪家好
  • 国内十大网站建设公司排名google app engine wordpress
  • 开发一个网站系统报价济南建设网站平台
  • 网站制作建设公司推荐常州网站公司怎么选
  • 做360手机网站优化免费发布推广的平台有哪些
  • 做花语的网站wordpress添加优酷视频播放器
  • 游戏型网站开发想做分销商有什么平台
  • 广东做网站公司南昌seo优化公司
  • 襄阳网站开发wordpress登陆界面
  • 做网站一定要云解析吗学广告设计需要什么学历
  • 做百度手机网站点击wordpress全景图
  • 企业形象通用网站价格低的形容词
  • 网站的优势和劣势网站建设营销推广工作
  • 一个网站怎么做镜像站榆林seo
  • 淄博专业网站设计wordpress 单页 主题
  • 清河做网站多少钱苏州 网站制作公司