In diesem Schritt wird erläutert, wie Sie den Kubernetes-Dienst für Ihr Apigee-Ingress-Gateway einrichten.
Der Kubernetes-Dienst wird für jede Ingress-Bereitstellung benötigt, um eine IP-Adresse zu erhalten, die freigegeben werden kann. Clientaufrufe an Proxys rufen einen Hostnamen auf, der in diese IP-Adresse aufgelöst wird.
Optionen für Kubernetes-Dienste für Ihr Apigee-Ingress-Gateway
Es gibt zwei Möglichkeiten, einen Kubernetes-Dienst bereitzustellen, um die IP-Adresse zuzuweisen:
In Produktionsumgebungen empfiehlt Apigee, dass Sie für jedes Ingress-Gateway einen benutzerdefinierten Kubernetes-Dienst erstellen.
Apigee löscht den Standarddienst, aber nicht den benutzerdefinierten Kubernetes-Dienst bei der Bereinigung.
Daher wird die IP-Adresse bei der Neuinstallation von Apigee Hybrid nicht freigegeben.
Für Plattformen außerhalb von Google Cloud, z. B. EKS, AKS und OpenShift, müssen Sie den Kubernetes-Dienst für die Zusammenarbeit mit dem Cloud-Anbieter anpassen. Daher ist es besser, einen benutzerdefinierten Kubernetes-Dienst zu erstellen, als den Standarddienst zu verwenden, da Apigee nicht alle Anpassungen des Kubernetes-Standarddienstes unterstützt.
Führen Sie die folgenden Schritte aus, um Traffic einzurichten und an das neue Ingress-Gateway weiterzuleiten.
Erstellen Sie einen Kubernetes-Dienst mit den erforderlichen Pod-Selektorlabels: app, ingress_name und org. Diese Labels sind bereits in Apigee-Ingress-Gateway-Pods vorhanden.
Erstellen Sie eine Dienstdatei mit folgender Vorlage:
SERVICE_NAME ist der Name zur Identifizierung dieses Dienstes. Beispiel: apigee-prod-1.
INGRESS_NAME ist der Name dieses Apigee Ingress-Gateways. Er muss mit dem Namen übereinstimmen, den Sie in ingressGateways.name in Ihrer Datei overrides.yaml angegeben haben. Weitere Informationen finden Sie in der Referenz zu Konfigurationsattributen unter ingressGateways.
ORG_NAME ist der Name der Apigee-Organisation. Er muss mit dem Namen übereinstimmen, den Sie in org in Ihrer Datei overrides.yaml angegeben haben. Weitere Informationen finden Sie in der Referenz zu Konfigurationsattributen unter org.
LOAD_BALANCER_IP ist die IP-Adresse für den Load-Balancer:
Wenn Sie eine IP-Adresse für den Load-Balancer reserviert haben, geben Sie diese ein.
Wenn Sie noch keine IP-Adresse reserviert haben, können Sie die vom standardmäßigen Apigee-Dienst für eingehenden Traffic verwendete IP-Adresse verwenden. Verwenden Sie die EXTERNAL-IP, die vom folgenden Befehl zurückgegeben wird:
kubectl get svc -n apigee -l app=apigee-ingressgateway
Das Apigee Ingress-Gateway stellt die folgenden Ports zur Verfügung:
Port
Beschreibung
443
Laufzeittraffic.
15021
Systemdiagnose. status-port stellt einen /healthz/ready-Endpunkt bereit, der mit GKE-Systemdiagnosen für eingehenden Traffic verwendet werden kann.
Erstellen Sie den Dienst, indem Sie SERVICE_FILENAME.yaml anwenden:
kubectl apply -f SERVICE_FILENAME.yaml
Suchen Sie mit dem folgenden Befehl die externe IP-Adresse des Apigee Ingress-Gateways:
kubectl get svc -n apigee SERVICE_NAME
Die Ausgabe sollte in etwa so aussehen:
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
Deaktivieren Sie den Load-Balancer für den Standard-Apigee-Ingress-Gateway-Dienst:
INGRESS_IP_ADDRESS ist die IP-Adresse für eingehenden Traffic, z. B. 233.252.0.123.
Bei Erfolg gibt der Befehl Folgendes zurück:
Apigee Ingress is healthy
Verwenden Sie diese IP-Adresse, um den DNS-Eintrag (normalerweise ein A- oder CNAME-Eintrag) bei Ihrem Registrator oder DNS-Anbieter zu aktualisieren.
Kubernetes-Standarddienst verwenden
Für Nicht-Produktionsumgebungen oder zum Testen des anfänglichen Traffics über das Apigee-Ingress-Gateway bietet Apigee Hybrid einen standardmäßigen Kubernetes-Ingress-Dienst für jede Ingress-Bereitstellung.
Sie können eingeschränkte Konfigurationsänderungen am Standarddienst in der Datei overrides.yaml vornehmen. Informationen zu den verfügbaren Konfigurationsoptionen finden Sie unter Apigee-Ingress-Gateway verwalten. Sie können beispielsweise Annotationen hinzufügen.
Für Produktionsumgebungen wird empfohlen, einen Kubernetes-Dienst für eingehenden Traffic bereitzustellen.
Führen Sie die Schritte unter Eigenen Kubernetes-Dienst erstellen aus.
Suchen Sie mit dem folgenden Befehl die externe IP-Adresse des Ingress-Standarddienstes von Apigee:
kubectl get svc -n apigee -l app=apigee-ingressgateway
Die Ausgabe sollte in etwa so aussehen:
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
Testen Sie das Ingress-Gateway mit einem Systemdiagnoseaufruf.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-28 (UTC)."],[[["\u003cp\u003eThis document guides users through setting up a Kubernetes service for the Apigee ingress gateway, which is essential for obtaining an IP address that can be exposed for client calls to proxies.\u003c/p\u003e\n"],["\u003cp\u003eApigee recommends creating a custom Kubernetes service for each ingress gateway in production environments because it provides more control and is not deleted during cleanup or reinstallation, unlike the default service.\u003c/p\u003e\n"],["\u003cp\u003eCreating a custom Kubernetes service involves defining a service file with specific pod selector labels (\u003ccode\u003eapp\u003c/code\u003e, \u003ccode\u003eingress_name\u003c/code\u003e, and \u003ccode\u003eorg\u003c/code\u003e) and applying it using \u003ccode\u003ekubectl\u003c/code\u003e, making sure that necessary ports (443 and 15021) are properly configured.\u003c/p\u003e\n"],["\u003cp\u003eFor testing or non-production use, the default Apigee ingress service can be used, but it has limited customization options and will be deleted when the ingress deployment is removed.\u003c/p\u003e\n"],["\u003cp\u003eAfter creating the service, the external IP address must be retrieved using a \u003ccode\u003ekubectl get svc\u003c/code\u003e command and then used to update the DNS record to route traffic to the Apigee ingress gateway, as well as testing via a health check curl command.\u003c/p\u003e\n"]]],[],null,["# Step 9: Expose Apigee ingress gateway\n\n| You are currently viewing version 1.9 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. 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, as 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\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.9/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.9/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 -l app=apigee-ingressgateway\n ```\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 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. Optionally, disable the loadbalancer for the default Apigee ingress gateway service:\n 1. Set the [`ingressGateways[].svcType`](/apigee/docs/hybrid/v1.9/config-prop-ref#ingressgateways-svctype) property to `ClusterIP` in your overrides file to avoid creation of default load balancer. \n\n ```\n ingressGateways:\n svcType: ClusterIP\n ```\n 2. Apply the changes by running `apigeectl apply -f overrides.yaml --org`. \n\n ```\n ${APIGEECTL_HOME}/apigeectl apply --org -f ${HYBRID_FILES}/overrides/overrides.yaml\n ```\n\n See [Disable the loadbalancer for the default\n Apigee ingress gateway service](/apigee/docs/hybrid/v1.9/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.9/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.9/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 -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.9/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[1](/apigee/docs/hybrid/v1.9/install-create-cluster) [2](/apigee/docs/hybrid/v1.9/install-cert-manager) [3](/apigee/docs/hybrid/v1.9/install-apigeectl) [4](/apigee/docs/hybrid/v1.9/install-service-accounts) [5](/apigee/docs/hybrid/v1.9/install-create-tls-certificates) [6](/apigee/docs/hybrid/v1.9/install-configure-cluster) [7](/apigee/docs/hybrid/v1.9/install-enable-synchronizer-access) [8](/apigee/docs/hybrid/v1.9/install-hybrid-runtime) [9](/apigee/docs/hybrid/v1.9/install-expose-apigee-ingress) [(NEXT) Step 10: Deploy a proxy](/apigee/docs/hybrid/v1.9/install-deploy-proxy)\n\n\u003cbr /\u003e"]]