rancher / rke

Rancher Kubernetes Engine (RKE), an extremely simple, lightning fast Kubernetes distribution that runs entirely within containers.
Apache License 2.0
3.21k stars 580 forks source link

rke config for aws service_override results in a parsing error #1969

Open ryanelliottsmith opened 4 years ago

ryanelliottsmith commented 4 years ago

RKE version: 1.0.4 Type/provider of hosts: (VirtualBox/Bare-metal/AWS/GCE/DO) aws cluster.yml file:

cloud_provider:
   name: aws
   awsCloudProvider:
     service_override:
       "ec2_ap-southeast-2":
         url: https://ec2.ap-southeast-2.amazonaws.com/
         signing-region: custom-signing-region
         service: ec2
         region: ap-southeast-2
nodes:
  - address: xxx
    internal_address: xxx
    user: ubuntu
    role: [controlplane,worker,etcd]
services:
  etcd:
    snapshot: true
    creation: 6h
    retention: 24h

Steps to Reproduce: run rke up on the example cluster above.

Results:

rke up                                                                                                                                                 1
INFO[0000] Running RKE version: v1.0.4
INFO[0000] Initiating Kubernetes cluster
FATA[0000] Failed to register cloud provider: Failed to parse cloud config file: Failed to parse AWS cloud config
ryanelliottsmith commented 4 years ago

Using the customCloudProvider serviceoverride works with this config:

cloud_provider:
  name: aws
  customCloudProvider: |-
    [serviceoverride "ap-southeast-2"]
    URL = https://ec2.ap-southeast-2.amazonaws.com/
    SigningRegion = custom-signing-region
    Service = ec2
    Region = ap-southeast-2
jgallucci32 commented 2 years ago

@ryanelliottsmith I'm curious, did you go back and verify it wasn't a formatting issue? Your original post used different YAML formatting which I think results in different key/values being presented to K8s. Your follow-up comment is formatted the way I would expect.

The Amazon EC2 (in-tree) provider using awsCloudProvider has the Go structs to handle the service overrides so I would expect it to work.