add: bonus
This commit is contained in:
parent
a87dc80ba1
commit
5e4d0ad564
20
bonus/confs/argocd.yaml
Normal file
20
bonus/confs/argocd.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: playground
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: http://gitlab-service.gitlab.svc.cluster.local/root/iot-bonus.git
|
||||
targetRevision: HEAD
|
||||
path: .
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: dev
|
||||
syncPolicy:
|
||||
automated:
|
||||
selfHeal: true
|
||||
prune: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
42
bonus/confs/gitlab-deployement.yaml
Normal file
42
bonus/confs/gitlab-deployement.yaml
Normal file
@ -0,0 +1,42 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: gitlab-service
|
||||
spec:
|
||||
selector:
|
||||
app: gitlab
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 80
|
||||
- name: https
|
||||
port: 443
|
||||
targetPort: 443
|
||||
- name: ssh
|
||||
port: 22
|
||||
targetPort: 22
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: gitlab-deployement
|
||||
labels:
|
||||
app: gitlab
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: gitlab
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: gitlab
|
||||
spec:
|
||||
containers:
|
||||
- name: gitlab
|
||||
image: gitlab/gitlab-ce:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
- containerPort: 443
|
||||
- containerPort: 22
|
16
bonus/confs/gitlab-ingress.yaml
Normal file
16
bonus/confs/gitlab-ingress.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: minimal-ingress
|
||||
spec:
|
||||
rules:
|
||||
- host: "gitlab.bonus.com"
|
||||
http:
|
||||
paths:
|
||||
- path: "/"
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: gitlab
|
||||
port:
|
||||
number: 80
|
1
bonus/scripts/get_argocd_passwd.sh
Executable file
1
bonus/scripts/get_argocd_passwd.sh
Executable file
@ -0,0 +1 @@
|
||||
kubectl -n argocd get secrets argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d
|
2
bonus/scripts/get_gitlab_passwd.sh
Executable file
2
bonus/scripts/get_gitlab_passwd.sh
Executable file
@ -0,0 +1,2 @@
|
||||
kubectl exec -n gitlab pods/$(kubectl get pods -n gitlab -o jsonpath={.items[0].metadata.name}) -- grep Password: /etc/gitlab/initial_root_password
|
||||
|
19
bonus/scripts/intall.sh
Executable file
19
bonus/scripts/intall.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/env bash
|
||||
|
||||
# Install dependancies
|
||||
command -v docker >/dev/null || sudo pacman -S docker
|
||||
command -v kubectl >/dev/null || sudo pacman -S kubectl
|
||||
wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
|
||||
|
||||
k3d cluster create
|
||||
|
||||
# Install gitlab
|
||||
kubectl create ns gitlab
|
||||
kubectl apply -n gitlab -f ./confs/gitlab-deployement.yaml
|
||||
kubectl apply -n gitlab -f ./confs/gitlab-ingress.yaml
|
||||
|
||||
# Install ArgoCD
|
||||
kubectl create namespace argocd
|
||||
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
|
||||
|
||||
kubectl apply -n argocd -f ./confs/argocd.yaml
|
1
bonus/scripts/port-forward-argocd.sh
Executable file
1
bonus/scripts/port-forward-argocd.sh
Executable file
@ -0,0 +1 @@
|
||||
kubectl port-forward svc/argocd-server -n argocd 8080:443
|
Loading…
Reference in New Issue
Block a user