question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sourceDir/outputDir for helm and target fabric8:distro are not working

See original GitHub issue

Description

We are trying to generate kubernetes configurations/helm as delivery for multiple environments. In our development environment we use additional configuration which is not necessary in release artefacts. Our approach is to use multiple fabric8 directories with resource fragments, let’s say src/main/fabric8-dev and src/main/fabric8-prod, like mentioned in #729 . Is there an other way to achieve this goal?

For each environment we have configured an execution with own targetDir configuration. Now we are experiencing the problem that we can not set the sourceDir for helm charts as expected.

<configuration>
  <resourceDir>${basedir}/src/main/fabric8-dev</resourceDir>
  <targetDir>${basedir}/target/classes/META-INF/fabric8-dev</targetDir>
  <helm>
    <chart>${helm.chart.name}-dev</chart>
    <sourceDir>${basedir}/target/classes/META-INF/fabric8-dev</sourceDir>
  </helm>
</configuration>

It looks like the sourceDir for helm is always loaded from property fabric8.helm.sourceDir, the helm config is ignored. https://github.com/fabric8io/fabric8-maven-plugin/blob/9102af60e232c1ac6e2cc29d81ffd8f13f562bab/plugin/src/main/java/io/fabric8/maven/plugin/mojo/build/HelmMojo.java#L136-L139

As an alternative we have tried to use the target fabric8:distro to create a tarball to use as delivery but this doesn’t work at all. The target always fails with:

goal io.fabric8:fabric8-maven-plugin:3.5.31:distro failed: [local_module_path]/target/distro isn’t a directory.

In this case the helm configuration for outputDir is also ignored as far as i can see in the Mojo. https://github.com/fabric8io/fabric8-maven-plugin/blob/9102af60e232c1ac6e2cc29d81ffd8f13f562bab/plugin/src/main/java/io/fabric8/maven/plugin/mojo/build/DistroMojo.java#L157-L160

Info

  • f-m-p version : 3.5.31
  • Maven version (mvn -v) :3.3.3

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14

github_iconTop GitHub Comments

2reactions
rgsellcommented, Jan 16, 2018

Hi @elmguyc

Thats does not relate to the issue described, but i experienced the same issue you are describing with the maven plugin update to 3.5.33. Since 3.5.32 with #1077 you can make use of a template to parametrise the helm chart. For the generation of the helm chart there is now the k8s-template expected (even if you don’t make use of a template): https://github.com/fabric8io/fabric8-maven-plugin/blob/426649978709e5654d0a144cc6f4d1c6d054884d/plugin/src/main/java/io/fabric8/maven/plugin/mojo/build/HelmMojo.java#L300-L307

The k8s-template is generated by fabric8:resource if you have placed a template.yaml in your fabric8 resource fragment folder (resourceDir: default “src/main/fabric8/”). Sadly this part is not well documented.

example template.yaml:

kind: Template
parameters:
- name: PROJECT_NAMESPACE

you’re welcome.

0reactions
stale[bot]commented, Feb 10, 2019

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

Read more comments on GitHub >

github_iconTop Results From Across the Web

11.2. OpenShift and Kubernetes Access - manualzz
sourceDir. outputDir keywords. Where to create the the Helm chart, which is. ${basedir}/target/fabric8/helm. by default for Kubernetes (and.
Read more >
Continuous Delivery in Java - EBIN.PUB
Deployment Platform-Specific Security Issues ... mentation of a build pipeline (and potential integration with the target platform).
Read more >
fabric8io/fabric8-maven-plugin | Roland Huß, James Strachan ...
fabric8io/fabric8-maven-plugin | Roland Huß, James Strachan | download | Z-Library. Download books for free. Find books.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found