Complete the code to specify the container image for Elasticsearch in the Kubernetes manifest.
containers:
- name: elasticsearch
image: [1]The Elasticsearch container image must be specified correctly to deploy Elasticsearch as part of the EFK stack.
Complete the code to set the Elasticsearch service type to expose it internally in the cluster.
apiVersion: v1 kind: Service metadata: name: elasticsearch spec: type: [1] ports: - port: 9200 selector: app: elasticsearch
ClusterIP exposes the service only inside the cluster, which is typical for Elasticsearch in EFK stack.
Fix the error in the Fluentd ConfigMap to correctly specify the Elasticsearch host.
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-config
data:
fluent.conf: |
<match **>
@type elasticsearch
host [1]
port 9200
</match>The host must be the full DNS name of the Elasticsearch service inside the Kubernetes cluster for Fluentd to send logs correctly.
Fill both blanks to create a Kubernetes Deployment for Kibana with the correct container image and port.
apiVersion: apps/v1 kind: Deployment metadata: name: kibana spec: replicas: 1 selector: matchLabels: app: kibana template: metadata: labels: app: kibana spec: containers: - name: kibana image: [1] ports: - containerPort: [2]
Kibana uses its own image and listens on port 5601 by default.
Fill all three blanks to define a Fluentd DaemonSet with the correct container image, volume mount path, and log path.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluentd
spec:
selector:
matchLabels:
name: fluentd
template:
metadata:
labels:
name: fluentd
spec:
containers:
- name: fluentd
image: [1]
volumeMounts:
- name: varlog
mountPath: [2]
volumes:
- name: varlog
hostPath:
path: [3]The Fluentd container image must be correct, and the volume mount path inside the container and the host path must both be /var/log to collect logs properly.