Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release-1.22] etcd-snapshot loading config fails with "flag provided but not defined: -profile" #2191

Closed
VestigeJ opened this issue Nov 30, 2021 · 1 comment
Assignees

Comments

@VestigeJ
Copy link
Contributor

This is a backport issue for #2103

Environmental Info:
RKE2 Version:
rke2 version v1.21.6+rke2r1 (b915fc9)
go version go1.16.6b7

Node(s) CPU architecture, OS, and Version:
N/A

Cluster Configuration:
N/A

Describe the bug:
Running the etcd-snapshot commands throw an error flag provided but not defined: -profile.

Steps To Reproduce:
Have the profile set in the config file and run the etcd-snapshot which loads the default config.

Expected behavior:
Runs snapshot.

Actual behavior:
Throw error saying flag profile is not defined.

@rancher-max

@VestigeJ VestigeJ changed the title [Release-1.22] etcd-snapshot loading config fails with "flag provided but not defined: -profile" #2129 [Release-1.22] etcd-snapshot loading config fails with "flag provided but not defined: -profile" Nov 30, 2021
@VestigeJ
Copy link
Contributor Author

VestigeJ commented Nov 30, 2021

Issue validated

RKE2 skipped over unknown flags inside of the config.yaml, etcd snapshot correctly uploaded to an S3 bucket.

$ rke2 -v

rke2 version v1.22.4-rc1+rke2r1 (aaa884e69e34f28380988f209f737ef5403eeeb6)
go version go1.16.10b7

$ sestatus

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      31

$ cat /etc/rancher/rke2/config.yaml

write-kubeconfig-mode: "0644"
tls-san:
  - "foot1.local"
node-label:
  - "key=valued"
  - "crisis=averted"
etcd-expose-metrics: true
etcd-snapshot-name: "vertabular"
etcd-snapshot-schedule-cron: "*/22****"
etcd-snapshot-retention: 7
etcd-snapshot-dir: /home/ubuntu/
profile: cis-1.6
etcd-s3: true
etcd-s3-bucket: "justin-validation-bucket"
etcd-s3-region: "us-north-9"
etcd-s3-endpoint: "s3.us-north-9.amazonaws.com"
etcd-s3-access-key: "***************"
etcd-s3-secret-key: "*************"

$ sudo /usr/local/bin/rke2 etcd-snapshot

WARN[0000] Unknown flag --write-kubeconfig-mode found in config.yaml, skipping 
WARN[0000] Unknown flag --tls-san found in config.yaml, skipping 
WARN[0000] Unknown flag --node-label found in config.yaml, skipping 
WARN[0000] Unknown flag --node-label found in config.yaml, skipping 
WARN[0000] Unknown flag --etcd-expose-metrics found in config.yaml, skipping 
WARN[0000] Unknown flag --etcd-snapshot-name found in config.yaml, skipping 
WARN[0000] Unknown flag --etcd-snapshot-schedule-cron found in config.yaml, skipping 
WARN[0000] Unknown flag --etcd-snapshot-retention found in config.yaml, skipping 
WARN[0000] Unknown flag --etcd-snapshot-dir found in config.yaml, skipping
WARN[0000] Unknown flag --profile found in config.yaml, skipping 
INFO[0000] Managed etcd cluster bootstrap already complete and initialized 
INFO[0000] Applying CRD addons.k3s.cattle.io            
INFO[0000] Applying CRD helmcharts.helm.cattle.io       
INFO[0000] Applying CRD helmchartconfigs.helm.cattle.io
...
...
...
INFO[0000] Saving etcd snapshot on-demand-ip-155-5-55-55.us-north-9.compute.internal-55 to S3 
INFO[0000] Checking if S3 bucket justin-validation-bucket exists 
INFO[0000] S3 bucket justin-validation-bucket exists    
INFO[0001] S3 upload complete for on-demand-ip-155-5-55-55.us-north-9.compute.internal-55 
INFO[0001] Saving current etcd snapshot set to rke2-etcd-snapshots ConfigMap 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants