diff --git a/molecule/presets/k8s/kubernetes.yml b/molecule/presets/k8s/kubernetes.yml index 0a94f56..0c22283 100644 --- a/molecule/presets/k8s/kubernetes.yml +++ b/molecule/presets/k8s/kubernetes.yml @@ -46,17 +46,19 @@ kind_clusters: prometheus_stack: true # Порты для доступа к аддонам извне # Документация: https://devops.org.ru - # Ingress HTTP: http://localhost:8081 - # Ingress HTTPS: https://localhost:8443 + # Ingress HTTP: http://localhost:80 + # Ingress HTTPS: https://localhost:443 # Prometheus: http://localhost:9090 # Grafana: http://localhost:3000 (admin/admin) # Kiali: http://localhost:20001 + # Metrics Server: http://localhost:4443 addon_ports: - ingress_http: 8081 - ingress_https: 8443 + ingress_http: 80 + ingress_https: 443 prometheus: 9090 grafana: 3000 kiali: 20001 + metrics_server: 4443 hosts: # Стандартный набор - 2 хоста для базового тестирования (стабильные ОС) diff --git a/scripts/create_k8s_cluster.py b/scripts/create_k8s_cluster.py index e497d34..6a4b1d4 100755 --- a/scripts/create_k8s_cluster.py +++ b/scripts/create_k8s_cluster.py @@ -166,6 +166,14 @@ def main(): 'protocol': 'TCP' }) + # Metrics Server порт - пробрасываем изнутри кластера (4443) на внешний порт + if addon_ports.get('metrics_server'): + port_mappings.append({ + 'containerPort': 4443, # Внутренний порт Metrics Server + 'hostPort': addon_ports['metrics_server'], # Внешний порт на хосте + 'protocol': 'TCP' + }) + if port_mappings: config['nodes'][0]['extraPortMappings'] = port_mappings