Coder Social home page Coder Social logo

cicdwithargicdgitlabregistry's Introduction

install gitlab on redhat9

dnf -y install curl vim policycoreutils python3-policycoreutils git

cat > /etc/yum.repos.d/gitlab_gitlab-ce.repo >> END
[gitlab_gitlab-ce]
name=gitlab_gitlab-ce
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
       https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[gitlab_gitlab-ce-source]
name=gitlab_gitlab-ce-source
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/SRPMS
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
       https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

END

dnf install gitlab-ce -y

config gitlab and registry

vim /etc/gitlab/gitlab.rb

change external_url 'https://gitlab.example.com' to your domain

change registry_external_url 'https://registry.example.com' to your domain

change letsencrypt['enable'] = nill to letsencrypt['enable'] = false

config ssl for gitlab and registry

copy your domains cert to /etc/gitlab/ssl img.png

Note: set certs name them same your domain

cd /etc/gitlab/ssl; chmod 400  *.key
cd /etc/gitlab/ssl; chmod 644  *.crt
gitlab-ctl reconfigure

check status git

gitlab-ctl status

get root password gitla

cat /etc/gitlab/initial_root_password

login to gitlab with domain your setup

img.png

install gitlab-runner and docker on server gitlab

curl -LJO "https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/latest/rpm/gitlab-runner_amd64-fips.rpm"
rpm -ivh gitlab-runner_amd64-fips.rpm

systemctl enable --now gitlab-runner.service

yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl enable --now docker

docker login

docker login -u user -p passwd registry.mbageas.life/code-repo

Install docker on all cluster nodes

yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl enable --now docker

Test docker login all cluster nodes

docker login -u user -p passwd registry.mbageas.life/code-repo

deploy Argocd

kubectl create ns argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

note: change argocd server to mode NodePort

kubectl edit service/argocd-server -n argocd

img_1.png

get argocd admin password

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d

login argocd with user/passs

img_1.png

config ssh to gitlab repo

on gitlab server ssh-key

ssh-keygen -t rsa

create gitlab repo contain gitlab-ci and dockerfile

img_1.png

allow push

img_3.png

create gitlab repo contain helm chart to deploy k8s

Create a Variables

create secret for docker registry

kubectl create secret docker-registry regcred-loginapp --docker-server=registry.mbageas.life --docker-username=k8s --docker-password=gldt-ZhQzbMVN1pgdUMCySfdL -n default

Note: in repo helm chart have secret file, maybe edit it

connect argocd to gitlab repo helm chart

Argocd create application

Note summary

change:
APP_NAME IMAGE_TAG git clone cd sed -i git add

Add private key to code-repo

cicdwithargicdgitlabregistry's People

Watchers

Trunglv 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.