Pivotal Container Service v1.2

Creating Sink Resources

This topic describes how to create a sink resource for a namespace within a Kubernetes cluster provisioned using Pivotal Container Service (PKS).

Sink resources enable PKS users to configure destinations for logs transported following the Syslog Protocol defined in RFC 5424.


Before you can create a sink resource for a namespace within a PKS-provisioned Kubernetes cluster, you must ensure that the Enable Sink Resources checkbox is selected in the PKS tile. Selecting this checkbox enables namespaces to send logs to sinks.

For more information, see the Logging section of the PKS installation topic for your IaaS:

Note: The commands in this topic require that you install the Kubernetes Command Line Interface (CLI), kubectl. For installation instructions, see Installing the Kubernetes CLI.

Define Sink Resources

A namespace sink filters logs by namespace within a cluster. Before you can create a namespace sink, you must define your sink resource.

To define a Sink resource, create a YAML file that specifies your log destination in the following format:

kind: Sink
  name: YOUR-SINK
  namespace: YOUR-NAMESPACE
  type: syslog
  enable_tls: true


  • YOUR-SINK is a name you choose for your sink.
  • YOUR-NAMESPACE is the name of your namespace.
  • YOUR-LOG-DESTINATION is the URL of your log management service.
  • YOUR-LOG-DESTINATION-PORT is the port number of your log management service.

Create Sink Resources

To create the Sink resource that you defined in the previous step, run the kubectl apply -f MY-SINK.yml command, where MY-SINK.yml is the name of your YAML file.

For example:

$ kubectl apply -f example-sink.yml

Manage Sinks

To list and delete sinks, use the following commands:

  • kubectl get sinks. List the sink resources deployed to a namespace.

  • kubectl delete sink YOUR-SINK. Delete a sink, where YOUR-SINK is the name of your sink.

Please send any feedback you have to

Create a pull request or raise an issue on the source for this page in GitHub