Skip to content

Latest commit

 

History

History
48 lines (46 loc) · 1.09 KB

monitoring-logging.md

File metadata and controls

48 lines (46 loc) · 1.09 KB

monitoring and logging

  • solutions
    • prometheus
    • metrics-server
      • to get memory consumtion per node
        kubectl top node
        
  • logging
    • to see logs from pod live with one container
      kubectl logs -f <pod-name>
      
    • to see logs from pod live with more than one container
      kubectl logs -f <pod-name> <container-name>
      
    • shared volume for multiple containers in a pod (elastic-search)
      apiVersion: v1
      kind: Pod
      metadata:
        name: app
        namespace: elastic-stack
        labels:
          name: app
      spec:
        containers:
        - name: app
          image: kodekloud/event-simulator
          volumeMounts:
          - mountPath: /log
            name: log-volume
      
        - name: sidecar
          image: kodekloud/filebeat-configured
          volumeMounts:
          - mountPath: /var/log/event-simulator/
            name: log-volume
      
        volumes:
        - name: log-volume
          hostPath:
            # directory location on host
            path: /var/log/webapp
            # this field is optional
            type: DirectoryOrCreate