-
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.NoteIf 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.