第 1 章 使用 MicroShift 配置文件
通过一个 YAML 文件,可根据您的偏好、设置和参数自定义 MicroShift 实例。
注意
如果要使用 kustomize
清单以外的工具通过 MicroShift API 进行配置更改或部署应用程序,您必须等待 greenboot 健康检查完成。这可确保,如果 greenboot 将 rpm-ostree
系统回滚回较早的状态,您的更改不会丢失。
1.1. MicroShift YAML 配置文件
启动时,MicroShift 会检查系统范围的 /etc/microshift/
目录,以获取名为 config.yaml
的配置文件。如果目录中不存在配置文件,则使用内置默认值来启动服务。
MicroShift 配置文件必须与 host 和, sometimes, 应用程序和服务设置结合使用。在自定义 MicroShift 集群时,确保每个项目都以 tandem 配置。
1.1.1. 默认设置
如果您没有创建 config.yaml
文件或使用配置片断 YAML 文件,则会使用默认值。以下示例显示了默认配置设置。
要查看默认值,请运行以下命令:
microshift show-config
$ microshift show-config
Copy to Clipboard Copied! YAML 格式输出的默认值
apiServer: advertiseAddress: 10.44.0.0/32 auditLog: maxFileAge: 0 maxFileSize: 200 maxFiles: 10 profile: Default namedCertificates: - certPath: "" keyPath: "" names: - "" subjectAltNames: [] tls: cipherSuites: - "" minVersion: VersionTLS12 debugging: logLevel: "Normal" dns: baseDomain: microshift.example.com etcd: memoryLimitMB: 0 ingress: certificateSecret: router-certs-default clientTLS: allowedSubjectPatterns: clientCA: name: "" clientCertificatePolicy: "" defaultHTTPVersion: 1 forwardedHeaderPolicy: "" httpCompression: mimeTypes: - "" httpEmptyRequestsPolicy: Respond listenAddress: - "" logEmptyRequests: Log ports: http: 80 https: 443 routeAdmissionPolicy: namespaceOwnership: InterNamespaceAllowed wildcardPolicy: WildcardPolicyAllowed status: Managed tlsSecurityProfile: type: Custom custom: ciphers: - ECDHE-ECDSA-CHACHA20-POLY1305 - ECDHE-RSA-CHACHA20-POLY1305 - ECDHE-RSA-AES128-GCM-SHA256 - ECDHE-ECDSA-AES128-GCM-SHA256 minTLSVersion: VersionTLS12 tuningOptions: clientFinTimeout: "1s" clientTimeout: "30s" headerBufferBytes: 0 headerBufferMaxRewriteBytes: 0 healthCheckInterval: "5s" maxConnections: 0 serverFinTimeout: "1s" serverTimeout: "30s" threadCount: 0 tlsInspectDelay: "5s" tunnelTimeout: "1h" kubelet: manifests: kustomizePaths: - /usr/lib/microshift/manifests - /usr/lib/microshift/manifests.d/* - /etc/microshift/manifests - /etc/microshift/manifests.d/* network: clusterNetwork: - 10.42.0.0/16 cniPlugin: "" multus: status: Disabled serviceNetwork: - 10.43.0.0/16 serviceNodePortRange: 30000-32767 node: hostnameOverride: "" nodeIP: "" nodeIPv6: "" storage: driver: "" optionalCsiComponents: - "" telemetry: endpoint: https://infogw.api.openshift.com proxy: "" status: Enabled
apiServer: advertiseAddress: 10.44.0.0/32
1 auditLog: maxFileAge: 0 maxFileSize: 200 maxFiles: 10 profile: Default namedCertificates: - certPath: "" keyPath: "" names: - "" subjectAltNames: [] tls: cipherSuites: - "" minVersion: VersionTLS12 debugging: logLevel: "Normal" dns: baseDomain: microshift.example.com etcd: memoryLimitMB: 0 ingress: certificateSecret: router-certs-default clientTLS: allowedSubjectPatterns: clientCA: name: "" clientCertificatePolicy: "" defaultHTTPVersion: 1 forwardedHeaderPolicy: "" httpCompression: mimeTypes: - "" httpEmptyRequestsPolicy: Respond listenAddress: - "" logEmptyRequests: Log ports: http: 80 https: 443 routeAdmissionPolicy: namespaceOwnership: InterNamespaceAllowed wildcardPolicy: WildcardPolicyAllowed status: Managed tlsSecurityProfile: type: Custom custom: ciphers: - ECDHE-ECDSA-CHACHA20-POLY1305 - ECDHE-RSA-CHACHA20-POLY1305 - ECDHE-RSA-AES128-GCM-SHA256 - ECDHE-ECDSA-AES128-GCM-SHA256 minTLSVersion: VersionTLS12 tuningOptions: clientFinTimeout: "1s" clientTimeout: "30s" headerBufferBytes: 0 headerBufferMaxRewriteBytes: 0 healthCheckInterval: "5s" maxConnections: 0 serverFinTimeout: "1s" serverTimeout: "30s" threadCount: 0 tlsInspectDelay: "5s" tunnelTimeout: "1h" kubelet: manifests: kustomizePaths: - /usr/lib/microshift/manifests - /usr/lib/microshift/manifests.d/* - /etc/microshift/manifests - /etc/microshift/manifests.d/* network: clusterNetwork: - 10.42.0.0/16 cniPlugin: "" multus: status: Disabled
2 serviceNetwork: - 10.43.0.0/16 serviceNodePortRange: 30000-32767 node: hostnameOverride: "" nodeIP: ""
3 nodeIPv6: "" storage: driver: ""
4 optionalCsiComponents:
5 - "" telemetry: endpoint: https://infogw.api.openshift.com proxy: "" status: Enabled
Copy to Clipboard Copied!