0
0
Kubernetesdevops~10 mins

Centralized logging (EFK stack) in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the container image for Elasticsearch in the Kubernetes manifest.

Kubernetes
containers:
  - name: elasticsearch
    image: [1]
Drag options to blanks, or click blank then click option'
Amysql:5.7
Bnginx:latest
Credis:6.2
Delasticsearch:7.17.0
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated container images like nginx or mysql.
2fill in blank
medium

Complete the code to set the Elasticsearch service type to expose it internally in the cluster.

Kubernetes
apiVersion: v1
kind: Service
metadata:
  name: elasticsearch
spec:
  type: [1]
  ports:
    - port: 9200
  selector:
    app: elasticsearch
Drag options to blanks, or click blank then click option'
AClusterIP
BLoadBalancer
CNodePort
DExternalName
Attempts:
3 left
💡 Hint
Common Mistakes
Using LoadBalancer or NodePort which expose services outside the cluster unnecessarily.
3fill in blank
hard

Fix the error in the Fluentd ConfigMap to correctly specify the Elasticsearch host.

Kubernetes
apiVersion: v1
kind: ConfigMap
metadata:
  name: fluentd-config
data:
  fluent.conf: |
    <match **>
      @type elasticsearch
      host [1]
      port 9200
    </match>
Drag options to blanks, or click blank then click option'
A127.0.0.1
Belasticsearch.default.svc.cluster.local
Cfluentd
Dlocalhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using localhost or IP addresses which do not resolve to Elasticsearch service inside the cluster.
4fill in blank
hard

Fill both blanks to create a Kubernetes Deployment for Kibana with the correct container image and port.

Kubernetes
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]
Drag options to blanks, or click blank then click option'
Akibana:7.17.0
B9200
C5601
Delasticsearch:7.17.0
Attempts:
3 left
💡 Hint
Common Mistakes
Using Elasticsearch image or port 9200 for Kibana.
5fill in blank
hard

Fill all three blanks to define a Fluentd DaemonSet with the correct container image, volume mount path, and log path.

Kubernetes
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]
Drag options to blanks, or click blank then click option'
Afluent/fluentd:v1.14.2
B/var/log
Dfluentd:latest
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect image names or mismatched volume mount and host paths.