mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-23 01:04:32 +07:00
refactor(hacks): use wrapper function to load kube config
This commit is contained in:
parent
23f695b8fb
commit
6ebedfbe8c
@ -21,10 +21,7 @@ from kubernetes.stream import stream
|
||||
# https://git.khuedoan.com/user/settings/applications
|
||||
# Doing this properly inside the cluster requires:
|
||||
# - Kubernetes service account
|
||||
try:
|
||||
config.load_incluster_config()
|
||||
except config.ConfigException:
|
||||
config.load_kube_config()
|
||||
config.load_config()
|
||||
|
||||
gitea_host = client.NetworkingV1Api().read_namespaced_ingress('gitea', 'gitea').spec.rules[0].host
|
||||
gitea_user_secret = client.CoreV1Api().read_namespaced_secret('gitea-admin-secret', 'gitea')
|
||||
|
Loading…
Reference in New Issue
Block a user