Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement air-gapped mode for PrometheusStack #191

Merged
merged 7 commits into from
May 24, 2024

Conversation

schnatterer
Copy link
Member

@schnatterer schnatterer commented May 16, 2024

I see at least the following test cases:

  • With --mirror-repos: Apply twice and make sure that it does not fail the 2nd time (when repo already exists)
  • Without --mirror-repos: Everything must still work as before, i.e. the KubePromStack chart refers to the source from the internet. No SCMM repo is created for prometheus in 3rd-party-dependencies
  • Git repo for Prometheus chart is only created if mirror-repos and monitoring are active
  • Grafana dashboards for Jenkins and SCMM still have to work.

Helm does not have any options for changing dependencies. So our only
options is to alter the chart.

There, we would have two options for hosting the chart: Git or OCI.
Unfortunately it seems that using the OCI way in the local GOP is
impossible because we would have to use `helm pull --plain-http oci://.
.`, which not to be possible in Argo CD.
So we stick with what we already did with spring-boot-helm-chart: Use
git.
Do not deploy grafana from separate repo.
Keeps code simpler and results in fewer differences between air-gapped
and normal mode.
@schnatterer schnatterer marked this pull request as draft May 16, 2024 17:26
@schnatterer schnatterer force-pushed the feature/prom-stack-air-gapped branch from 390d84e to 597c60b Compare May 16, 2024 17:32
@schnatterer schnatterer force-pushed the feature/prom-stack-air-gapped branch from e18c4f2 to 69fd4e2 Compare May 21, 2024 08:46
Refactored HelmClient to avoid further code duplication.
Got rid of deprecated method call on the way.

The charts are passed in from the outside (Dockerfile or env var).
So it makes sense to validate them at runtime before pushing to git.
Fail early!
It is much more concrete and avoids confusion about what the param does
(as e.g. --remote did in the past).

Air-gapped mode will always be a combination of parameters, like
--*-image, --registry-*, and others.
@schnatterer schnatterer marked this pull request as ready for review May 22, 2024 07:22
com.oracle.svm.core.jdk.UnsupportedFeatureError: Runtime reflection is not supported for public abstract java.util.Iterator java.util.List.iterator()
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89)
        at java.base@17.0.5/java.lang.reflect.Method.acquireMethodAccessor(Method.java:71)
        at java.base@17.0.5/java.lang.reflect.Method.invoke(Method.java:566)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
        at groovy.lang.MetaClassImpl.doInvokeMethod(MetaClassImpl.java:1331)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1086)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1006)
        at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:633)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:624)
        at org.codehaus.groovy.runtime.InvokerHelper.asIterator(InvokerHelper.java:709)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.find(DefaultGroovyMethods.java:4245)
        at com.cloudogu.gitops.utils.AirGappedUtils$_localizeChartYaml_closure1.doCall(AirGappedUtils.groovy:113)
@yannickchristhomas yannickchristhomas merged commit 36151d7 into main May 24, 2024
1 check passed
@yannickchristhomas yannickchristhomas deleted the feature/prom-stack-air-gapped branch May 24, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants