Nesta etapa, explicamos como configurar o serviço do Kubernetes para o gateway de entrada da Apigee.
O serviço Kubernetes é necessário para cada implantação de entrada conseguir um endereço IP que possa ser
exposto. As chamadas do cliente para proxies invocarão um nome de host que será resolvido para esse endereço IP.
Opções dos serviços do Kubernetes para seu gateway de entrada da Apigee
Há duas opções para fornecer um serviço do Kubernetes para atribuir o endereço IP ...
Para ambientes de produção, a Apigee recomenda criar um serviço personalizado do Kubernetes para cada gateway
de entrada.
A Apigee exclui o serviço padrão, mas não exclui o serviço personalizado do Kubernetes após a limpeza.
Portanto, o endereço IP não será liberado após a reinstalação do Apigee híbrido.
Para plataformas que não estão no Google Cloud, como EKS, AKS e OpenShift, é necessário personalizar o
serviço do Kubernetes para trabalhar com o provedor de nuvem. Portanto, é melhor criar um serviço
personalizado do Kubernetes do que usar o serviço padrão, porque o Apigee não oferece suporte a todas
as personalizações do serviço padrão do Kubernetes.
Siga as etapas abaixo para configurar e rotear o tráfego para o novo gateway de entrada.
Crie um serviço do Kubernetes com os rótulos de seletor de pods necessários, app,
ingress_name e org. Esses rótulos já estão presentes nos pods de gateway de entrada da Apigee.
Crie um arquivo de serviço
usando o seguinte modelo:
SERVICE_NAME é um nome usado para identificar esse serviço. Por exemplo,
apigee-prod-1.
INGRESS_NAME é o nome do gateway de entrada da Apigee. Ele precisa corresponder ao nome
fornecido para ingressGateways.name no arquivo overrides.yaml. Para
mais informações, consulte
ingressGateways na
referência da propriedade de configuração.
ORG_NAME é o nome da organização da Apigee. Ele precisa corresponder ao nome
fornecido para org no arquivo overrides.yaml. Para
mais informações, consulte
org na
referência da propriedade de configuração.
LOAD_BALANCER_IP é o endereço IP do balanceador de carga.
Se você tiver um endereço IP reservado para o balanceador de carga, insira-o.
Se você ainda não tiver um endereço IP reservado, use o retornado pelo
serviço de entrada padrão da Apigee. Use o EXTERNAL-IP retornado pelo seguinte
comando:
kubectl get svc -n APIGEE_NAMESPACE -l app=apigee-ingressgateway
O gateway de entrada da Apigee expõe as seguintes portas:
Porta
Descrição
443
Tráfego do ambiente de execução.
15021
Verificação de integridade status-port expõe um endpoint /healthz/ready que pode ser usado com as verificações de integridade de entrada do GKE.
Crie o serviço aplicando SERVICE_FILENAME.yaml:
kubectl apply -f SERVICE_FILENAME.yaml
Encontre o IP externo do gateway de entrada da Apigee com o seguinte comando::
kubectl get svc -n APIGEE_NAMESPACESERVICE_NAME
A resposta será semelhante a esta:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
apigee-ingressgateway-prod-hybrid-37a39bd LoadBalancer 192.0.2.123 233.252.0.123 15021:32049/TCP,80:31624/TCP,443:30723/TCP 16h
Desative o balanceador de carga para o serviço de gateway de entrada padrão da Apigee:
INGRESS_IP_ADDRESS é o endereço IP de entrada, por exemplo, 233.252.0.123.
Se o comando estiver correto, ele retornará:
Apigee Ingress is healthy
Use esse endereço IP para atualizar o registro DNS (geralmente um registro A ou CNAME)
no seu registrador ou provedor de DNS.
Usar o serviço padrão do Kubernetes
Para ambientes que não estão em produção ou para testar o tráfego inicial pelo gateway de entrada da Apigee,
a Apigee híbrida oferece serviço padrão do Kubernetes para cada implantação de entrada.
É possível fazer alterações limitadas de configuração no serviço padrão no arquivo
overrides.yaml. Para ver as opções de configuração disponíveis, consulte Como gerenciar o gateway de entrada da Apigee. Por exemplo, é possível adicionar anotações.
Encontre o IP externo do serviço de entrada padrão da Apigee com o seguinte comando:
kubectl get svc -n APIGEE_NAMESPACE -l app=apigee-ingressgateway
A saída será semelhante a esta:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
apigee-ingressgateway-prod-hybrid-37a39bd LoadBalancer 192.0.2.123 233.252.0.123 15021:32049/TCP,80:31624/TCP,443:30723/TCP 16h
Teste o gateway fazendo uma chamada de verificação de integridade.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-18 UTC."],[[["\u003cp\u003eThis document explains the process of setting up a Kubernetes service for an Apigee ingress gateway, which is necessary to obtain an IP address that can be exposed for client calls to proxies.\u003c/p\u003e\n"],["\u003cp\u003eFor production environments, it is recommended to create a custom Kubernetes service for each ingress gateway because unlike the default service, it won't be automatically deleted upon cleanup, and it allows customizations that may be needed for specific cloud providers.\u003c/p\u003e\n"],["\u003cp\u003eTo create a custom service, a Kubernetes service file needs to be created using a provided template, ensuring it includes the necessary pod selector labels (\u003ccode\u003eapp\u003c/code\u003e, \u003ccode\u003eingress_name\u003c/code\u003e, and \u003ccode\u003eorg\u003c/code\u003e) that match those in the Apigee ingress gateway pods.\u003c/p\u003e\n"],["\u003cp\u003eThe default Kubernetes service is available for non-production environments or initial testing, but it has limited configuration options and will be deleted when the ingress deployment is removed.\u003c/p\u003e\n"],["\u003cp\u003eAfter creating the custom or using the default service, you need to test the ingress gateway and update your DNS record with the acquired external IP address, allowing traffic to be routed through the Apigee ingress.\u003c/p\u003e\n"]]],[],null,["# Step 1: Expose Apigee ingress gateway\n\n| You are currently viewing version 1.14 of the Apigee hybrid documentation. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\n\nThis step explains how to set up the Kubernetes service for your Apigee ingress gateway.\nThe Kubernetes service is needed for each ingress deployment to obtain an IP address that can be\nexposed. Client calls to proxies will invoke a hostname that will resolve to this IP address.\n\nOptions for Kubernetes services for your Apigee ingress gateway\n---------------------------------------------------------------\n\n\nThere are two options for providing a kubernetes service to assign the IP address ...\n\n- Create a [custom Kubernetes service](#customservice) for each Apigee ingress gateway (recommended).\n- Use the [default Kubernetes service](#defaultservice).\n\n### Create your own Kubernetes service\n\n\nFor production environments, Apigee recommends you create a custom Kubernetes service for each ingress\ngateway.\n\n- Apigee deletes default service, but does not delete the custom kubernetes service upon cleanup. Hence, the IP address won't be released upon reinstallation of Apigee hybrid.\n- For platforms not on Google Cloud, like EKS, AKS, and OpenShift, you need to customize the Kubernetes service to work with the cloud provider. Therefore it is better to create a custom Kubernetes service than to use the default service, because apigee does not support all customizations to the default Kubernetes service.\n\n\nUse the following steps to set up and route traffic to the new ingress gateway.\n\n1. Create a Kubernetes service with the required pod selector labels, `app`, `ingress_name`, and `org`. These labels are already present in Apigee ingress gateway pods.\n\n Create a service file\n using the following template: \n\n ```\n apiVersion: v1\n kind: Service\n metadata:\n name: SERVICE_NAME\n namespace: APIGEE_NAMESPACE\n spec:\n ports:\n - name: status-port\n port: 15021\n protocol: TCP\n targetPort: 15021\n - name: https\n port: 443\n protocol: TCP\n targetPort: 8443\n selector:\n app: apigee-ingressgateway #required\n ingress_name: INGRESS_NAME\n org: ORG_NAME\n type: LoadBalancer\n loadBalancerIP: LOAD_BALANCER_IP\n ```\n - \u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e is a name used to identify this service. For example, `apigee-prod-1`. **Note:** To more easily identify your services, use the ingress name as part of the service name.\n - \u003cvar translate=\"no\"\u003eINGRESS_NAME\u003c/var\u003e is the name of this Apigee ingress gateway. It must match the name you provided for `ingressGateways.name` in your `overrides.yaml` file. For more information see [`ingressGateways` in the\n Configuration properties reference](/apigee/docs/hybrid/v1.14/config-prop-ref#ingressgateways).\n - \u003cvar translate=\"no\"\u003eORG_NAME\u003c/var\u003e is the name of the Apigee organization. It must match the name you provided for `org` in your `overrides.yaml` file. For more information see [`org` in the\n Configuration properties reference](/apigee/docs/hybrid/v1.14/config-prop-ref#org).\n - \u003cvar translate=\"no\"\u003eLOAD_BALANCER_IP\u003c/var\u003e is the IP address for the load balancer.\n\n\n If you have an IP address reserved for your load balancer, enter that.\n\n\n If you do not have an IP address already reserved, you can use the one returned by the\n default Apigee ingress service. Use the `EXTERNAL-IP` returned by the following\n command: \n\n ```\n kubectl get svc -n APIGEE_NAMESPACE -l app=apigee-ingressgateway\n ```\n | **Caution:** Because of a [limitation](/load-balancing/docs/l7-internal#limitations) on Google Cloud internal Application Load Balancer, this Apigee routing option does not support HTTP 1.0 requests. Incoming client requests that specify the HTTP 1.0 protocol will fail. Later HTTP versions are supported.\n\n\n Apigee ingress gateway exposes the following ports:\n\n2. Create the service by applying the \u003cvar translate=\"no\"\u003eSERVICE_FILENAME\u003c/var\u003e`.yaml`: \n\n ```\n kubectl apply -f SERVICE_FILENAME.yaml\n ```\n3. Find the external IP of Apigee ingress gateway with the following command: \n\n ```\n kubectl get svc -n APIGEE_NAMESPACE SERVICE_NAME\n ```\n\n\n Your output should look something like: \n\n ```\n NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE\n apigee-ingressgateway-prod-hybrid-37a39bd LoadBalancer 192.0.2.123 233.252.0.123 15021:32049/TCP,80:31624/TCP,443:30723/TCP 16h\n ```\n4. Disable the loadbalancer for the default Apigee ingress gateway service:\n 1. Update the [`ingressGateways[].svcType`](/apigee/docs/hybrid/v1.14/config-prop-ref#ingressgateways-svctype) property to `ClusterIP` in your overrides file: \n\n ```\n ingressGateways:\n svcType: ClusterIP\n ```\n 2. Upgrade the `apigee-org` chart to apply the changes: \n\n ```\n helm upgrade ORG_NAME apigee-org/ \\\n --install \\\n --namespace apigee \\\n --atomic \\\n -f overrides.yaml\n ```\n\n See [Disable the loadbalancer for the default\n Apigee ingress gateway service](/apigee/docs/hybrid/v1.14/managing-ingress#disable-loadbalancer) for more information.\n5. Test the ingress gateway by making a healthcheck call.\n\n ```\n curl -H 'User-Agent: GoogleHC' https://DOMAIN/healthz/ingress -k \\\n --resolve \"DOMAIN:443:INGRESS_IP_ADDRESS\"\n ```\n\n Where\n - \u003cvar translate=\"no\"\u003eDOMAIN\u003c/var\u003e is the domain you provided as the hostname for the environment group you created in [Project and org setup - Step 3: Create an\n environment group](/apigee/docs/hybrid/v1.14/precog-add-environment).\n - \u003cvar translate=\"no\"\u003eINGRESS_IP_ADDRESS\u003c/var\u003e is the ingress IP address, for example `233.252.0.123`.\n\n\n On success the command returns: \n\n ```\n Apigee Ingress is healthy\n ```\n6. Use this IP address to update your DNS record (usually an `A` or `CNAME` record) at your registrar or DNS provider.\n\n### Use the default Kubernetes service\n\n\nFor non-production environments or to test initial traffic through the Apigee ingress gateway,\nApigee hybrid provides default Kubernetes service for each ingress deployment.\n\n\nYou can make limited configuration changes to the default service in your `overrides.yaml`\nfile. For the available configuration options, see [Managing\nApigee ingress gateway](/apigee/docs/hybrid/v1.14/managing-ingress). For example, you can add annotations.\n\n| **Note:** This service will be deleted when the ingress deployment is deleted (when the ingress gateway is removed from the overrides file).\n\n\nFor production environments, it is recommended you provide a Kubernetes service for ingress.\nFollow the steps in [Create your own Kubernetes service](#customservice).\n\n1. Find the external IP of the default Apigee ingress service with the following command: \n\n ```\n kubectl get svc -n APIGEE_NAMESPACE -l app=apigee-ingressgateway\n ```\n\n\n Your output should look something like: \n\n ```\n NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE\n apigee-ingressgateway-prod-hybrid-37a39bd LoadBalancer 192.0.2.123 233.252.0.123 15021:32049/TCP,80:31624/TCP,443:30723/TCP 16h\n ```\n2. Test the ingress gateway by making a healthcheck call.\n\n ```\n curl -H 'User-Agent: GoogleHC' https://DOMAIN/healthz/ingress -k \\\n --resolve \"DOMAIN:443:INGRESS_IP_ADDRESS\"\n ```\n\n Where\n - \u003cvar translate=\"no\"\u003eDOMAIN\u003c/var\u003e is the domain you provided as the hostname for the environment group you created in [Project and org setup - Step 3: Create an\n environment group](/apigee/docs/hybrid/v1.14/precog-add-environment).\n - \u003cvar translate=\"no\"\u003eINGRESS_IP_ADDRESS\u003c/var\u003e is the ingress IP address, for example `233.252.0.123`.\n\n\n On success the command returns: \n\n ```\n Apigee Ingress is healthy\n ```\n3. Use this IP address to update your DNS record (usually an `A` or `CNAME` record) at your registrar or DNS provider.\n\n| **Congratulations!**\n|\n| You've successfully set up the Apigee ingress gateway. Now it's time to download a proxy and test\n| your ingress gateway.\n\nNext step\n---------\n\n\u003cbr /\u003e\n\n[1](/apigee/docs/hybrid/v1.14/install-expose-apigee-ingress) [(NEXT) Step 2: Deploy a proxy](/apigee/docs/hybrid/v1.14/install-deploy-proxy)\n\n\u003cbr /\u003e"]]