配置自定义NTP服务器地址
操作场景
在创建Pod、Deployment或者修改Deployment时,支持通过Annotations(system.cci.io/ntp-server)来指定NTP服务器地址,使得Pod能与指定的NTP服务器进行时间同步。
使用说明
在Annotations中增加NTP服务器配置(system.cci.io/ntp-server: ntp.customization.com)来指定自定义的NTP服务器地址。如果没有指定NTP服务器配置,Pod将使用系统默认的NTP服务器进行时间同步。
约束与限制
- 系统默认使用华为云NTP服务器(ntp.myhuaweicloud.com)进行时间同步, 用户无需手动配置。
- 若手动设置NTP服务器地址,须确保指定的NTP服务器在集群网络中可访问且稳定。
免责声明
时间同步对业务系统的稳定性和安全性至关重要,错误或不稳定的时间源可能导致:
- 应用日志时间错乱,影响排障与审计。
- TLS/SSL 证书验证失败。
- 分布式系统内出现数据不一致或任务调度异常。
- 数据库事务、缓存过期、消息队列等依赖时间的组件运行异常。
建议优先使用默认NTP服务器地址。若您选择自定义NTP服务器,请确保其来源可信、稳定并具备安全保障。因使用自定义的NTP Server所引发的任何问题(包括但不限于服务不可用、数据丢失、业务中断或安全风险),均需由用户自行负责。云服务不对使用自定义NTP Server所产生的故障或损失承担任何责任。
通过ccictl创建pod
```yaml
kind: Deployment
apiVersion: cci/v2
metadata:
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
annotations:
system.cci.io/ntp-server: ntp.customization.com # 自定义NTP服务器地址
spec:
containers:
- name: nginx
image: nginx:latest
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 500m
memory: 1Gi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: Default
securityContext: {}
schedulerName: default-scheduler
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
progressDeadlineSeconds: 600
```