mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-23 01:24:36 +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
|
# https://git.khuedoan.com/user/settings/applications
|
||||||
# Doing this properly inside the cluster requires:
|
# Doing this properly inside the cluster requires:
|
||||||
# - Kubernetes service account
|
# - Kubernetes service account
|
||||||
try:
|
config.load_config()
|
||||||
config.load_incluster_config()
|
|
||||||
except config.ConfigException:
|
|
||||||
config.load_kube_config()
|
|
||||||
|
|
||||||
gitea_host = client.NetworkingV1Api().read_namespaced_ingress('gitea', 'gitea').spec.rules[0].host
|
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')
|
gitea_user_secret = client.CoreV1Api().read_namespaced_secret('gitea-admin-secret', 'gitea')
|
||||||
|
Loading…
Reference in New Issue
Block a user