Skip to content

datasophie/pergola-ingress-browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pergola Ingress Browser

Retrieves and lists all Ingresses configured on Pergola, per Project/Stage/Component, including their network and auth configurations, if available.

Deployment to Pergola

  • Create a new Project pointing to this Git repo
  • Trigger a new Build
  • Create a new Stage
  • Let your Pergola admin know that you need special permissions for the Identity defined in pergola.yaml
  • (optional) Add a new Configuration to Stage:
    • If you want the app to automatically create links to Pergola UI, add this entry to the config:
    • PERGOLA_UI_URL: <url of your Pergola UI installation, e.g. https://console.pergola.mycompany.com>
  • Deploy

Required permissions at runtime

This app defines an Identity which requires access to K8s resources at runtime with at least following permissions:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: ingress-browser
rules:
- apiGroups: ["networking.k8s.io"]
  resources: ["ingresses"]
  verbs: ["get", "list"]

This ClusterRole needs to be setup by a Pergola admin.

As soon as the Stage exists a Pergola admin can link the Pergola Identity to the ClusterRole above. Here is a template for the binding:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: ingress-browser
roleRef:
  kind: ClusterRole
  name: ingress-browser
  apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
  name: ingress-browser # as defined in pergola.yaml
  namespace: # of project/stage

This can be done before or after deployment. As long as this role binding is not in place, the app will report "permission denied".

Running the app locally (for dev/debugging)

Note: You need a local ~/.kube/config with at least the permission to get and list Ingresses on Kubernetes (see required permissions above).

With Python

Requires Python >= 3.8

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
flask --app app run --debug

With Docker

docker compose build
docker compose up

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published