Installing Gateway API
Tip
We recommend using the new Yandex Cloud Gwin controller instead of an ALB Ingress controller and Gateway API.
Gateway APIGatewayClass, Gateway, HTTPRoute, etc.
In Managed Service for Kubernetes, Gateway API launches Yandex Application Load Balancer and its auxiliary resources when a Kubernetes user announces the Gateway resource in a Managed Service for Kubernetes cluster.
Getting started
-
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the
yc config set folder-id <folder_ID>command. You can also set a different folder for any specific command using the--folder-nameor--folder-idparameter. -
Create a service account for Gateway API.
-
Assign the following roles to the service account:
alb.editor: To create the required resources.vpc.publicAdmin: To manage external connectivity.certificate-manager.admin: To use certificates registered in Yandex Certificate Manager.compute.viewer: To use Managed Service for Kubernetes cluster nodes in balancer target groups.
-
Create an authorized key for your service account and save it to the
sa-key.jsonfile:yc iam key create \ --service-account-name <name_of_service_account_for_Gateway_API> \ --output sa-key.json -
Make sure that the security groups for the Managed Service for Kubernetes cluster and its node groups are configured correctly. If any rule is missing, add it.
Warning
The configuration of security groups determines the performance and availability of the cluster and the services and applications running in it.
Installation from Yandex Cloud Marketplace
- Go to the folder page.
- Go to Managed Service for Kubernetes.
- Click the name of the Managed Service for Kubernetes cluster you need and select the
Marketplace tab. - Under Application available for installation, select Gateway API and click Go to install.
- Configure the application:
- Namespace: Create a new namespace, e.g.,
gateway-api-space. If you leave the default namespace, Gateway API may work incorrectly. - Application name: Specify the application name.
- Folder ID: Select the folder where you want to create your load balancers.
- Network ID: Select the cloud network where your load balancers will reside.
- Subnet 1 ID, Subnet 2 ID, Subnet 3 ID: Select subnets where your load balancers will reside.
- Service account key: Paste the contents of the
sa-key.jsonfile or create a new service account key.
- Namespace: Create a new namespace, e.g.,
- Click Install.
- Wait for the application status to change to
Deployed.
Installation using a Helm chart
-
Install Helm
v3.8.0 or higher. -
Install kubect
and configure it to work with the new cluster. -
To install a Helm chart
with Gateway API, run this command:helm pull oci://cr.yandex/yc-marketplace/yandex-cloud/gateway-api/gateway-api-helm/gateway-api \ --version v0.7.3 \ --untar && \ helm install \ --namespace <namespace> \ --create-namespace \ --set folderId='<folder_ID>' \ --set networkId='<cloud_network_ID>' \ --set subnet1Id='<subnet_1_ID>' \ --set subnet2Id='<subnet_2_ID>' \ --set subnet3Id='<subnet_3_ID>' \ --set-file saKeySecretKey='<path_to_sa-key.json>' \ gateway-api ./gateway-api/In this command, specify the network and its subnets where your load balancers will reside.
If you set
namespaceto the default namespace, Gateway API may work incorrectly. We recommend specifying a value different from all the existing namespaces, e.g.,gateway-api-space.Note
If you are using a Helm version below 3.8.0, append the
export HELM_EXPERIMENTAL_OCI=1 && \string to the command to enable Open Container Initiative (OCI) support in the Helm client.
Application auto upgrade
Gateway API 0.6.0 contains a Gateway API CRD upgrade from version 0.6.2
Automatic upgrade from version 0.5.0 or lower follows these steps:
- The cluster is checked for
GRPCRouteorReferenceGrantcustom resources. If such resources exist, the application will not upgrade to avoid conflicts, as CRDs for these resources in the new version are incompatible with the previous version. For manual upgrade, see below. - The Gateway API controller is stopped; the number of replicas scales down to zero.
- The CRDs of the
GRPCRouteresources are removed; the CRDs of the remaining dependent resources of the new Gateway API version are applied. - The Gateway API controller is started; the number of replicas scales back to the original value.
To disable CRD auto update, add this Helm chart installation command parameter: --set crdsAutoUpgrade=false. Thus your resources will be updated, while you will have to update the Gateway API CRDs manually. You can get the CRD file in the crds directory in the Helm chart archive.
Upgrading Gateway API manually
- Create a backup of your Gateway API resources.
- Stop the Gateway API controller.
- Remove all
GRPCRouteresources from your cluster. - Apply the new versions of the Gateway API CRDs. You can get the CRD file in the
crdsdirectory in the Helm chart archive. - Start the Gateway API controller.
- In your
GRPCRouteresource specification, replace theapiVersionvalue withgateway.networking.k8s.io/v1and apply the specification. - Install the new Helm chart version.
Use cases
See also
- Gateway API project description
. - Gateway API description and configuration information in the Application Load Balancer guides.