我想在AWS-EKS 中实现类似于下面的功能
在我的kubeadm k8s集群中,如果我必须从pod收集应用程序日志,我将运行以下命令
kubectl cp podName:/path/to/application/logs/logFile.log /location/on/master/
但对于AWS,我不确定如何收集上述日志?
- 一个解决方法是用PV和PVC在S3上保存日志,然后从那里获取它们
volumeMounts:
- name: logs-sharing
mountPath: /opt/myapp/AppServer/logs/container
volumes:
- name: logs-sharing
persistentVolumeClaim:
claimName: logs-sharing-pvc
- 其他方法是将sidecar容器与日志代理一起使用
但如果有任何变通方法,就像我上面提到的kubeadm 一样简单,我将不胜感激
...as easy as the one I mentioned above that I follow with kubeadm
kubectl cp
是一个标准的k8s命令,您可以将其用于EKS、AKS、GKE等