148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}

marco.cirilli
from marco.cirilli More from this publisher
19.06.2021 Views

Chapter 14 ■ Configuring LoggingFigure 14-20. Creating and listing pod for fluentdStarting KibanaNext, we shall start Kibana to view the logs. Create an RC definition file kibana-rc.yaml and copy thefollowing listing to the file. The container image for Kibana is gcr.io/google_containers/kibana:1.3.The URL for Elasticsearch also needs to be specified.---apiVersion: v1kind: ReplicationControllermetadata:labels:k8s-app: kibana-loggingkubernetes.io/cluster-service: "true"version: v1name: kibana-logging-v1namespace: kube-systemspec:replicas: 1selector:k8s-app: kibana-loggingversion: v1324

Chapter 14 ■ Configuring Loggingtemplate:metadata:labels:k8s-app: kibana-loggingkubernetes.io/cluster-service: "true"version: v1spec:containers:-env:-name: ELASTICSEARCH_URLvalue: "http://10.2.15.2:9200"image: "gcr.io/google_containers/kibana:1.3"name: kibana-loggingports:-containerPort: 5601name: uiprotocol: TCPresources:limits:cpu: "0.1"requests:cpu: "0.1"The RC definition file is shown in the vi editor in Figure 14-21.325

Chapter 14 ■ Configuring Logging

Figure 14-20. Creating and listing pod for fluentd

Starting Kibana

Next, we shall start Kibana to view the logs. Create an RC definition file kibana-rc.yaml and copy the

following listing to the file. The container image for Kibana is gcr.io/google_containers/kibana:1.3.

The URL for Elasticsearch also needs to be specified.

---

apiVersion: v1

kind: ReplicationController

metadata:

labels:

k8s-app: kibana-logging

kubernetes.io/cluster-service: "true"

version: v1

name: kibana-logging-v1

namespace: kube-system

spec:

replicas: 1

selector:

k8s-app: kibana-logging

version: v1

324

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!