Docker VotingApp在Kubernetes上构build/发布Jenkins不是幂等的
我正在通过Jenkins和Docker投票应用程序尝试部署Kubernetes。 我使用Azure容器registry作为Docker镜像的存储库。 首先尝试所有部署好:
当我重新运行pipe道而不更改某些内容时,出现以下错误:
Redis服务定义:
--- apiVersion: v1 kind: Service metadata: creationTimestamp: null labels: app: redis version: alpine name: redis selfLink: /api/v1/namespaces//services/redis spec: clusterIP: ports: - name: port: 6379 protocol: TCP targetPort: 6379 selector: app: redis version: alpine sessionAffinity: None type: ClusterIP status: loadBalancer: {} ---
docker图像是用“最新”标签构build的。
stage 'Checkout' node { git 'https://github.com/*****/example-voting-app.git' // Checks out example votiung app repository stage 'Docker Builds' docker.withRegistry('https://*****.azurecr.io', 'private-login') { parallel( "Build Worker App":{def myEnv = docker.build('*****.azurecr.io/example-voting-app-worker:latest', 'worker').push('latest')}, "Build Result App":{def myEnv = docker.build('*****.azurecr.io/example-voting-app-result:latest', 'result').push('latest')}, "Build Vote App":{def myEnv = docker.build('*****.azurecr.io/example-voting-app-vote:latest', 'vote').push('latest')} ) } stage 'Kubernetes Deployment' sh 'kubectl apply -f kubernetes/basic-full-deployment.yml' sh 'kubectl delete pods -l app=vote' sh 'kubectl delete pods -l app=result' stage 'Smoke Test' sh 'kubectl get deployments' }
您的定义包含由apiserver自动生成/pipe理的字段。 其中一些是在创build对象时创build的,之后不能更新。 从您的文件中删除以下字段,使其感到高兴:
metadata: creationTimestamp: null selfLink: /api/v1/namespaces//services/redis status: loadBalancer: {}
- 如何从Azure容器实例中的容器连接到Azure中虚拟机的内部IP
- 通过Azure子域上的https访问Docker容器
- Azure应用程序容器 – 代理访问端口443 – 混合内容
- 在Azure-Container-Service中安装卷对于traefik.toml和/var/run/docker.sock不起作用
- 如何将docker hub私有registry中的docker映像拖放到Azure容器服务(ACS)中?
- 带有Azure容器服务和Kubernetes的HTTPS
- 想在azure色的windows server 2016上运行docker
- 如何将IP路由到Ubuntu的另一个IP?
- Docker-Flink:在Docker Swarm的不同节点中,TaskManager无法findJobManager