Giter Site home page Giter Site logo

f16t11n / devops-ci-cd-jenkins-ansible-react-nodejs-mongodb-docker-compose Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abdelali12-codes/devops-ci-cd-jenkins-ansible-react-nodejs-mongodb-docker-compose

0.0 0.0 0.0 375 KB

Jenkins

License: MIT License

Dockerfile 2.48% JavaScript 88.96% HTML 2.18% CSS 2.42% Shell 3.96%

devops-ci-cd-jenkins-ansible-react-nodejs-mongodb-docker-compose's Introduction

Set up jenkins server on linux (the recommanded RAM is 4GB and 4 vCPUs)

sudo yum update -y
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
sudo yum install java-1.8.0 -y
sudo yum install jenkins -y
sudo service jenkins start
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Set up jenkins server on ubuntu (the recommanded RAM is 4GB and 4 vCPUs)

sudo apt-get update
sudo apt-get install openjdk-8-jdk -y
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
    /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins -y

set up ansible server

install ansible


yum install python-pip -y
pip install ansible

create the inventory file


mkdir /etc/ansible
sudo nano /etc/ansible/hosts

set up docker-compose


sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose


yum install docker -y
service docker start
service docker status

to check the network of a container


docker inspect postgres -f "{{json .NetworkSettings.Networks }}")

Set up the kubernetes cluster

1. run the following command on the both instances you created above


sudo apt-get update -y
sudo apt-get install -y apt-transport-https ca-certificates curl
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update -y
sudo apt-get install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl
sudo apt install docker.io -y

2. check the cgroup driver of your container runtime (docker in our case)


sudo docker info | grep -i cgroup

3. initialization of the master node run the command below (run this command only on the master node)

  • make sure that the kubelet and the container runtime have the same cgroup driver

sudo kubeadm init --config config-kubeadm.yml

4. install the flannel network plugin on the control plane (master node in our case)


sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

if you like to use calico network plugin follow the below steps:

1. create config-kubeadm.yaml that contain the content below:


kind: ClusterConfiguration
apiVersion: kubeadm.k8s.io/v1beta3
kubernetesVersion: v1.22.0
networking:
podSubnet: 192.168.0.0/16

---

kind: KubeletConfiguration
apiVersion: kubelet.config.k8s.io/v1beta1
cgroupDriver: cgroupfs

3. install the calico network plugin


kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml

devops-ci-cd-jenkins-ansible-react-nodejs-mongodb-docker-compose's People

Contributors

abdelali12-codes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.