Trying jenkins plugin Blue Ocean

after installing the plugin by using plugin configuration

launch by using the blue ocean button

Then let’s « create our first pipeline »

First job : configure where the code is … github is an easy way

you must create a file Jenkinsfile in your repo

Jenkinsfile :

pipeline {
     agent any
stages {
    stage('Build') {
        steps {
            echo 'Building..'
        }
    }
    stage('Test') {
        steps {
            echo 'Testing..'
        }
    }
    stage('Deploy') {
        steps {
            echo 'Deploying....'
        }
    }
}

first pipeline created : well done !

mobydock

devops.pm father

More Posts - Website

Follow Me:
TwitterFacebook

kubernetes cluster on raspberry pi

MASTER NODE :


sudo kubeadm config images pull -v3

sudo kubeadm init –token-ttl=0

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config


 Install the Weave Net network driver


kubectl apply -f « https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d ‘\n’) »

launch
kubectl get nodes

NAME STATUS ROLES AGE VERSION
yourPC Ready master 2m57s v1.16.2

on workers after installing kubeadm and kubectl : cf my post

launch your command like :

kubeadm join –token 9e700f.7dc97f5e3a45c9e5 192.168.0.27:6443 –discovery-token-ca-cert-hash sha256:95cbb9ee5536aa61ec0239d6edd8598af68758308d0a0425848ae1af28859bea

mobydock

devops.pm father

More Posts - Website

Follow Me:
TwitterFacebook

Kubernetes on Rpi !!

The cherry on the k8ke

install docker :

curl -sSL get.docker.com | sh && \
sudo usermod pi -aG docker && \
newgrp docker

delete swap

sudo dphys-swapfile swapoff && \
sudo dphys-swapfile uninstall && \
sudo update-rc.d dphys-swapfile remove

modify the file /boot/cmdline.txt by adding at the end :

cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory

then reboot :
sudo reboot

create file /etc/apt/sources.list.d/kubernetes.list within
deb http://apt.kubernetes.io/ kubernetes-xenial main

launch :
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add –

then
sudo apt-get update


 Install kubeadm it will also install kubectl

sudo apt-get install -qy kubeadm

ENJOY !!!!

mobydock

devops.pm father

More Posts - Website

Follow Me:
TwitterFacebook

DOCKER ON raspberry pi ZERO – Octobre 2019

Device: Raspberry Pi 0 v1.3
OS: Raspbian Buster Lite (2019-09-26)
From a fresh image:

  1. wget -O /tmp/containerd.io_1.2.10-1_armhf.deb --content-disposition https://packagecloud.io/Hypriot/rpi/packages/raspbian/buster/containerd.io_1.2.10-1_armhf.deb/download.deb
  2. sudo apt install /tmp/containerd.io_1.2.10-1_armhf.deb
  3. sudo apt-get install curl git
  4. bash -c "$(curl -fsSL https://get.docker.com)"

ENJOY !!!!!!!

why not go further with KUBERNETES …

mobydock

devops.pm father

More Posts - Website

Follow Me:
TwitterFacebook

Starting DevOps with a simple Pipeline on AWS

Step 1 – Create a AWS S3 bucket :
 https://console.aws.amazon.com/s3/

Step 2 – Download file in dist repository on GitHub :
https://github.com/awslabs/aws-codepipeline-s3-aws-codedeploy_linux.

Step 3 : file name : aws-codepipeline-s3-aws-codedeploy_linux.zip

Step 4 :Upload this file on your S3 bucket

Step 5 : Create AWS ECS Linux instances :
https://console.aws.amazon.com/ec2/

clic on launch , use the free Amazon Machine Images (AMI)

Amazon Linux 2 AMI (HVM)

Step 6 : create an IAM profil for your Amazon EC2
https://docs.aws.amazon.com/fr_fr/codedeploy/latest/userguide/getting-started-create-iam-instance-profile.html

Step 7 : when creating the EC2 instance put this code

#!/bin/bash yum -y update yum install -y ruby yum install -y aws-cli cd /home/ec2-user aws s3 cp s3://aws-codedeploy-us-east-2/latest/install . –region us-east-2 chmod +x ./install ./install auto

Step 8 : Launch instance

Step 9 : Verify codepipeline is running :
sudo service codedeploy-agent status

Step 10 : Create a codedepoy

Open the console
https://console.aws.amazon.com/codedeploy.

create a deployment group

Step 11 : Create your first pipeline !!

Connect to the AWS Management Console and open the CodePipeline console http://console.aws.amazon.com/codesuite/codepipeline/home

create a pipeline and follow the instructions

let’s play : source and deploy … after add step build !

Congratulations!

You have successfully created a pipeline that retrieved this source application from an Amazon S3 bucket and deployed it to three Amazon EC2 instances using AWS CodeDeploy.

