Change to new cluster config
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful

This commit is contained in:
Madis Mägi 2024-07-27 03:40:41 +03:00
parent d554fae7cd
commit 2aa75d9e4b
4 changed files with 7 additions and 7 deletions

View File

@ -22,7 +22,7 @@ spec:
image: inventory-app image: inventory-app
env: env:
- name: OIDC_USERS_NAMESPACE - name: OIDC_USERS_NAMESPACE
value: "oidc-gateway" value: "default"
- name: SLACK_DOORLOG_CALLBACK - name: SLACK_DOORLOG_CALLBACK
value: "changeme" value: "changeme"
- name: SLACK_INVENTORY_CALLBACK - name: SLACK_INVENTORY_CALLBACK
@ -82,11 +82,11 @@ kind: Ingress
metadata: metadata:
name: inventory-app name: inventory-app
annotations: annotations:
kubernetes.io/ingress.class: shared
traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true" traefik.ingress.kubernetes.io/router.tls: "true"
external-dns.alpha.kubernetes.io/target: traefik.codemowers.ee external-dns.alpha.kubernetes.io/target: traefik.codemowers.ee
spec: spec:
ingressClassName: shared
rules: rules:
- host: inventory-app-72zn4.codemowers.ee - host: inventory-app-72zn4.codemowers.ee
http: http:
@ -102,8 +102,8 @@ spec:
- hosts: - hosts:
- "*.codemowers.ee" - "*.codemowers.ee"
--- ---
apiVersion: codemowers.io/v1alpha1 apiVersion: codemowers.cloud/v1beta1
kind: OIDCGWClient kind: OIDCClient
metadata: metadata:
name: inventory-app name: inventory-app
spec: spec:

View File

@ -33,7 +33,7 @@ class User:
def get_users_inner(): def get_users_inner():
config.load_incluster_config() config.load_incluster_config()
api_instance = client.CustomObjectsApi() api_instance = client.CustomObjectsApi()
ret = api_instance.list_namespaced_custom_object("codemowers.io", "v1alpha1", OIDC_USERS_NAMESPACE, "oidcgatewayusers") ret = api_instance.list_namespaced_custom_object("codemowers.cloud", "v1beta1", OIDC_USERS_NAMESPACE, "oidcusers")
for item in ret["items"]: for item in ret["items"]:
username = item['metadata']['name'] username = item['metadata']['name']
display_name = item.get("spec", {}).get("customProfile", {}).get("name", None) display_name = item.get("spec", {}).get("customProfile", {}).get("name", None)

View File

@ -10,7 +10,7 @@ from functools import wraps
page_oidc = Blueprint("oidc", __name__) page_oidc = Blueprint("oidc", __name__)
db = MongoClient(const.MONGO_URI).get_default_database() db = MongoClient(const.MONGO_URI).get_default_database()
gw_uri = os.getenv("OIDC_GATEWAY_URI") gw_uri = os.getenv("OIDC_IDP_URI")
metadata = requests.get(f"{gw_uri}.well-known/openid-configuration").json() metadata = requests.get(f"{gw_uri}.well-known/openid-configuration").json()
def login_required(_f=None, *, groups=[]): def login_required(_f=None, *, groups=[]):

View File

@ -6,7 +6,7 @@ metadata:
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: ClusterRole kind: ClusterRole
name: cluster-admin name: passmower
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: oidc-gateway name: oidc-gateway