Skip to content

Commit 3c3d88a

Browse files
authored
Merge pull request #3 from linuxfoundation/bramwelt/httproute
[LFXV2 - 135] Replace Ingress resource with HTTPRoute + Chart Updates
2 parents 9b3b1b3 + 7ef3953 commit 3c3d88a

File tree

12 files changed

+70
-68
lines changed

12 files changed

+70
-68
lines changed

.github/workflows/license-header-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
jobs:
1414
license-header-check:
1515
name: License Header Check
16-
uses: linuxfoundation/lfx-public-workflows/.github/workflows/license-header-check.yml@main
16+
uses: linuxfoundation/lfx-public-workflows/.github/workflows/license-header-check.yml@c465d6571fa0b8be9d551d902955164ea04a00af
1717
with:
1818
copyright_line: "Copyright The Linux Foundation and each contributor to LFX."
1919
exclude_pattern: "gen/*"

.yamllint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# YAML Lint configuration
22
# Copyright The Linux Foundation and each contributor to LFX.
33
# SPDX-License-Identifier: MIT
4-
4+
---
55
extends: default
66

77
rules:
@@ -21,7 +21,7 @@ rules:
2121

2222
# Document start
2323
document-start:
24-
present: false
24+
present: true
2525

2626
# Empty lines
2727
empty-lines:
@@ -49,6 +49,6 @@ rules:
4949
# Ignore certain files
5050
ignore: |
5151
.github/workflows/
52-
charts/*/templates/
52+
charts/*/templates/**
5353
vendor/
5454
node_modules/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ The service is configured via environment variables:
118118
| `PORT` | Server port | `8080` |
119119
| `DEBUG` | Enable debug logging | `false` |
120120
| `JWKS_URL` | Heimdall JWKS endpoint | `http://heimdall:4457/.well-known/jwks` |
121-
| `AUDIENCE` | JWT audience | `access-check` |
121+
| `AUDIENCE` | JWT audience | `lfx-v2-access-check` |
122122
| `ISSUER` | JWT issuer | `heimdall` |
123123
| `NATS_URL` | NATS server URL | `nats://nats:4222` |
124124

charts/lfx-v2-access-check/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright The Linux Foundation and each contributor to LFX.
22
# SPDX-License-Identifier: MIT
3-
3+
---
44
apiVersion: v2
55
name: lfx-v2-access-check
66
description: LFX Platform V2 Access Check Service chart

charts/lfx-v2-access-check/templates/deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: apps/v1
55
kind: Deployment
66
metadata:
77
name: lfx-v2-access-check
8-
namespace: lfx
8+
namespace: {{ .Release.Namespace }}
99
spec:
1010
replicas: {{ .Values.replicaCount }}
1111
selector:
@@ -19,13 +19,13 @@ spec:
1919
containers:
2020
- name: app
2121
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
22-
imagePullPolicy: Never
22+
imagePullPolicy: {{ .Values.image.pullPolicy }}
2323
ports:
24-
- containerPort: {{ .Values.app.port }}
24+
- containerPort: {{ .Values.app.port | int }}
2525
name: web
2626
env:
2727
- name: PORT
28-
value: {{ .Values.app.port }}
28+
value: "{{ .Values.app.port }}"
2929
- name: HOST
3030
value: "{{ .Values.app.host }}"
3131
- name: DEBUG
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright The Linux Foundation and each contributor to LFX.
2+
# SPDX-License-Identifier: MIT
3+
{{- if .Values.traefik.enabled }}
4+
---
5+
apiVersion: gateway.networking.k8s.io/v1
6+
kind: HTTPRoute
7+
metadata:
8+
name: lfx-v2-access-check
9+
namespace: {{ .Release.Namespace }}
10+
spec:
11+
parentRefs:
12+
- name: {{ .Values.traefik.gateway.name }}
13+
namespace: {{ .Values.traefik.gateway.namespace }}
14+
hostnames:
15+
- "lfx-api.{{ .Values.lfx.domain }}"
16+
rules:
17+
- matches:
18+
- path:
19+
type: Exact
20+
value: /access-check
21+
- path:
22+
type: PathPrefix
23+
value: /access-check/
24+
{{- if .Values.heimdall.enabled }}
25+
filters:
26+
- type: ExtensionRef
27+
extensionRef:
28+
group: traefik.io
29+
kind: Middleware
30+
name: heimdall
31+
{{- end }}
32+
backendRefs:
33+
- name: lfx-v2-access-check
34+
port: {{ .Values.app.port | int }}
35+
{{- end }}

charts/lfx-v2-access-check/templates/ingress.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
# Copyright The Linux Foundation and each contributor to LFX.
22
# SPDX-License-Identifier: MIT
3-
3+
{{- if .Values.heimdall.enabled }}
44
---
55
apiVersion: heimdall.dadrus.github.com/v1alpha4
66
kind: RuleSet
77
metadata:
88
name: lfx-v2-access-check
9-
namespace: lfx
9+
namespace: {{ .Release.Namespace }}
1010
spec:
1111
rules:
12-
- id: "rule:lfx-v2-access-check:health"
13-
match:
14-
methods:
15-
- GET
16-
routes:
17-
- path: /livez
18-
- path: /readyz
19-
execute:
20-
- authenticator: anonymous_authenticator
21-
- authorizer: allow_all
22-
- finalizer: create_jwt
23-
config:
24-
values:
25-
aud: lfx-v2-access-check
2612
- id: "rule:lfx-v2-access-check:access-check"
2713
match:
2814
methods:
@@ -35,4 +21,5 @@ spec:
3521
- finalizer: create_jwt
3622
config:
3723
values:
38-
aud: lfx-v2-access-check
24+
aud: {{ .Values.app.audience }}
25+
{{- end }}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Copyright The Linux Foundation and each contributor to LFX.
22
# SPDX-License-Identifier: MIT
3-
3+
---
44
apiVersion: v1
55
kind: Service
66
metadata:
77
name: lfx-v2-access-check
8-
namespace: lfx
8+
namespace: {{ .Release.Namespace }}
99
spec:
1010
ports:
1111
- name: web
12-
port: 8080
12+
port: {{ .Values.app.port | int }}
1313
targetPort: web
1414
selector:
1515
app: lfx-v2-access-check
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
# Copyright The Linux Foundation and each contributor to LFX.
22
# SPDX-License-Identifier: MIT
3-
3+
---
44
replicaCount: 1
55

6+
lfx:
7+
domain: k8s.orb.local
8+
69
# Override from CLI/CI: --set image.tag=<git-sha>, etc.
710
image:
811
tag: "0.1.0"
912
repository: linuxfoundation/lfx-access-check
13+
pullPolicy: IfNotPresent
1014

1115
# Application configuration
1216
app:
1317
# Server configuration
14-
port: "8080"
18+
port: 8080
1519
host: "*"
1620
debug: false
1721

1822
# JWT/Auth configuration
19-
audience: "access-svc"
23+
audience: "lfx-v2-access-check"
2024
issuer: "heimdall"
2125

22-
# ingress is the configuration for the ingress routing
23-
ingress:
24-
hostname: lfx-api.k8s.orb.local
26+
# HTTP routing configuration
27+
traefik:
28+
enabled: true
29+
gateway:
30+
name: lfx-platform-gateway
31+
namespace: lfx
2532

2633
# nats is the configuration for the NATS server
2734
nats:
@@ -31,4 +38,4 @@ nats:
3138
# heimdall is the configuration for the heimdall middleware
3239
heimdall:
3340
enabled: true
34-
url: http://heimdall.lfx.svc.cluster.local:4456
41+
url: http://lfx-platform-heimdall.lfx.svc.cluster.local:4456

0 commit comments

Comments
 (0)