mirror of
https://github.com/siderolabs/talos.git
synced 2025-12-08 11:01:51 +01:00
chore: split ignorePreflightErrors as settings on its own (#474)
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
This commit is contained in:
parent
e8469461a8
commit
87abc74938
@ -5,7 +5,6 @@ services:
|
|||||||
configuration: |
|
configuration: |
|
||||||
apiVersion: kubeadm.k8s.io/v1beta1
|
apiVersion: kubeadm.k8s.io/v1beta1
|
||||||
kind: InitConfiguration
|
kind: InitConfiguration
|
||||||
apiVersion: kubeadm.k8s.io/v1beta1
|
|
||||||
bootstrapTokens:
|
bootstrapTokens:
|
||||||
- token: 1qbsj9.3oz5hsk6grdfp98b
|
- token: 1qbsj9.3oz5hsk6grdfp98b
|
||||||
ttl: 0s
|
ttl: 0s
|
||||||
@ -37,9 +36,10 @@ services:
|
|||||||
conntrack:
|
conntrack:
|
||||||
max: 0
|
max: 0
|
||||||
maxPerCore: 0
|
maxPerCore: 0
|
||||||
extraArgs:
|
ignorePreflightErrors:
|
||||||
- --ignore-preflight-errors=cri,kubeletversion,numcpu,requiredipvskernelmodulesavailable,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables,Swap
|
- FileContent--proc-sys-net-bridge-bridge-nf-call-iptables
|
||||||
# additions to talos default are: FileContent--proc-sys-net-bridge-bridge-nf-call-iptables,Swap
|
- Swap
|
||||||
|
- SystemVerification
|
||||||
trustd:
|
trustd:
|
||||||
username: 'dev'
|
username: 'dev'
|
||||||
password: 'talos_trust_dev'
|
password: 'talos_trust_dev'
|
||||||
|
|||||||
@ -25,8 +25,10 @@ services:
|
|||||||
tlsBootstrapToken: 1qbsj9.3oz5hsk6grdfp98b
|
tlsBootstrapToken: 1qbsj9.3oz5hsk6grdfp98b
|
||||||
nodeRegistration:
|
nodeRegistration:
|
||||||
criSocket: /run/containerd/containerd.sock
|
criSocket: /run/containerd/containerd.sock
|
||||||
extraArgs:
|
ignorePreflightErrors:
|
||||||
- --ignore-preflight-errors=cri,kubeletversion,numcpu,requiredipvskernelmodulesavailable,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables,Swap
|
- FileContent--proc-sys-net-bridge-bridge-nf-call-iptables
|
||||||
|
- Swap
|
||||||
|
- SystemVerification
|
||||||
trustd:
|
trustd:
|
||||||
username: dev
|
username: dev
|
||||||
password: talos_trust_dev
|
password: talos_trust_dev
|
||||||
|
|||||||
@ -25,8 +25,10 @@ services:
|
|||||||
tlsBootstrapToken: 1qbsj9.3oz5hsk6grdfp98b
|
tlsBootstrapToken: 1qbsj9.3oz5hsk6grdfp98b
|
||||||
nodeRegistration:
|
nodeRegistration:
|
||||||
criSocket: /run/containerd/containerd.sock
|
criSocket: /run/containerd/containerd.sock
|
||||||
extraArgs:
|
ignorePreflightErrors:
|
||||||
- --ignore-preflight-errors=cri,kubeletversion,numcpu,requiredipvskernelmodulesavailable,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables,Swap
|
- FileContent--proc-sys-net-bridge-bridge-nf-call-iptables
|
||||||
|
- Swap
|
||||||
|
- SystemVerification
|
||||||
trustd:
|
trustd:
|
||||||
username: dev
|
username: dev
|
||||||
password: talos_trust_dev
|
password: talos_trust_dev
|
||||||
|
|||||||
@ -23,8 +23,10 @@ services:
|
|||||||
criSocket: /run/containerd/containerd.sock
|
criSocket: /run/containerd/containerd.sock
|
||||||
kubeletExtraArgs:
|
kubeletExtraArgs:
|
||||||
node-labels: node-role.kubernetes.io/worker=
|
node-labels: node-role.kubernetes.io/worker=
|
||||||
extraArgs:
|
ignorePreflightErrors:
|
||||||
- --ignore-preflight-errors=cri,kubeletversion,numcpu,requiredipvskernelmodulesavailable,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables,Swap
|
- FileContent--proc-sys-net-bridge-bridge-nf-call-iptables
|
||||||
|
- Swap
|
||||||
|
- SystemVerification
|
||||||
trustd:
|
trustd:
|
||||||
username: dev
|
username: dev
|
||||||
password: talos_trust_dev
|
password: talos_trust_dev
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/autonomy/talos/internal/app/init/internal/security/cis"
|
"github.com/autonomy/talos/internal/app/init/internal/security/cis"
|
||||||
@ -110,7 +111,9 @@ func (k *Kubeadm) Start(data *userdata.UserData) error {
|
|||||||
ID: k.ID(data),
|
ID: k.ID(data),
|
||||||
}
|
}
|
||||||
|
|
||||||
ignore := "--ignore-preflight-errors=cri,kubeletversion,numcpu,requiredipvskernelmodulesavailable"
|
ignorePreflightErrors := []string{"cri", "kubeletversion", "numcpu", "requiredipvskernelmodulesavailable"}
|
||||||
|
ignorePreflightErrors = append(ignorePreflightErrors, data.Services.Kubeadm.IgnorePreflightErrors...)
|
||||||
|
ignore := "--ignore-preflight-errors=" + strings.Join(ignorePreflightErrors, ",")
|
||||||
encoded := hex.EncodeToString([]byte(data.Services.Kubeadm.CertificateKey))
|
encoded := hex.EncodeToString([]byte(data.Services.Kubeadm.CertificateKey))
|
||||||
certificateKey := "--certificate-key=" + encoded
|
certificateKey := "--certificate-key=" + encoded
|
||||||
|
|
||||||
|
|||||||
@ -134,23 +134,26 @@ type Kubelet struct {
|
|||||||
type Kubeadm struct {
|
type Kubeadm struct {
|
||||||
CommonServiceOptions `yaml:",inline"`
|
CommonServiceOptions `yaml:",inline"`
|
||||||
|
|
||||||
Configuration runtime.Object `yaml:"configuration"`
|
Configuration runtime.Object `yaml:"configuration"`
|
||||||
ExtraArgs []string `yaml:"extraArgs,omitempty"`
|
ExtraArgs []string `yaml:"extraArgs,omitempty"`
|
||||||
CertificateKey string `yaml:"certificateKey,omitempty"`
|
CertificateKey string `yaml:"certificateKey,omitempty"`
|
||||||
bootstrap bool
|
IgnorePreflightErrors []string `yaml:"ignorePreflightErrors,omitempty"`
|
||||||
controlPlane bool
|
bootstrap bool
|
||||||
|
controlPlane bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalYAML implements the yaml.Marshaler interface.
|
// MarshalYAML implements the yaml.Marshaler interface.
|
||||||
func (kdm *Kubeadm) MarshalYAML() (interface{}, error) {
|
func (kdm *Kubeadm) MarshalYAML() (interface{}, error) {
|
||||||
var aux struct {
|
var aux struct {
|
||||||
Configuration string `yaml:"configuration,omitempty"`
|
Configuration string `yaml:"configuration,omitempty"`
|
||||||
ExtraArgs []string `yaml:"extraArgs,omitempty"`
|
ExtraArgs []string `yaml:"extraArgs,omitempty"`
|
||||||
CertificateKey string `yaml:"certificateKey,omitempty"`
|
CertificateKey string `yaml:"certificateKey,omitempty"`
|
||||||
|
IgnorePreflightErrors []string `yaml:"ignorePreflightErrors,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
aux.ExtraArgs = kdm.ExtraArgs
|
aux.ExtraArgs = kdm.ExtraArgs
|
||||||
aux.CertificateKey = kdm.CertificateKey
|
aux.CertificateKey = kdm.CertificateKey
|
||||||
|
aux.IgnorePreflightErrors = kdm.IgnorePreflightErrors
|
||||||
|
|
||||||
b, err := configutil.MarshalKubeadmConfigObject(kdm.Configuration)
|
b, err := configutil.MarshalKubeadmConfigObject(kdm.Configuration)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -177,9 +180,10 @@ func (kdm *Kubeadm) MarshalYAML() (interface{}, error) {
|
|||||||
// UnmarshalYAML implements the yaml.Unmarshaler interface.
|
// UnmarshalYAML implements the yaml.Unmarshaler interface.
|
||||||
func (kdm *Kubeadm) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
func (kdm *Kubeadm) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||||
var aux struct {
|
var aux struct {
|
||||||
Configuration string `yaml:"configuration,omitempty"`
|
Configuration string `yaml:"configuration,omitempty"`
|
||||||
ExtraArgs []string `yaml:"extraArgs,omitempty"`
|
ExtraArgs []string `yaml:"extraArgs,omitempty"`
|
||||||
CertificateKey string `yaml:"certificateKey,omitempty"`
|
CertificateKey string `yaml:"certificateKey,omitempty"`
|
||||||
|
IgnorePreflightErrors []string `yaml:"ignorePreflightErrors,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := unmarshal(&aux); err != nil {
|
if err := unmarshal(&aux); err != nil {
|
||||||
@ -188,6 +192,7 @@ func (kdm *Kubeadm) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
|||||||
|
|
||||||
kdm.ExtraArgs = aux.ExtraArgs
|
kdm.ExtraArgs = aux.ExtraArgs
|
||||||
kdm.CertificateKey = aux.CertificateKey
|
kdm.CertificateKey = aux.CertificateKey
|
||||||
|
kdm.IgnorePreflightErrors = aux.IgnorePreflightErrors
|
||||||
|
|
||||||
b := []byte(aux.Configuration)
|
b := []byte(aux.Configuration)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user