一个伪linux粉丝的blog

  1. 首页
  2. network
  3. 正文

change container time

11月 17, 2020 397点热度 0人点赞 0条评论

某客户程序调试需要,希望将容器系统时间固定为某个日期 ,如 2020-09-16

我这边做了复现,默认是无法修改时间的,会提示

/ # date -s 2010-10-19
date: can't set date: Operation not permitted

经过查找资料,为 Container 设置权能才行  https://kubernetes.io/zh/docs/tasks/configure-pod-container/security-context/#set-capabilities-for-a-container

可以单独开设一些权限给容器,因此,需要修改depolyment,添加如下2个参数

securityContext:
capabilities:
add:

  • NET_ADMIN
  • SYS_TIME

添加后,重新部署的容器就可以修改时间了

/ # date -s 2020-09-16
Wed Sep 16 00:00:00 UTC 2020

相关文章:

  1. k8s-set-capabilities-for-a-container
  2. Cisco: Internet to change forever
  3. Openldap normal user change password by using Phpldapadmin
  4. how to change jira survey and mobile app links from notification email
标签: SYS_TIME
最后更新:11月 17, 2020

wanjie

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据。

归档
分类
  • network / 324篇
  • Uncategorized / 116篇
  • unix/linux / 114篇
  • 业界资讯 / 38篇
  • 公司杂事 / 11篇
  • 数码影像 / 12篇
  • 美剧 / 3篇
  • 美图共赏 / 20篇
  • 英语学习 / 3篇
标签聚合
wget 中国电信 iMac 虚拟主机 brew 刷机 网通 VPS Opera Mini Ubuntu nexus k8s ldap Google Google Adwords 邮件归档 gitlab Android Google Voice 泰国 kernel dreamhost 网站运营 Linux debian docker Nginx d90 dreamhost空间 jira

COPYRIGHT © 2008-2022 wanjie.info. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang