Skip to content

Latest commit

 

History

History
56 lines (52 loc) · 1.29 KB

File metadata and controls

56 lines (52 loc) · 1.29 KB
  1. Create a Kubernetes service that points to your external PostgreSQL database:

    apiVersion: v1
    kind: Service
    metadata:
      name: external-postgresql-service
    spec:
      type: ExternalName
      externalName: <your-external-db-host-name>
      ports:
        - port: 5432
          targetPort: 5432
          protocol: TCP

    Where:

    external-postgresql-service

    Name of the service to reference in plugin configurations.

    ExternalName

    Service type that creates a CNAME record to the external database host name.

    <your-external-db-host-name>

    FQDN of your external PostgreSQL server, for example, postgres.example.com.

    Note

    If your external database is outside the cluster or uses an IP address instead of a host name, create a service with endpoints:

    apiVersion: v1
    kind: Service
    metadata:
      name: external-postgresql-service
    spec:
      ports:
        - port: 5432
          targetPort: 5432
          protocol: TCP
    ---
    apiVersion: v1
    kind: Endpoints
    metadata:
      name: external-postgresql-service
    subsets:
      - addresses:
          - ip: <your-external-db-ip>
        ports:
          - port: 5432
            protocol: TCP

    Where:

    <your-external-db-ip>

    IP address of your external PostgreSQL server.