Skip to content

Commit

Permalink
integrate konflux-ui with namespace-lister
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Ilario <[email protected]>
  • Loading branch information
filariow committed Jan 16, 2025
1 parent 9b0d4f4 commit b9960bb
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 191 deletions.
18 changes: 18 additions & 0 deletions components/konflux-ui/staging/base/proxy/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,24 @@ http {
include /mnt/nginx-generated-config/bearer.conf;
}

location ~* /api/v1/namespaces(/?)$ {
# authenticate request
auth_request_set $email $upstream_http_x_auth_request_email;
auth_request /oauth2/auth;

# Impersonate requesting user
proxy_set_header Impersonate-User $email;
include /mnt/nginx-generated-config/bearer.conf;

# namespace-lister endpoint
rewrite ^/(.*)/$ /$1 permanent;
proxy_pass https://kubernetes.default.svc;
if ($request_method = GET) {
proxy_pass http://namespace-lister.namespace-lister.svc.cluster.local:8080;
}
proxy_read_timeout 30m;
}

location /health {
# Used for liveness probes
return 200;
Expand Down
16 changes: 8 additions & 8 deletions components/namespace-lister/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ resources:
- deployment.yaml
- namespace.yaml
- rbac.yaml
- proxy.yaml
- route.yaml
- service.yaml
- network_policy.yaml
namespace: namespace-lister
configMapGenerator:
- files:
- nginx.conf=nginx.conf
name: nginx
options:
disableNameSuffixHash: true
images:
- name: namespace-lister
newName: quay.io/konflux-ci/namespace-lister
newTag: fd195c941b3151c165ddf376ce5f44d57db3f071
patches:
- path: ./patches/with-header-auth.yaml
target:
group: apps
kind: Deployment
name: namespace-lister
namespace: namespace-lister
22 changes: 22 additions & 0 deletions components/namespace-lister/base/network_policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: namespace-lister
namespace: namespace-lister
spec:
podSelector:
matchLabels:
apps: namespace-lister
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: konflux-ui
- podSelector:
matchLabels:
app: proxy
ports:
- protocol: TCP
port: 8080
59 changes: 0 additions & 59 deletions components/namespace-lister/base/nginx.conf

This file was deleted.

105 changes: 0 additions & 105 deletions components/namespace-lister/base/proxy.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions components/namespace-lister/base/route.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions components/namespace-lister/base/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
namespace: namespace-lister
spec:
selector:
app: namespace-lister-proxy
app: namespace-lister
type: ClusterIP
ports:
- name: http
targetPort: 8080
port: 12000
port: 8080

0 comments on commit b9960bb

Please sign in to comment.