> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/~/revisions/AMiYziCllTKB2y2lmONY/containers/managed-kubernetes/use-cases/create-ip-address.md).

# Create an IP Address for Kubernetes Cluster Using Load Balancer

You can use the Load Balancer to provide a stable and reliable IP address for your Kubernetes cluster. It will expose your application, such as Nginx deployment, to the internet. This IP address should remain stable as long as the service exists.

## Example

Define `type` as `LoadBalancer` to create a service of type Load Balancer. When this service is created, most cloud providers will automatically provision a Load Balancer with a stable external IP address. Configure the `ports` that the service will listen on and forward the traffic to. Define the `selector` field to set the Pods to which the traffic will be forwarded.

```yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    run: nginx
  name: nginx
spec:
  ports:
    - port: 80
      targetPort: 80
  selector:
    run: nginx
  type: LoadBalancer
  loadBalancerIP: CRIP-IP
```

{% hint style="info" %}
**Note**:

* Ensure that your Cloud provider supports the automatic creation of external Load Balancers for Kubernetes services.
* You need at least two remaining free CRIPs for regular maintenance.
* You need to replace the `Nginx` related labels and selectors with those relevant to your application.
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/~/revisions/AMiYziCllTKB2y2lmONY/containers/managed-kubernetes/use-cases/create-ip-address.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
