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

feat: add support for custom scripts #6970

Merged
merged 3 commits into from Dec 8, 2023
Merged

feat: add support for custom scripts #6970

merged 3 commits into from Dec 8, 2023

Conversation

moabu
Copy link
Member

@moabu moabu commented Dec 6, 2023

Prepare


Description

Target issue

closes #6969

Implementation Details

For JARs greater than 1MB

  1. Create a configmap or secret for a shell script that contains instructions to pull the custom jar file:

    #!/bin/sh
    # This script will pull the custom jar file from a remote location
    # and place it in the correct location for the Jans Auth server to use it
    wget -O /opt/jans/jetty/jans-auth/custom/libs/mycustom.jar https://mydomain.com/mycustom.jar

    kubectl -n <namespace> create cm my-custom-jar --from-file=mycustomjar.sh

  2. Mount the configmap or secret in your values.yaml under auth-server.volumes and auth-server.volumeMounts

    auth-server:
      volumeMounts:
        - name: my-custom-jar-volume
          mountPath: /tmp/mycustomjar.sh
          subPath: mymycustomjar.sh
      volumes:
        - name: my-custom-jar-volume
          configMap:
            name: my-custom-jar
      customScripts:
        - /tmp/mycustomjar.sh
    
  3. Run helm install or helm upgrade if Jans has been already installed.

    helm upgrade <helm-release-name> janssen/janssen -n <namespace> -f values.yaml --version=1.0.x

Test and Document the changes

  • Static code analysis has been run locally and issues have been fixed
  • Relevant unit and integration tests have been added/updated
  • Relevant documentation has been updated if any (i.e. user guides, installation and configuration guides, technical design docs etc)

@moabu moabu requested review from iromli and misba7 December 6, 2023 13:17
@mo-auto mo-auto added area-documentation Documentation needs to change as part of issue or PR comp-charts-jans kind-feature Issue or PR is a new feature request labels Dec 6, 2023
volumeMounts:
- name: my-custom-jar-volume
mountPath: /tmp/mycustomjar.sh
subPath: mymycustomjar.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subPath should be mycustom.jar

volumes:
- name: my-custom-jar-volume
configMap:
name: my-custom-jar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May need to adjust defaultMode to add proper executable permission for the script. By default it's 420 (equivalent to 0644).

Signed-off-by: Amro Misbah <amromisba7@gmail.com>
@moabu moabu merged commit 37b171d into main Dec 8, 2023
2 checks passed
@moabu moabu deleted the cn-custom-scripts branch December 8, 2023 11:29
devrimyatar pushed a commit that referenced this pull request Dec 30, 2023
* feat: add support for custom scripts

* docs: fix type and add set the defaultMode to grant execute permission

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

---------

Signed-off-by: Amro Misbah <amromisba7@gmail.com>
Co-authored-by: Amro Misbah <amromisba7@gmail.com>
Signed-off-by: Mustafa Baser <mbaser@mail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-documentation Documentation needs to change as part of issue or PR comp-charts-jans kind-feature Issue or PR is a new feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(charts): add support for running custom scripts before the entrypoints in the helm charts
4 participants