Easy CD-CI with Jenkins, Docker Swarm and Docker secrets

Поделиться
HTML-код
  • Опубликовано: 13 дек 2024

Комментарии • 41

  • @relicfrog
    @relicfrog 7 лет назад +3

    very nice presentation, thanx a lot :)

  • @rickytik-devops
    @rickytik-devops 7 лет назад

    how does the db containers retain it's db when updating it's image? i read in dockers is by mounting it on the volume. exactly how it's done?

  • @Mosheinventions
    @Mosheinventions 7 лет назад

    hi which module for GitHub because I am having difficult time finding the one you have, I have latest version of Jenkins and it doesn't have the one you have

  • @Mosheinventions
    @Mosheinventions 7 лет назад

    at 5:33 you say it is a docker service how do you log into a service it is not a container

  • @gujaratsantana
    @gujaratsantana 7 лет назад +1

    Thank you...

  • @billyb9573
    @billyb9573 6 лет назад +1

    awsome thanks

  • @prabhatranjan4467
    @prabhatranjan4467 7 лет назад

    Nice ...Which was tool used to open the port ?

    • @krasigeorgiev7283
      @krasigeorgiev7283 7 лет назад

      open the port ? not sure what do you mean , which part in the video ?

  • @Mike-lu8wc
    @Mike-lu8wc 7 лет назад

    Hi again,
    When setting a GitHub authentification mechanism, the swarm agent fail to connect to the master. Any idea how to overcome this? Tried several things but in vain ...
    Thx.

    • @Mike-lu8wc
      @Mike-lu8wc 7 лет назад

      Found how to do it: using Personal access tokens and docker secrets. thx.

  • @adityainapurapu2026
    @adityainapurapu2026 7 лет назад

    Hello, which version of docker was used for this demo?

    • @krazycocoonlab5217
      @krazycocoonlab5217  7 лет назад

      I think 1.13 , but I am not too sure. It shouldn't make any difference as I don't they have changed anything drastically the last few months.

  • @РоманВоловик-з3д
    @РоманВоловик-з3д 4 года назад

    Cool

  • @imedman1
    @imedman1 6 лет назад

    Thanks, this will help me a lot!

  • @vd7205
    @vd7205 7 лет назад

    Since --detach=false was not specified, tasks will be created in the background.
    In a future release, --detach=false will become the default.
    I don't have any nodes.. any help please !

    • @krasigeorgiev7283
      @krasigeorgiev7283 7 лет назад +1

      best to ask in the docker irc channel or their forums.

    • @vd7205
      @vd7205 7 лет назад

      I got this error for: docker service create --name jenkins-master...etc. and second, for: docker service create \ --mode=global \... etc. anyway I learnt a lot from your tut! thx!

    • @vd7205
      @vd7205 7 лет назад

      hey Krasi, I dealt with that errors... now I have all of them(nodes) in jenkins, but : This agent is offline because Jenkins failed to launch the agent process on it. See log for more details
      in Logs - no messages nothing, just pending cursor. I sow in this video you got the same problem.. at 10:27 you cut the video quick.... do you have any idea what can help me? Thank you for your time!

  • @Mosheinventions
    @Mosheinventions 7 лет назад

    it is at 6:07

  • @LuisFlores1961
    @LuisFlores1961 6 лет назад +1

    Excellent, very useful, your links are not working though, I guess it is your intranet they point to =(

    • @mphoraf1386
      @mphoraf1386 6 лет назад +1

      try this new link: github.com/krasi-georgiev/cd-demo

  • @Mosheinventions
    @Mosheinventions 7 лет назад

    hi how did you log into that node to get Jenkins password inorder to get it proceed

    • @krazycocoonlab5217
      @krazycocoonlab5217  7 лет назад

      what time in the video is this ?

    • @Mosheinventions
      @Mosheinventions 7 лет назад

      6:07

    • @krazycocoonlab5217
      @krazycocoonlab5217  7 лет назад

      I logged in using ssh , you can use VmWare on your laptop or open a free account with AWS and you will get a VM with ssh enabled.

    • @Mosheinventions
      @Mosheinventions 7 лет назад

      I ran this on docker swarm I need to do is docker exec "process id" /bin/sh
      and then just do more on /var/jenkins_home/secrets/initialAdminPassword

  • @npapoyan
    @npapoyan 7 лет назад +1

    Hi, First of all thanks for the tutorial. I'm having trouble creating the service on stage and prod nodes, after creating in testing.
    ---test--
    root@docker-swarm-testing ~ # docker service create \
    > --mode=global \
    > --name jenkins-swarm-agent \
    > -e LABELS=docker-test \
    > --mount "type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" \
    > --mount "type=bind,source=/tmp/,target=/tmp/" \
    > --secret source=jenkins-v1,target=jenkins \
    > vipconsult/jenkins-swarm-agent
    x278b51m4qq6s4xhtz2srnni3
    root@docker-swarm-testing bin # docker service ls
    ID NAME MODE REPLICAS IMAGE
    2abp4epr6az3 jenkins-master replicated 1/1 jenkins:latest
    x278b51m4qq6 jenkins-swarm-agent global 0/3 vipconsult/jenkins-swarm-agent:latest
    root@docker-swarm-testing bin #
    -- stage --
    root@docker-swarm-staging bin # docker service create \
    > --mode=global \
    > --name jenkins-swarm-agent \
    > -e LABELS=docker-stage \
    > --mount "type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" \
    > --mount "type=bind,source=/tmp/,target=/tmp/" \
    > --secret source=jenkins-v1,target=jenkins \
    > vipconsult/jenkins-swarm-agent
    Error response from daemon: rpc error: code = 2 desc = name conflicts with an existing object
    root@docker-swarm-staging bin #
    root@docker-swarm-staging bin # docker service ls
    ID NAME MODE REPLICAS IMAGE
    2abp4epr6az3 jenkins-master replicated 1/1 jenkins:latest
    x278b51m4qq6 jenkins-swarm-agent global 0/3 vipconsult/jenkins-swarm-agent:latest
    root@docker-swarm-staging bin #
    root@docker-swarm-staging bin # docker version
    Client:
    Version: 1.13.1
    API version: 1.26
    Package version:
    Go version: go1.7.4
    Git commit: 3a17ad5/1.13.1
    Built: Fri May 26 17:33:48 2017
    OS/Arch: linux/amd64
    Server:
    Version: 1.13.1
    API version: 1.26 (minimum version 1.12)
    Package version:
    Go version: go1.7.4
    Git commit: 3a17ad5/1.13.1
    Built: Fri May 26 17:33:48 2017
    OS/Arch: linux/amd64
    Experimental: false
    root@docker-swarm-staging bin #
    ---
    Do you know what can be the issue? I've tried using different names, such as "--name jenkins-swarm-agent-stage" and "--name jenkins-swarm-agent-prod", and even thought that didn't error out, the nodes didn't show up in Jenkins - > manage nodes.
    Thanks

    • @krazycocoonlab5217
      @krazycocoonlab5217  7 лет назад

      check the jenkins-swarm-agent service logs, it should give you some clue.

  • @vd7205
    @vd7205 7 лет назад

    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] stage
    [Pipeline] { (Publish)
    [Pipeline] withDockerRegistry
    [Pipeline] // withDockerRegistry
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] }
    [Pipeline] // node
    [Pipeline] End of Pipeline
    GitHub has been notified of this commit’s build result
    ERROR: Could not find credentials matching DockerHub
    Finished: FAILURE
    hey, any ideas?

    • @vd7205
      @vd7205 7 лет назад

      Hi, in Jenkins file you will see something like this """ stage("Publish") {
      withDockerRegistry([credentialsId: 'DockerHub']) {
      sh "docker push ${DOCKERHUB_USERNAME}/cd-demo:${BUILD_NUMBER}"
      }what you need to do is : to create a jenkins credentials with the name ID 'DockerHub' + your password and username from your docker hub...and after you will be fine..

    • @vd7205
      @vd7205 7 лет назад

      mate, go to UI (user interface) Jenkins main page: 1. press credentials
      2. press Add Credentials
      3. insert your real passwd and user from dockerhub
      4.on ID field write: DockerHub
      5.Descriptions: blabla
      happy new year! :D

    • @vd7205
      @vd7205 7 лет назад

      maybe, you missed something..
      try again from the beginning..
      watch again this video..
      1. you need to have 3 instances in docker Swarm mode
      2. sudo usermod -a -G docker $USER (on all instances - slaves) +you need to restart docker
      3. docker service create --name jenkins-master -p 50000:50000 -p 80:8080 jenkins (on master) + + install (Self-Organizing Swarm Plug-in)
      4.echo "-master 35.2%%% -password admin -username admin" | docker secret create jenkins-v1 - ( on master and 2 nodes is the same SECRET WITH THE SAME IP like on master)
      5. docker service create \
      --mode=global \
      --name jenkins-swarm-agent \
      -e LABELS=docker-test \ ........
      (on master) -
      6.docker service create \
      --mode=global \
      --name jenkins-swarm-agent \
      -e LABELS=docker-stage \
      .....(node 1)
      7. docker service create \
      --mode=global \
      --name jenkins-swarm-agent \
      -e LABELS=docker-prod \...
      ...node2_)
      8. now on jenkins main page you will see your (created nodes - slaves)
      9. you need to create credentials in jenkins (for github and for dockerhub like i told you before)
      10. you need to create a webhook in github ( search how to create a web hook jenkins and github)
      11.clone the repo and change env.DOCKERHUB_USERNAME = 'yourdockerusername'
      12. push to repo and jenkins will automaticaly will start the build
      13. DONE
      your problem is in Pipeline] // withDockerRegistry ( check again credentials ID )
      don;t give up and have fun! :D

    • @vd7205
      @vd7205 7 лет назад

      nope :(

  • @antonputra88
    @antonputra88 7 лет назад +3

    git commit --allow-empty -m "Trigger notification"

  • @erangour1223
    @erangour1223 7 лет назад

    got it working just fine, stupid mistake with IP's lol