k8s容器看日志中文亂碼、時區問題、host問題


一般這樣都是默認編碼不支持當前字符的問題
修改環境變量后,在查看

LANG=C.utf8

查看修改時區

date +"%Z %z"
-Duser.timezone=GMT+08  //java特有
/etc/localtime //通用
/etc/timezone //debian

添加host

apiVersion: v1
kind: Pod
metadata:
  name: hostaliases-pod
spec:
  restartPolicy: Never
  hostAliases:
  - ip: "127.0.0.1"
    hostnames:
    - "foo.local"
    - "bar.local"
  - ip: "1.1.1.1"
    hostnames:
    - "foo.remote"
  containers:
  - name: cat-hosts
    image: 'registry.cn-hangzhou.aliyuncs.com/bigteam/filebeat:v5'
    command:
    - cat
    args:
    - "/etc/hosts"


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM