一个伪linux粉丝的blog

  1. 首页
  2. network
  3. 正文

change container time

17 11 月, 2020 776点热度 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
最后更新:17 11 月, 2020

wanjie

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

点赞
< 上一篇
下一篇 >

文章评论

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

归档
分类
  • network / 332篇
  • Uncategorized / 116篇
  • unix/linux / 122篇
  • 业界资讯 / 38篇
  • 公司杂事 / 11篇
  • 数码影像 / 12篇
  • 美剧 / 3篇
  • 美图共赏 / 21篇
  • 英语学习 / 3篇
标签聚合
泰国 VPS postgres Nginx 职责 squid Google Voice gitlab 网通 d90 网站运营 dreamhost 刷机 deepseek Linux Ubuntu 邮件归档 Google brew docker 虚拟主机 kernel ldap nexus 天翼live k8s unveiled today dreamhost空间 iMac webhook

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

Theme Kratos Made By Seaton Jiang