refactor(structure): reorganize monorepo with projects, terraform hierarchy, and strict k8s namespace rules

This commit is contained in:
Moritz Graf
2026-10-12 13:49:41 +02:00
parent 4831147087
commit 8f01b75bd6
4766 changed files with 551 additions and 91 deletions
-26
View File
@@ -1,26 +0,0 @@
# -*- encoding: utf-8 -*-
###
try:
input = raw_input
except NameError:
pass
import ovh
import json
# create a client using configuration from ovh.conf file
client = ovh.Client()
# Request RO, /me API access
ck = client.new_consumer_key_request()
ck.add_recursive_rules(ovh.API_READ_ONLY, "/")
# Request token
validation = ck.request()
print("Please visit %s to authenticate" % validation['validationUrl'])
input("and press Enter to continue...")
# Print nice welcome message
print("Welcome", client.get('/me')['firstname'])
print("Btw, your 'consumerKey' is '%s'" % validation['consumerKey'])
-46
View File
@@ -1,46 +0,0 @@
# -*- encoding: utf-8 -*-
'''
List all domain relevant information to add them to Terraform
'''
import json
import ovh
import sys
# Instanciate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page
client = ovh.Client(
endpoint='ovh-eu', # Endpoint of API OVH Europe (List of available endpoints)
application_key='pSnvZrS8R4LPCLEh', # Application Key
application_secret='CKUHMo5ZXDm8JLA6ZWWUzAolglQmvylv', # Application Secret
consumer_key='EVBu0meA2OYvEvVWUbR0qwU2lD7uXKiM', # Consumer Key
)
all_domains = client.get('/domain')
# Pretty print
print("All domains: "+json.dumps(all_domains, indent=4))
for domain in all_domains :
print("Looking at domain: " +domain)
try:
if(domain in ["moritzgraf.de"]):
all_resources = client.get('/domain/zone/'+str(domain)+"/record")
print("All resources:"+json.dumps(all_resources,indent=4))
for resource in all_resources:
try:
record_details = client.get('/domain/zone/'+str(domain)+"/record/"+str(resource))
if(record_details["subDomain"] and record_details["subDomain"] in ["git","auth","prometheus","alertmanager",
"chat","mqtt", "cloud","monitoring","smtp","pop3","imap","jaeger","ldap","code","hub","grafana",
"tt-rss","phpmyadmin","phppgadmin","www","terraformtest","rstudio","code" ]):
#print("Domain"+str(record_details["zone"])+"Subdomain:"+str(record_details["subDomain"]))
print("terraform import 'ovh_domain_zone_record.moritzgraf_subdomains[\""+record_details["subDomain"]+"\"]' "+ str(record_details["id"])+"."+str(record_details["zone"]))
except Exception as e:
print("Somthing did not work for domain:"+str(record_details))
print(e)
# print("###details###"+str(record_details))
else:
print("Domain "+str(domain)+" not on whitelist, ignoring")
except Exception as e:
print("Somthing did not work for domain:"+domain)
print(e)
-13
View File
@@ -1,13 +0,0 @@
; THIS FILE IS FOR MANUALLY CHECKING THE API
; TO BE USED WITH ovh_dev.py
[default]
; general configuration: default endpoint
endpoint=ovh-eu
[ovh-eu]
; configuration specific to 'ovh-eu' endpoint
application_key=pSnvZrS8R4LPCLEh
application_secret=CKUHMo5ZXDm8JLA6ZWWUzAolglQmvylv
; uncomment following line when writing a script application
; with a single consumer key.
;consumer_key=eNrAf7toCYw6u8vIyRcHNFp4KqyYW0Tp