From 152c23858463945244c2a50083a462c8f8787a30 Mon Sep 17 00:00:00 2001 From: Namonay Date: Mon, 15 Dec 2025 17:25:13 +0100 Subject: [PATCH] add: argo installer and base app --- p3/confs/app.yml | 18 ++++++++++++++++++ p3/confs/ingress.yml | 30 +++++++++++------------------- p3/confs/service.yml | 11 +++++++++++ p3/scripts/argo-install.sh | 13 ++++++++++++- p3/scripts/uninstall.sh | 4 ++++ 5 files changed, 56 insertions(+), 20 deletions(-) create mode 100644 p3/confs/app.yml create mode 100644 p3/confs/service.yml diff --git a/p3/confs/app.yml b/p3/confs/app.yml new file mode 100644 index 0000000..5d73426 --- /dev/null +++ b/p3/confs/app.yml @@ -0,0 +1,18 @@ +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 diff --git a/p3/confs/ingress.yml b/p3/confs/ingress.yml index 355c895..5feb220 100644 --- a/p3/confs/ingress.yml +++ b/p3/confs/ingress.yml @@ -1,24 +1,16 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: argocd-ingress - namespace: argocd - annotations: - nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" - nginx.ingress.kubernetes.io/ssl-passthrough: "true" - nginx.ingress.kubernetes.io/force-ssl-redirect: "true" - nginx.ingress.kubernetes.io/ssl-verify: "off" - nginx.ingress.kubernetes.io/ssl-verify-depth: "1" + name: app-ingress spec: - ingressClassName: nginx rules: - - host: argocd.localhost - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: argocd-server - port: - name: https + - host: localhost + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: app-service + port: + number: 80 \ No newline at end of file diff --git a/p3/confs/service.yml b/p3/confs/service.yml new file mode 100644 index 0000000..7a030bb --- /dev/null +++ b/p3/confs/service.yml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: app-service +spec: + type: ClusterIP + selector: + app: app + ports: + - port: 80 + targetPort: 8888 diff --git a/p3/scripts/argo-install.sh b/p3/scripts/argo-install.sh index 51d54d8..b3648a6 100755 --- a/p3/scripts/argo-install.sh +++ b/p3/scripts/argo-install.sh @@ -9,6 +9,17 @@ kubectl wait --namespace argocd \ --selector=app.kubernetes.io/name=argocd-server \ --timeout=300s \ 1>/dev/null 2>/dev/null -kubectl port-forward svc/argocd-server -n argocd 8080:443 1>/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)\' +kubectl create namespace dev +kubectl apply -n dev -f ../confs/app.yml +echo 'App is starting...' +kubectl wait --namespace argocd \ + --for=condition=ready pod \ + --selector=app.kubernetes.io/name=argocd-server \ + --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)' \ No newline at end of file diff --git a/p3/scripts/uninstall.sh b/p3/scripts/uninstall.sh index 1daeb53..2bbc2bb 100755 --- a/p3/scripts/uninstall.sh +++ b/p3/scripts/uninstall.sh @@ -1,3 +1,7 @@ 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 namespace argocd +kubectl delete namespace dev k3d cluster delete inception-of-things \ No newline at end of file