Git Product home page Git Product logo

devops-project's Introduction

devOps-project

---------- SETUP ----------

--- First update the system:

open a terminal with crtl + alt + t

sudo apt-get update && sudo apt-get upgrade

Necessary tools:

sudo apt-get install git curl -y

---- Install minikube

  • For ubuntu:

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

sudo install minikube-linux-amd64 /usr/local/bin/minikube

  • For debian:

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb

sudo dpkg -i minikube_latest_amd64.deb

Other systems and more information: https://minikube.sigs.k8s.io/docs/start/

---- Install docker

https://docs.docker.com/engine/install/

add your user to user group: sudo usermod -aG docker $USER

To test if docker is correctly installed: docker run hello-world

if docker daemon error appears: systemctl start docker

---- Install helm

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3

chmod 700 get_helm.sh

./get_helm.sh

---- Install kubectl

  • For debian:

sudo apt-get install -y ca-certificates curl

sudo apt-get install -y apt-transport-https

sudo curl -fsSLo /etc/apt/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg

echo "deb [signed-by=/etc/apt/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

sudo apt-get install -y kubectl

  • For ubuntu:

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

  • Test the install:

kubectl version --client --output=yaml

---- Install kubens

For debian:

sudo apt install kubectx

Manually:

sudo git clone https://github.com/ahmetb/kubectx /opt/kubectx sudo ln -s /opt/kubectx/kubectx /usr/local/bin/kubectx sudo ln -s /opt/kubectx/kubens /usr/local/bin/kubens

Other systems and more info about this repo: https://github.com/ahmetb/kubectx#apt-debian

---------- SETUP MINIKUBE ----------

  • Consider doing this step anyway to avoid errors with minikube in the future
  • If you get an error with kubelet or "missing optional cgroups: blkio", try:

sudo su

nano /etc/default/grub

In "GRUB_CMDLINE_LINUX" add "cgroup_enable=memory"

You should have: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash cgroup_enable=memory"

update-grub2

Reboot machine: reboot

---- Set docker driver as default for minikube

minikube config set driver docker

minikube start --cpus 4 --memory 6012 --> you can change parameters to set your own o leave blank for default

---------- DEPLOY JENKINS ON MINIKUBE ----------

kubectl create namespace jenkins

kubens jenkins

helm repo add jenkins https://charts.jenkins.io

helm repo update

helm show values jenkins/jenkins > jenkins.yaml

nano jenkins.yaml --> modify line 129 "serviceType: NodePort"

helm install -f jenkins.yaml jenkins jenkins/jenkins

kubectl get pods -w --> Shows you how pods are initializing

When you see "jenkins-0 2/2 Running 0 2m5s" all your pods are running and you can continue with the next step

kubectl exec --namespace jenkins -it svc/jenkins -c jenkins -- /bin/cat /run/secrets/additional/chart-admin-password && echo --> get the admin password

echo "copy+paste-password" > jenkinsPassword.txt --> save the password for next steps

kubectl --namespace jenkins port-forward svc/jenkins 8000:8080 --> To access the terminal redirect your local port to the pod's port, the first port (8000) is the local port to access the pod and the second port (8080) is the port where the pod is listening

open firefox and go to: http://localhost:8000/ --> access jenkins ui

login with "admin" and the password saved in "jenkinsPassword.txt" from previous steps

---------- CONFIGURE JENKINS ----------

click on Manage Jenkins --> Manage Plugins --> Download now and install after restart --> Restart Jenkins when installation is complete and no jobs are running

---------- INFORMATION GATHERING ---------

minikube addons enable metrics-server

minikube dashboard --> we can see information about pods and information about jenkins in minikube

minikube status --> check information about minikube running status

kubectl get rc,services --> get repllication controllers and services

devops-project's People

Contributors

tdiazsouble avatar

Watchers

 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.