Pi Docs
  • Overview
  • What is Pi
  • How It Works
  • Benefits
  • Features
  • Pricing
  • Quota and Limits
  • FAQ
  • Quickstart
    • Install CLI
    • Launch Your First Pod
    • Understand the network
    • Use Volume for Stateful Workload
    • Use Private Image
  • Feature
    • Pod
    • Rootfs
    • Job
    • Volume
    • Floating IP
    • Network
    • Service
    • Secret
    • Region and Zone
  • Reference
    • CLI
      • Info
      • Pod
        • run
        • create
        • delete
        • exec
        • logs
        • get
        • describe
      • Job
        • create
        • delete
        • get
        • describe
      • Service
        • create
        • get
        • describe
        • delete
      • Secret
        • create
        • get
        • describe
        • delete
      • Volume
        • create
        • get
        • delete
      • Floating IP
        • create
        • get
        • name
        • delete
    • API/v1.9
      • Info
        • Get
      • Event
        • Get
      • Pod
        • Create
        • List
        • Read
        • Log
        • Exec
        • Delete
      • Job
        • Create
        • List
        • Read
        • Delete
      • Service
        • Create
        • List
        • Get
        • Delete
      • Secret
        • Create
        • List
        • Get
        • Delete
      • Volume
        • Create
        • List
        • Get
        • Delete
      • Floating IP
        • Create
        • List
        • Get
        • Name
        • Delete
  • FAQ
    • Privacy Policy
    • Terms of Service
    • Acceptable Use Policy
  • Docs version
Powered by GitBook
On this page
  • Lifecycle
  • Associate Floating IP with Service
  • Billing
  1. Feature

Floating IP

PreviousVolumeNextNetwork

Last updated 7 years ago

A floating IP (aka FIP), is a public accessible IPv4 address. It is used with to enable public access to the associated pods. You cannot attach multiple floating IPs to a service, but you can associate multiple services with one single floating IP (as long as no port flicts among different services).

If you allocate a floating IP address but do not use it, you will be . If you use it (with Service), you will not be charged for it.

Lifecycle

You need to explicitly allocate and release floating IPs:

$ pi create fip
fip/104.197.12.87

$ pi delete fip 104.197.12.87
fip "104.197.12.87" deleted

You cannot release an FIP while it is in use.

Associate Floating IP with Service

Create a new service using an existing floating IP:

$ pi create fip
fip/104.154.140.179

$ cat <<EOF > /tmp/httpLB.yml
apiVersion: v1
kind: Service
metadata:
  name: http-lb
spec:
  type: LoadBalancer
  loadBalancerIP: 104.154.140.179
  selector:
    app: http
  ports:
    - port: 80
      targetPort: 8080
EOF
$ pi create -f /tmp/httpLB.yml
service/http-lb

You can also associate multiple service to one floating IP, with different ports:

$ cat <<EOF > /tmp/httpsLB.yml
apiVersion: v1
kind: Service
metadata:
  name: https-lb
spec:
  type: LoadBalancer
  loadBalancerIP: 104.154.140.179
  selector:
    app: https
  ports:
    - port: 443
      targetPort: 4433
EOF
$ pi create -f /tmp/httpsLB.yml
service/https-lb

Billing

If you allocate a floating IP address but do not use it, you will be charged with an hourly rate ($0.01/hour). If you use it (with Service), you will not be charged for it.

Service
charged for the IP address