mobydock

devops.pm father

More Posts - Website

Follow Me:
TwitterFacebook

One of the best 2019 devops Tool ! Gradle

gradle
Gradle Build Tool – the fatest way to microservices !

Your DevOps tool stack will need a reliable build tool. Apache Ant and Maven dominated the automated build tools market for many years, but Gradle showed up on the scene in 2009, and its popularity has steadily grown since then. Gradle is an incredibly versatile tool which allows you to write your code in Java, C++, Python, or other languages. Gradle is also supported by popular IDEs such as Netbeans, Eclipse, and IntelliJ IDEA. If that doesn’t convince you, it might help to know that Google also chose it as the official build tool for Android Studio.

While Maven and Ant use XML for configuration, Gradle introduces a Groovy-based DSL for describing builds. In 2016, the Gradle team also released a Kotlin-based DSL, so now you can write your build scripts in Kotlin as well. This means that Gradle does have some learning curves, so it can help a lot if you have used Groovy, Kotlin or another JVM language before. Besides, Gradle uses Maven’s repository format, so dependency management will be familiar if you have prior experience with Maven. You can also import your Ant buildsinto Gradle.

The best thing about Gradle is incremental builds, as they save a nice amount of compile time. According to Gradle’s performance measurements, it’s up to 100 times faster than Maven. This is in part because of incrementality, but also due to Gradle’s build cache and daemon. The build cache reuses task outputs, while the Gradle Daemon keeps build information hot in memory in-between builds.

All in all, Gradle allows faster shipping and comes with a lot of configuration possibilities.

more : https://raygun.com/blog/best-devops-tools/

mobydock

devops.pm father

More Posts - Website

Follow Me:
TwitterFacebook

Docker and Jenkins

The idea : Make all your Build with Jenkins on always the same environment : controlled, stable ..

What we will do :

  • Jenkins run a docker container
  • Jenkins run a temp slave in the container
  • The build is done on the slave container and jenkins take the result of the build (logs, metadata, artifacts)
  • Whent the build is done the container is killed

Install Docker

Install Jenkins

Pull a debian image

Prepare a dockerfile

FROM wheezy64:wheezy

RUN apt-get install -y openssh-server openjdk-7-jre-headless
RUN useradd -m -s /bin/bash jenkins
RUN echo jenkins:jenkins | chpasswd
RUN mkdir -p /var/run/sshd
EXPOSE 22
CMD /usr/sbin/sshd -D

Build a jenkins image
docker build -t wheezy_jenkins:jenkins .

We can test by running the container and connect with ssh
$ jenkins=$(docker run -d -p 0.0.0.0:2222:22 -t -i wheezy_jenkins:jenkins)

$ ssh jenkins@localhost -p 2222

Whe exit from the ssh session
exit

Then kill the container
docker kill $jenkins

Then delete the container
docker rm $jenkins

Now we will configure jenkins

install the docker plugin on jenkins (cf our post to know how to install plugin :jenkins_pluging )

configure jenkins : cloud and had your docker container

create an item

then compute

mobydock

devops.pm father

More Posts - Website

Follow Me:
TwitterFacebook

Jenkins from scratch – HowTo part 1 – go onboard

This howto will help you to begin with jenkins.

jenkins_logo

First step install jenkins :
on UBUNTU:
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins

If you already installed Jenkins and need to be up to date :
sudo apt-get update
sudo apt-get install jenkins

When it’s done, you’ll access Jenkins:
with your navigator using URL : http://localhost:8080
jenkins_home

or with the CLI(command line interface)
to install it :
wget http://localhost:8080/jnlpJars/jenkins-cli.jar
There’s a doc online the local website http://localhost:8080/cli
and also can have detail on options :
java -jar jenkins-cli.jar -s http://localhost:8080/ help

mobydock

devops.pm father

More Posts - Website

Follow Me:
TwitterFacebook

Welcome on board ! Bienvenue !

This this IT !
Hope you will enjoy this blog, wiki, workshop site. I will try to share what you need about devops.

Je me lance dans la mise en route de ce site mélangeant blog, wiki, Learning tips, vidéo,..etc..
Mon objectif est simple : partager la culture devops
Les outils, les méthodes , les approches, … mais également l’actualité devops

Je vous ferais découvrir ou redécouvrir des post sur Docker, Ansible, Vagrant, Puppet, Chef, Cloudstack, …. ou sur Kanban, Lean, Agile, mais aussi des informations sur les event à ne pas rater : devopsdays, dockercon, …

Que du bonheur !
A bientôt et rester connecté .
Be alive , Be Devops

mobydock

devops.pm father

More Posts - Website

Follow Me:
TwitterFacebook