Deploying and connecting Service Interconnect edge gateways by using the CLI
Use the palmctl CLI to deploy your Red Hat® Service Interconnect® gateways in IBM® Hybrid Cloud Mesh (Mesh) and connect the gateways by using a remote connection.
Prerequisites
- Install an Open Horizon agent to manage the gateway. See Installing an Open Horizon agent.
- Install the Mesh CLI. See Installing the CLI.
- Create or identify a Mesh network segment that contains the managed namespace. For more information about creating a network segment, see Creating Mesh network segments by using the CLI.
- Create or identify a Mesh-managed namespace that represents the Kubernetes namespace where you want to deploy the gateway.
- If you want to specify the version of Red Hat Service Interconnect that is installed when you deploy the gateway, complete the following steps:
- View the supported versions by running the following command:
palmctl get rhsi-versions - When you deploy the gateway, include the following field with the appropriate version:
"intended_version": "<rhsi_version>"
- View the supported versions by running the following command:
To enable applications that are running in non-Kubernetes environments to access services at this gateway, you must enable external client access when you deploy the gateway. By default, external client access is disabled.
For more information, see Configuring external client access by using the Mesh CLI.
Deploy the gateway
palmctl CLI, follow these steps:
- Configure the gateway by using the
palmctl patchcommand. For example, run a command like this:
The parameters in the site configuration section are optional. For some of the parameters, the following default values apply if you do not provide a value.cat << EOF | palmctl patch gateway --name <gateway-name> -f - intended_compute_profile: <intended_compute_profile_type> site_configuration: '{ "ingress": "<ingress>", "ingress_host": "<ingress_host>", "router_ingress_host": "<router_ingress_host>", "controller_ingress_host": "<controller_ingress_host>", "ingress_annotations": "<ingress_annotations>", "flow_collector": true/false, "console": true/false, "router_console": true/false, "router_cpu": "<router_cpu>m", "router_cpu_limit": "<router_cpu_limit>m", "router_memory": "<router_memory>Mi", "router_memory_limit": "<router_memory_limit>Mi", "run_as_user": <run_as_user>, "controller_pod_annotation": "<controller_pod_annotation>", "site_name": "<site_name>", "router_mode": "interior", "labels": "<labels>", "router_logging": "<router_logging>", "create_network_policy": false, "enable_rest_api": true/false, "annotations": "<annotations>", "router_service_annotations": "<router_service_annotations>", "router_pod_annotations": "<router_pod_annotations>", "enable_service_sync": true, "routers": "<routers_count>", "router_load_balancer_ip": "<router_load_balancer_ip>", "router_data_connection_count": "<router_data_connection_count>", "enable_skupper_events": true/false }' EOFrouter-mode: interior router-logging: Information create-network-policy: False enable-service-sync: true routers: 0 - Create the namespace where you want to deploy the gateway, if one does not exist already. For example, run a command like this:
cat << EOM | palmctl create namespace --cloud-name <cloud-name> --cluster-name <cluster-name> -f - name: <namespace-name> network_segment_id: <network_segment_id> EOM - Set the network segment ID and gateway ID for the namespace by using the
palmctl patchcommand. For example, run a command like this:
The gateway is deployed with the parameters that you specified in step 1.cat << EOM | palmctl patch namespace --cloud-name <cloud-name> --cluster-name <cluster-name> --name <namespace-name> -f - network_segment_id: <network_segment_id> gateway_id: <gateway_id> EOM
<gateway-name>must be unique.- The available values for the
intended_compute_profilearesmall,medium,large, andcustom. Forcustom, the user can selectrouter_cpu,router_cpu_limit,router_memory, orrouter_memory_limitto provide custom values. This field determines the maximum CPU and memory resources that the gateway can use. After the gateway is deployed, you cannot modify these settings. - The
ingressattribute in thesite_configurationfield determines the ingress controller that is used when the gateway is deployed. For more information about the configuration settings, see the Initialise Skupper help document. - All site configuration parameters are optional.
- For more information about the router configuration settings, see the Initialise Skupper help document. View the information about the
site-name,router-mode,router-logging,annotations,router-service-annotations,router-pod-annotations,routers,router-data-connection-count,router-load-balancer-ip,create-network-policy,enable-service-sync, andlabelsoptions. - You can only update the site configuration parameters when the
life_cycle_stateparameter is set to gw-not-deployed. Thelife_cycle_stateparameter is a Service Interconnect edge property.
Deploy the gateway by using YAML or JSON files
You can apply the gateway settings by using a YAML or JSON file. Using these files allows users to reuse them later. You can also use tools such as yq or jq to verify the integrity of the YAML or JSON.
-
Create a YAML file to hold your input parameters. For example, create a file called gw_site_config_params.yaml and add the following input parameters:
intended_compute_profile: <intended_compute_profile_type> site_configuration: '{ "ingress": "<ingress>", "ingress_host": "<ingress_host>", "router_ingress_host": "<router_ingress_host>", "controller_ingress_host": "<controller_ingress_host>", "ingress_annotations": "<ingress_annotations>", "flow_collector": true/false, "console": true/false, "router_console": true/false, "router_cpu": "<router_cpu>m", "router_cpu_limit": "<router_cpu_limit>m", "router_memory": "<router_memory>Mi", "router_memory_limit": "<router_memory_limit>Mi", "run_as_user": <run_as_user>, "controller_pod_annotation": "<controller_pod_annotation>", "site_name": "<site_name>", "router_mode": "interior", "labels": "<labels>", "router_logging": "<router_logging>", "create_network_policy": false, "enable_rest_api": true/false, "annotations": "<annotations>", "router_service_annotations": "<router_service_annotations>", "router_pod_annotations": "<router_pod_annotations>", "enable_service_sync": true, "routers": "<routers_count>", "router_load_balancer_ip": "<router_load_balancer_ip>", "router_data_connection_count": "<router_data_connection_count>", "enable_skupper_events": true/false }' EOF - Create a JSON file to hold your input parameter. For example, created a file called siteconfig.json and the following input parameters:
{ "Intended_compute_profile": "custom", "site_configuration": "{ \"ingress\": \"route\", \"ingress_host\": \"ingress.host.name\", \"router_ingress_host\": \"router.ingress.host.name\", \"controller_ingress_host\": \"controller.ingress.host.name\", \"ingress_annotations\": \"ingress_annotations6=ingress_annotations61\", \"flow_collector\": true, \"console\": false, \"router_console\": false, \"router_cpu\": \"100m\", \"router_cpu_limit\": \"1000m\", \"router_memory\": \"100Mi\", \"router_memory_limit\": \"1000Mi\", \"run_as_user\": 1000, \"controller_pod_annotation\": \"skupper.io/component=controller\", \"site_name\": \"site2266\", \"router_mode\": \"interior\", \"labels\": \"test2266\", \"router_logging\": \"info\", \"create_network_policy\": false, \"enable_rest_api\": false, \"annotations\": \"annotations=annotations2266\", \"router_service_annotations\": \"routerservice=value2266\", \"router_pod_annotations\": \"routerpod=value1\", \"enable_service_sync\": false, \"routers\": \"6\", \"router_load_balancer_ip\": \"6.5.5.5\", \"router_data_connection_count\": \"6\", \"enable_skupper_events\": false }" } -
Apply the gateway settings by using either a YAML or JSON file. For example, run a command like this:
palmctl patch gateway --name <gw-name> -f gw_site_config_params.yamlpalmctl patch gateway --name <gw-name> -f siteconfig.jsonNotes:<gateway-name>must be unique.- The available values for the
intended_compute_profilearesmall,medium,large, andcustom. Forcustom, the user can selectrouter_cpu,router_cpu_limit,router_memory, orrouter_memory_limitto provide custom values. This field determines the maximum CPU and memory resources that the gateway can use. After the gateway is deployed, you cannot modify these settings. - The
ingressattribute in thesite_configurationfield determines the ingress controller that is used when the gateway is deployed. For more information about the configuration settings, see the Initialise Skupper help document. - All site configuration parameters are optional.
- For more information about the router configuration settings, see the Initialise Skupper help document. View the information about the
site-name,router-mode,router-logging,annotations,router-service-annotations,router-pod-annotations,routers,router-data-connection-count,router-load-balancer-ip,create-network-policy,enable-service-sync, andlabelsoptions. - You can only update the site configuration parameters when the
life_cycle_stateparameter is set to gw-not-deployed. Thelife_cycle_stateparameter is a Service Interconnect edge property.
Connect two gateways
To connect two Service Interconnect edge gateways, you need to create a Mesh remote connection. The gateways that you are connecting must be associated with the same network segment.
To create a remote connection, you need the name of the source gateway and the ID of the destination gateway.
- Get the ID of the destination gateway:
palmctl get gateways --cloud-name <cloud-name><cloud-name>is the name of the Mesh cloud where the gateways are defined.- The ID of the destination gateway is shown in the
resource_idfield in the output.
- Create the remote connection:
cat << EOM | palmctl create remoteconnection --gateway-name=<gateway-name> -f - name: <connection-name> remote_gw_id: <destination-gateway-resource-id> EOM<gateway-name>is the name of the source gateway.<connection-name>must be unique.
Tip: The output of thepalmctl get remoteconnectionandpalmctl get remoteconnectionscommands contains asecure_health_statusvalue. Use this value to determine whether a secure remote connection isup,down, orinitializing. Ignore thehealth_statusattribute.
What to do next
Create a Mesh connection policy so that service requests can flow over your Service Interconnect edge gateway. See Connecting applications by using policies with the Mesh CLI.