Skip to content

Commit

Permalink
re-deploying nextcloud through argocd
Browse files Browse the repository at this point in the history
  • Loading branch information
v1nsai committed Jul 5, 2024
1 parent de163f9 commit a193635
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 17 deletions.
23 changes: 23 additions & 0 deletions projects/argo/argo-cd/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -e

echo "Installing Argo CD..."
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
helm upgrade --install argo-cd argo/argo-cd \
--namespace argocd \
--create-namespace \
--values projects/argo/argo-cd/values.yaml

echo "Deploying argocd image updater to kubernetes..."
kubectl apply \
--filename https://raw.githubusercontent.com/argoproj-labs/argocd-image-updater/stable/manifests/install.yaml \
--namespace argocd

echo "Installing argocd-image-updater binary..."
wget https://github.com/argoproj-labs/argocd-image-updater/releases/download/v0.13.1/argocd-image-updater-linux_amd64 -O /usr/bin/argocd-image-updater

echo "Running post install config..."
kubectl patch svc -n argocd argo-cd-argocd-server -p '{"spec": {"type": "LoadBalancer"}}'
kubectl patch configmap argocd-cm -n argocd --type merge --patch '{"data": {"resourceTrackingMethod": "annotation+label"}}'
25 changes: 25 additions & 0 deletions projects/argo/argo-cd/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
server:
service:
type: LoadBalancer
autoscaling:
enabled: true
minReplicas: 2

redis-ha:
enabled: true

controller:
replicas: 1

repoServer:
autoscaling:
enabled: true
minReplicas: 2

applicationSet:
replicas: 2

configs:
params:
application:
namespaces: "*"
30 changes: 30 additions & 0 deletions projects/nextcloud/argocd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: nextcloud
spec:
project: default
sources:
- repoURL: 'https://nextcloud.github.io/helm/'
helm:
valueFiles:
- $values/projects/nextcloud/values.yaml
chart: nextcloud
targetRevision: "*"
- repoURL: 'https://github.com/v1nsai/homelab.git'
ref: values
destination:
name: in-cluster
namespace: nextcloud
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ApplyOutOfSyncOnly=true
- Validate=false
# sources:
# - repoURL: 'https://github.com/v1nsai/homelab.git'
# ref: values
# target: projects/nextcloud/values.yaml
30 changes: 15 additions & 15 deletions projects/nextcloud/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ else
fi
rm -rf /tmp/nextcloud.key /tmp/nextcloud.crt

echo "Creating data pvc..."
if kubectl get pvc -n nextcloud | grep -q nextcloud-data; then
echo "PVC nextcloud-data already exists"
else
echo "Creating nextcloud-data..."
kubectl apply -f projects/nextcloud/nextcloud-data.yaml -n nextcloud
fi
# echo "Creating data pvc..."
# if kubectl get pvc -n nextcloud | grep -q nextcloud-data; then
# echo "PVC nextcloud-data already exists"
# else
# echo "Creating nextcloud-data..."
# kubectl apply -f projects/nextcloud/nextcloud-data.yaml -n nextcloud
# fi

echo "Installing Nextcloud..."
helm repo add nextcloud https://nextcloud.github.io/helm/
helm repo update
helm upgrade --install nextcloud nextcloud/nextcloud \
--namespace nextcloud \
--create-namespace \
--values projects/nextcloud/values.yaml \
--set nextcloud.host=$NC_HOST
# echo "Installing Nextcloud..."
# helm repo add nextcloud https://nextcloud.github.io/helm/
# helm repo update
# helm upgrade --install nextcloud nextcloud/nextcloud \
# --namespace nextcloud \
# --create-namespace \
# --values projects/nextcloud/values.yaml \
# --set nextcloud.host=$NC_HOST

4 changes: 2 additions & 2 deletions projects/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ nextcloud:
persistence:
enabled: true
# existingClaim: nextcloud-data
# nextcloudData:
# enabled: true
nextcloudData:
enabled: true
redis:
auth:
enabled: false
Expand Down

0 comments on commit a193635

Please sign in to comment.