Skip to content

Commit

Permalink
updating helmfile and kustomize article
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallaki Mahdi committed May 29, 2024
1 parent 3f75bff commit 0d01669
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion helmfile-and-kustomize/assets/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ stages:

deploy:
stage: deploy
image: bitnami/kubectl
image: docker.io/mlkmhd/cd-pipeline:1
script: |
set -xe
env
Expand Down
1 change: 1 addition & 0 deletions helmfile-and-kustomize/pipeline-docker-image/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.crt
6 changes: 6 additions & 0 deletions helmfile-and-kustomize/pipeline-docker-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:11.8

ADD *.crt /usr/local/share/ca-certificates/
ADD install.sh /

RUN chmod +x /install.sh && /install.sh
6 changes: 6 additions & 0 deletions helmfile-and-kustomize/pipeline-docker-image/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

IMAGE_NAME="mlkmhd/cd-pipeline:1"

docker build . --no-cache -t $IMAGE_NAME
docker push $IMAGE_NAME
51 changes: 51 additions & 0 deletions helmfile-and-kustomize/pipeline-docker-image/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash
set -xe

apt update
apt install curl jq -y

update-ca-certificates

# installing helm
curl -L 'https://get.helm.sh/helm-v3.13.3-linux-amd64.tar.gz' -o helm.tar.gz
tar -xvzf helm.tar.gz
mv linux-amd64/helm /usr/bin/
rm helm.tar.gz
rm -rf linux-amd64

# helm-diff plugin installation
curl -L 'https://github.com/databus23/helm-diff/releases/latest/download/helm-diff-linux-amd64.tgz' -o helm-diff.tgz
tar -xvzf helm-diff.tgz
helm plugin install ./diff || true
rm helm-diff.tgz

# installing helmfile
curl -L 'https://github.com/helmfile/helmfile/releases/download/v0.160.0/helmfile_0.160.0_linux_amd64.tar.gz' -o helmfile.tar.gz
tar -xvzf helmfile.tar.gz
mv helmfile /usr/bin
rm helmfile.tar.gz

# installing kubectl
curl -LO https://dl.k8s.io/release/v1.29.0/bin/linux/amd64/kubectl
chmod +x kubectl
mv kubectl /usr/bin

# installing kustomize
curl -L 'https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv3.8.1/kustomize_v3.8.1_linux_amd64.tar.gz' -o kustomize.tar.gz
tar -xvzf kustomize.tar.gz
mv kustomize /usr/bin
rm kustomize.tar.gz

# installing kubectl-slice
curl -L 'https://github.com/patrickdappollonio/kubectl-slice/releases/download/v1.2.7/kubectl-slice_linux_x86_64.tar.gz' -o kubectl-slice.tar.gz
tar -xvzf kubectl-slice.tar.gz
chmod +x kubectl-slice
mv kubectl-slice /usr/bin
rm kubectl-slice.tar.gz

# installing gpg and sops
apt install gpg gpg-agent -y
cd /tmp
curl -L https://github.com/getsops/sops/releases/download/v3.8.1/sops_3.8.1_amd64.deb -o sops.deb
dpkg -i sops.deb
rm sops.deb

0 comments on commit 0d01669

Please sign in to comment.