LATEST VERSION: v1.2 - RELEASE NOTES
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.

Prerequisites

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:

apiVersion: apps.pivotal.io/v1beta1
kind: Sink
metadata:
  name: YOUR-SINK
  namespace: YOUR-NAMESPACE
spec:
  type: syslog
  host: YOUR-LOG-DESTINATION
  port: YOUR-LOG-DESTINATION-PORT
  enable_tls: true

Where:

  • 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 pks-feedback@pivotal.io.

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