Skip to content

Update Juice-Shop Helm chart to use modern Ingress resource#1877

Closed
maze88 wants to merge 5 commits intosecureCodeBox:mainfrom
maze88:main
Closed

Update Juice-Shop Helm chart to use modern Ingress resource#1877
maze88 wants to merge 5 commits intosecureCodeBox:mainfrom
maze88:main

Conversation

@maze88
Copy link
Contributor

@maze88 maze88 commented Aug 24, 2023

Description

The Juice-Shop demo-target application can be installed to Kubernetes using a provided Helm chart which also allows exposing its service online via an Ingress resource. This Ingress resource's template (in the Helm chart) was using an out-dated API version.

This pull request contributes an up to date version of the Ingress resource's template to use the standard networking.k8s.io/v1 API version, instead of the old networking.k8s.io/v1beta1 or extensions/v1beta1 API versions (conditionally).

Testing

In order to test one can install with Helm to a Kubernetes cluster, or render the Kubernetes manifests with helm template and compare the YAML to the modern structure here.

Click to expand my test details...

With the values file:

# test-values.yaml
ingress:
  enabled: true
  className: nginx
  pathtype: ImplementationSpecific
  annotations: {}
  hosts:
  - host: juice.maze.omg.lol
    paths:
    - path: /
  tls:
  - hosts:
    - juice.maze.omg.lol
    secretName: juice-shop-tls

deploy with:

helm install my-juice . -f test-values.yaml

or run:

helm template my-juice . -f test-values.yaml | grep -A 26 Ingress

which yields:

kind: Ingress
metadata:
  name: my-juice-juice-shop
  labels:
    helm.sh/chart: juice-shop-v3.1.0-alpha3
    app.kubernetes.io/name: juice-shop
    app.kubernetes.io/instance: my-juice
    app.kubernetes.io/version: "v13.0.3"
    app.kubernetes.io/managed-by: Helm
spec:
  ingressClassName: "nginx"
  tls: 
  - hosts:
    - juice.maze.omg.lol
    secretName: juice-shop-tls
  rules:
  - host: juice.maze.omg.lol
    http:
      paths:
      - path: /
        pathType: ImplementationSpecific
        backend:
          service:
            name: my-juice-juice-shop
            port:
              number: 3000
---

@Zero3141
Copy link
Contributor

Hi maze88,

thank you for your contribution, looks good for us. Please sign your commits according to our CONTRIBUTING.md and add yourself to the CONTRIBUTORS.md file, then we can merge. :)

TLDR for signing commits:

  1. Ensure you have a local copy of your branch by checking out the pull request locally via command line.
  2. In your local branch, run: git rebase HEAD~5 --signoff
  3. Force push your changes to overwrite the branch: git push --force-with-lease origin main

@maze88 maze88 closed this by deleting the head repository Aug 29, 2023
@maze88
Copy link
Contributor Author

maze88 commented Aug 29, 2023

Due to merges of the upstream to my fork the history and signoffs became botched.
I have re-forked and recreated the PR. @Zero3141, please continue in: #1882

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