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

Fix ingress prefix #82

Merged
merged 2 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions helm-chart-sources/logstream-leader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ This section covers the most likely values to override. To see the full scope of
|ingress.annotations|{}|If `ingress.enable` is set to `true`, this is where you'll want to put annotations to configure the specific ingress controller. _*NOTE: Ingress is supported only on Kubernetes 1.19 and later clusters*_. |
|ingress.tls|{}|[Ingress TLS configuration](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls)|
|ingress.ingressClassName|none|Override the default ingress class ([added in Kubernetes 1.18](https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation))|
|ingress.path|`/*`|The Ingress path Prefix|

# Basic Installation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
rules:
- http:
paths:
- path: /*
- path: {{ .Values.ingress.prefix }}
pathType: Prefix
backend:
service:
Expand Down
66 changes: 66 additions & 0 deletions helm-chart-sources/logstream-leader/tests/ingress_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
suite: Ingress
templates:
- ingress.yaml
- service.yaml
tests:
- it: Doesn't create an Ingress by default
template: ingress.yaml
asserts:
- hasDocuments:
count: 0

- it: Should leave the service type as the default
template: service.yaml
asserts:
- equal:
path: spec.type
value: "LoadBalancer"

- it: Creates an Ingress resource
set:
ingress.enable: true
template: ingress.yaml
asserts:
- containsDocument:
kind: Ingress
apiVersion: networking.k8s.io/v1

- it: Should set the default prefix
set:
ingress.enable: true
template: ingress.yaml
asserts:
- equal:
path: spec.rules[0].http.paths[0].path
value: "/*"

- it: Should update the ingress prefix
set:
ingress:
enable: true
prefix: "/foo"
template: ingress.yaml
asserts:
- equal:
path: spec.rules[0].http.paths[0].path
value: "/foo"

- it: Should use NodePort for the service when ingress is enabled
set:
ingress.enable: true
template: service.yaml
asserts:
- equal:
path: spec.type
value: "NodePort"

- it: Should set the ingressClassName
set:
ingress:
enable: true
ingressClassName: foo
template: ingress.yaml
asserts:
- equal:
path: spec.ingressClassName
value: "foo"
1 change: 1 addition & 0 deletions helm-chart-sources/logstream-leader/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ ingress:
# - hosts:
# - cribl.example.com
# secretName: cribl-example-com-tls
prefix: /*
ingressClassName:
host:

Expand Down