c98d88c197
The artifactapi web UI is open to anyone who can reach the host. Front it with Authentik SSO gated on akP-artifactapi-admin, while leaving the package-manager surfaces (/api/v1, /api/v2, /v2 docker registry, /terraform, /.well-known) untouched — dnf, containerd mirrors, buildah, terraform and CI publish steps cannot do a browser flow. - Add the oauth2-proxy ConfigMap, Deployment, Service and VMPodScrape. - Add the oauth-credentials VaultStaticSecret. - Point the api-route /ui rule at oauth2-proxy and add a /oauth2 rule; the catch-all / rule still goes straight to the api Service on both listeners. Requires terraform-authentik #34 applied and the Vault kv seed first. Reviewed-on: #456 Co-authored-by: unkin-agent <unkin-agent@unkin.net> Co-committed-by: unkin-agent <unkin-agent@unkin.net>
72 lines
1.3 KiB
YAML
72 lines
1.3 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: artifactapi
|
|
namespace: artifactapi
|
|
spec:
|
|
internalTrafficPolicy: Cluster
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
protocol: TCP
|
|
targetPort: http
|
|
selector:
|
|
app: api
|
|
sessionAffinity: None
|
|
type: ClusterIP
|
|
---
|
|
# Authenticated front door for the web UI only: api-route sends /ui and /oauth2
|
|
# here, oauth2-proxy authenticates and forwards to the ui Service. Every other
|
|
# path reaches the api Service above directly and stays unauthenticated.
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: oauth2
|
|
namespace: artifactapi
|
|
spec:
|
|
internalTrafficPolicy: Cluster
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
protocol: TCP
|
|
targetPort: http
|
|
selector:
|
|
app: oauth2
|
|
sessionAffinity: None
|
|
type: ClusterIP
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ui
|
|
namespace: artifactapi
|
|
spec:
|
|
internalTrafficPolicy: Cluster
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
protocol: TCP
|
|
targetPort: http
|
|
selector:
|
|
app: ui
|
|
sessionAffinity: None
|
|
type: ClusterIP
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: redis
|
|
namespace: artifactapi
|
|
spec:
|
|
internalTrafficPolicy: Cluster
|
|
ports:
|
|
- name: redis
|
|
port: 6379
|
|
protocol: TCP
|
|
targetPort: redis
|
|
selector:
|
|
app: redis
|
|
sessionAffinity: None
|
|
type: ClusterIP
|