Jenkins CD container at Kubernet

I am going to have a Jenkins CD pipeline that accepts my application, publishes a docker image in my private docker repository. I think I know how to do this.

That I'm not sure about this is part of the Kubernetes. I want to take this image and deploy it to my own Kubernetes cluster (currently 1 Master and 1 Slave).

Question: Should this Jenkins Slave with kubectl and docker installed be part of the Kubernetes cluster to start the deployment? How can I start this deployment?

+4
source share
3 answers

Assuming your cluster has the following deployment:

apiVersion: apps/v1beta1 # for versions before 1.6.0 use 
extensions/v1beta1
kind: Deployment
metadata:
   name: foobar-deployment
spec:
  replicas: 3
  template:
    metadata:
      labels:
        app: foobar-app
    spec:
      containers:
      - name: foobar
        image: foobar-image:v1
        ports:
        - containerPort: 80

- Kubernetes :

kubectl set image deployment/foobar-deployment foobar=foobar-image:version

version - , . .

Kubernetes, ( ssh ), . version .

+3

Yenkin kubectl. kubernetes admin.conf $HOME/.kube/config Jenkin. kubectl .

 Kubectl  --kubeconfig=admin.conf create –f <deployment.yml>

:

, .

+2

CD- Jenkins, , . , , .

, , .

, CI.

, , . Kubernetes ( 1 Master 1 Slave).

CI , , . ( + YAML) git git, , .

: Jenkins Slave, kubectl docker, Kubernetes ? ?

CI (, Jenkins) Kubernetes, , , CI.

, - , GitOps, :

. :


Disclaimer: I am a Kubernetes employee and a Weaveworks employee. We build open source tools and commercial tools that help people get to Kubernete faster.

0
source

Source: https://habr.com/ru/post/1681585/


All Articles