Commit 375672bd authored by Sergio Gimenez's avatar Sergio Gimenez
Browse files

Parametrise ports

parent e1c47ebc
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -22,27 +22,27 @@ grafana_nodeport: 30091
alertmanager_nodeport: 30092
i2edge_nodeport: 30769

# Port mappings
# Port mappings - using parameterized NodePorts to avoid duplication
port_mappings:
  - container_port: 6443
    host_port: 6443
    listen_address: "0.0.0.0"
  - container_port: "{{ api_server_port }}"
    host_port: "{{ api_server_port }}"
    listen_address: "{{ api_server_address }}"
    protocol: TCP
  - container_port: 30090
    host_port: 30090
    listen_address: "0.0.0.0"
  - container_port: "{{ prometheus_nodeport }}"
    host_port: "{{ prometheus_nodeport }}"
    listen_address: "{{ api_server_address }}"
    protocol: TCP
  - container_port: 30091
    host_port: 30091
    listen_address: "0.0.0.0"
  - container_port: "{{ grafana_nodeport }}"
    host_port: "{{ grafana_nodeport }}"
    listen_address: "{{ api_server_address }}"
    protocol: TCP
  - container_port: 30092
    host_port: 30092
    listen_address: "0.0.0.0"
  - container_port: "{{ alertmanager_nodeport }}"
    host_port: "{{ alertmanager_nodeport }}"
    listen_address: "{{ api_server_address }}"
    protocol: TCP
  - container_port: 30769
    host_port: 30769
    listen_address: "0.0.0.0"
  - container_port: "{{ i2edge_nodeport }}"
    host_port: "{{ i2edge_nodeport }}"
    listen_address: "{{ api_server_address }}"
    protocol: TCP

# Cluster nodes configuration
+0 −7
Original line number Diff line number Diff line
@@ -11,13 +11,6 @@
    - name: Load group variables
      ansible.builtin.include_vars:
        file: "{{ playbook_dir }}/../group_vars/all.yml"
        name: imported_vars
  
    - name: Set variables from group_vars
      ansible.builtin.set_fact:
        port_mappings: "{{ imported_vars.port_mappings }}"
        cert_sans: "{{ imported_vars.cert_sans }}"
        api_server_address: "{{ imported_vars.api_server_address }}"
  
    - name: Display playbook information
      ansible.builtin.debug:
+1 −1
Original line number Diff line number Diff line
@@ -179,6 +179,6 @@
      
      Port mappings:
      {% for port in port_mappings | default([]) %}
        - {{ port.name }}: {{ port.host_port }}
        - {{ port.container_port }}:{{ port.host_port }} ({{ port.protocol }})
      {% endfor %}
      ==========================================
+10 −10
Original line number Diff line number Diff line
@@ -9,23 +9,23 @@ nodes:
        kind: ClusterConfiguration
        apiServer:
          certSANs:
          # TODO Parametrise this later on somehow
          # - "172.27.13.254" # <-- REPLACE with your host IP 
          - "localhost"
          - "127.0.0.1"
          - "10.69.222.3"
    extraPortMappings:
      - containerPort: 6443
        hostPort: 6443
      - containerPort: 6443  # api_server_port        hostPort: 6443
        listenAddress: "0.0.0.0"
        protocol: TCP
      # Prometheus NodePort
      - containerPort: 30090
        hostPort: 30090
      - containerPort: 30090  # prometheus_nodeport        hostPort: 30090
        listenAddress: "0.0.0.0"
        protocol: TCP
      # i2edge service NodePort
      - containerPort: 30769
        hostPort: 30769
      - containerPort: 30091  # grafana_nodeport        hostPort: 30091
        listenAddress: "0.0.0.0"
        protocol: TCP
      - containerPort: 30092  # alertmanager_nodeport        hostPort: 30092
        listenAddress: "0.0.0.0"
        protocol: TCP
      - containerPort: 30769  # i2edge_nodeport        hostPort: 30769
        listenAddress: "0.0.0.0"
        protocol: TCP
  - role: worker
+10 −0
Original line number Diff line number Diff line
#!/bin/bash
# Source this file to configure your environment for the Kind cluster
export KUBECONFIG="/home/sergio/i2cat/OperatorPlatform/OP_Automation/automation/1-kind-cluster/operator-platform-external-kubeconfig.yaml"
echo "✓ KUBECONFIG set to: $KUBECONFIG"
echo ""
echo "Cluster nodes:"
kubectl get nodes
echo ""
echo "To use this cluster in other terminals, run:"
echo "  source /home/sergio/i2cat/OperatorPlatform/OP_Automation/automation/1-kind-cluster/setup-env.sh"