add: finished p3, uploaded manifest to separate git

This commit is contained in:
Namonay
2025-12-16 17:25:14 +01:00
parent 152c238584
commit ecf1185da2
8 changed files with 36 additions and 56 deletions

View File

@ -9,3 +9,4 @@ spec:
ports:
- port: 80
targetPort: 80

View File

@ -1,18 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-deployment
spec:
selector:
matchLabels:
app: app
template:
metadata:
labels:
app: app
spec:
containers:
- name: app
image: wil42/playground:v2
ports:
- containerPort: 8888

20
p3/confs/argocd-app.yml Normal file
View File

@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/Namonay/vvaas42.git
targetRevision: HEAD
path: '.'
destination:
server: https://kubernetes.default.svc
namespace: dev
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true

View File

@ -1,16 +0,0 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app-ingress
spec:
rules:
- host: localhost
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: app-service
port:
number: 80

View File

@ -1,11 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: app-service
spec:
type: ClusterIP
selector:
app: app
ports:
- port: 80
targetPort: 8888

View File

@ -10,16 +10,20 @@ kubectl wait --namespace argocd \
--timeout=300s \
1>/dev/null 2>/dev/null
kubectl port-forward svc/argocd-server -n argocd 8080:443 1>/dev/null 2>/dev/null &
echo 'ArgoCD is running (http://127.0.0.1:8080)'
echo login=admin password=\'$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)\'
echo 'ArgoCD is running'
kubectl create namespace dev
kubectl apply -n dev -f ../confs/app.yml
kubectl apply -n argocd -f ../confs/argocd-app.yml
echo 'App is starting...'
kubectl wait --namespace argocd \
kubectl wait --namespace dev \
--for=condition=ready pod \
--selector=app.kubernetes.io/name=argocd-server \
--selector=app.kubernetes.io/name=app-deployment \
--timeout=300s \
1>/dev/null 2>/dev/null
kubectl apply -n dev -f ../confs/service.yml
kubectl apply -n dev -f ../confs/ingress.yml
echo 'App is running (http://127.0.0.1:80)'
echo 'App imported in ArgoCD'
TRAEFIK_IP=$(kubectl get service -n kube-system traefik -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo App is reachable at argo-app.com:8888
echo Traefik ip is : $TRAEFIK_IP
echo Login into ArgoCD with:
echo Username: admin
ADMIN_PASS=$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)
echo Password: \'$ADMIN_PASS\'

View File

@ -0,0 +1,2 @@
echo "172.19.0.2 argo-app.com" | sudo tee -a "/etc/hosts"
# Edit the IP with the ip in the output of argo-install.sh

View File

@ -1,7 +1,5 @@
kubectl delete -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl delete -n dev -f ../confs/ingress.yml
kubectl delete -n dev -f ../confs/service.yml
kubectl delete -n dev -f ../confs/app.yml
kubectl delete -n argocd -f ../confs/argocd-app.yml
kubectl delete namespace argocd
kubectl delete namespace dev
k3d cluster delete inception-of-things