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.21] etcd-snapshot loading config fails with "flag provided but not defined: -profile" #2129

Closed
dereknola opened this issue Nov 16, 2021 · 1 comment
Assignees

Comments

@dereknola
Copy link
Member

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.

@dereknola dereknola added this to the v1.21.7+rke2r1 milestone Nov 16, 2021
@dereknola dereknola self-assigned this Nov 16, 2021
This was referenced Nov 16, 2021
@VestigeJ
Copy link
Contributor

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.21.7-rc2+rke2r1 (de8b499743b19a5a703f0bc26aea9c6fdabc3874)
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] Saving etcd snapshot on-demand-ip-15-5-55-55.us-north-9.compute.internal-5555 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-15-5-55-55.us-north-9.compute.internal-5555 
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

3 participants