修改deploy, 增加如下:
1 2 3 4 |
securityContext: capabilities: add: - SYS_TIME |
截取部分deploy yaml配置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
containers: - args: - /start.sh envFrom: - configMapRef: name: res-pool-manager-env image: xxxxxxx imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 6 initialDelaySeconds: 61 periodSeconds: 6 successThreshold: 1 tcpSocket: port: 19881 timeoutSeconds: 6 name: res-pool-manager ports: - containerPort: 19881 name: port0 protocol: TCP resources: limits: cpu: "1" memory: 512Mi requests: cpu: 200m memory: 256Mi securityContext: capabilities: add: - SYS_TIME |
然后登录容器执行date -s “20200515 13:58:00” 即可更改时间
0 Comments