Skip to content

Commit

Permalink
fix(local-setup): improve overlay handling and upgrading versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nexus49 committed Feb 10, 2025
1 parent 1498d07 commit b3d4545
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 36 deletions.
2 changes: 1 addition & 1 deletion local-setup/kustomize/components/openmfp/repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ spec:
url: oci://ghcr.io/openmfp/helm-charts/openmfp
ref:
# renovate: datasource=docker registryUrl=https://ghcr.io depName=ghcr.io/openmfp/helm-charts/openmfp
semver: 0.0.214
semver: 0.0.215
secretRef:
name: ghcr-credentials
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../components/openmfp
- ../default

patches:
- path: patch-keycloak.yaml
10 changes: 0 additions & 10 deletions local-setup/kustomize/overlays/default-oci/kustomization.yaml

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions local-setup/kustomize/overlays/default-oci/patch-openmfp.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions local-setup/kustomize/overlays/oci-arm64/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../oci

patches:
- path: patch-keycloak.yaml
15 changes: 15 additions & 0 deletions local-setup/kustomize/overlays/oci-arm64/patch-keycloak.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: openmfp
namespace: openmfp-system
spec:
values:
keycloak:
keycloak:
extraEnvVars:
- name: JAVA_OPTS_APPEND
value: |-
-Djgroups.dns.query=openmfp-keycloak-headless.openmfp-system.svc.cluster.local
-XX:UseSVE=0
19 changes: 13 additions & 6 deletions local-setup/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ helm upgrade -i -n flux-system --create-namespace flux oci://ghcr.io/fluxcd-comm

echo -e "${COL}[$(date '+%H:%M:%S')] Starting deployments ${COL_RES}"
if [ "${1}" == "oci" ]; then
kubectl apply -k $SCRIPT_DIR/../kustomize/overlays/default-oci
if [[ "$(uname -m)" == "arm64" ]]; then
echo -e "${COL}[$(date '+%H:%M:%S')] ARM64 architecture detected, applying patch ${COL_RES}"
kubectl apply -k $SCRIPT_DIR/../kustomize/overlays/oci-arm64
else
kubectl apply -k $SCRIPT_DIR/../kustomize/overlays/oci
fi
sleep 10 # give time for the 'registry' pod to be created

kubectl wait --namespace default \
Expand Down Expand Up @@ -84,13 +89,15 @@ if [ "${1}" == "oci" ]; then
fi
done
else
kubectl apply -k $SCRIPT_DIR/../kustomize/overlays/default
if [[ "$(uname -m)" == "arm64" ]]; then
echo -e "${COL}[$(date '+%H:%M:%S')] ARM64 architecture detected, applying patch ${COL_RES}"
kubectl apply -k $SCRIPT_DIR/../kustomize/overlays/default-arm64
else
kubectl apply -k $SCRIPT_DIR/../kustomize/overlays/default
fi
fi

if [[ "$(uname -m)" == "arm64" ]]; then
echo -e "${COL}[$(date '+%H:%M:%S')] ARM64 architecture detected, applying patch ${COL_RES}"
kubectl apply -k $SCRIPT_DIR/../kustomize/overlays/arm64
fi


echo -e "${COL}[$(date '+%H:%M:%S')] Creating necessary secrets ${COL_RES}"
kubectl create secret docker-registry ghcr-credentials -n openmfp-system --docker-server=ghcr.io --docker-username=$ghUser --docker-password=$ghToken --dry-run=client -o yaml | kubectl apply -f -
Expand Down

0 comments on commit b3d4545

Please sign in to comment.