awslabs / aws-servicebroker

AWS Service Broker
Apache License 2.0
468 stars 132 forks source link

Provisioning RDS Mysql using aws-servicebrokier giving issue #7

Closed netstartergit closed 6 years ago

netstartergit commented 6 years ago

Hi All,

We have used following Kubernetes service yml file to provision AWS RDS Mysql, through the AWS service broker running on a kubernetes cluster (1.9) hosted on EC2.

service.yml.txt

We then run into the following error:

TASK [aws-provision-apb : Create Resources] **** fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "An error occurred (ValidationError) when calling the CreateStack operation: Parameters: [DatabaseUsername, DatabasePassword] must have values An error occurred (ValidationError) when calling the CreateStack operation: Parameters: [DatabaseUsername, DatabasePassword] must have values - <class 'botocore.exceptions.ClientError'>"}

Can you please help us with the above?

Is there a working example kubernetes service yaml where we provision and AWS RDS?

jaymccon commented 6 years ago

if you have followed the getting started documentation to setup the broker in your cluster then parameters like aws_cloudformation_role_arn, region, VpcId and SBArtifactS3Bucket should be populated already by a secret associated with the ServiceClass.

To see all the required parameters for a given plan use the svcat tool, using the rdsmysql production plan as an example (output shortened to make it more readable):

svcat get plan --class dh-rdsmysql production -o yaml
...
spec:
  ...
  instanceCreateParameterSchema:
    ...
    properties:
      AccessCidr:
        description: CIDR block to allow to connect to database
        title: Access CIDR
        type: string
      AllocatedStorageAndIops:
        default: 100GB 1000IOPS
        description: Storage/IOPS to allocate
        enum:
        - 100GB 1000IOPS
        - 300GB 3000IOPS
        - 600GB 6000IOPS
        - 1000GB 10000IOPS
        - 1500GB 15000IOPS
        - 2000GB 20000IOPS
        - 3000GB 30000IOPS
        - 4000GB 40000IOPS
        - 6000GB 60000IOPS
        title: Allocated Storage And IOPS
        type: string
      ...

For this plan the only parameter without a default value is the AccessCidr, so a minimal service yaml file would look like:

apiVersion: servicecatalog.k8s.io/v1beta1
kind: ServiceInstance
metadata:
  name: test-rdsmysql
spec:
  clusterServiceClassExternalName: dh-rdsmysql
  clusterServicePlanExternalName: production
  parameters:
     AccessCidr: "172.16.31.0/16"
jaymccon commented 6 years ago

you can verify that you have the secrets properly setup by running:

kubectl get secret/aws-secret -n aws-service-broker -o yaml

This will output the names of the parameters that have been set with base64 encoded values, if you need to update this the broker pod must be refreshed for changes to take effect.

to check that a particular ServiceClass has been associated with the secret, run:

kubectl get configmap/broker-config -o yaml -n aws-service-broker

Under data -> broker-config -> secrets you should see an association between the secret and ServiceClass

jaymccon commented 6 years ago

docs now include detailed info on ServicePlan input parameters and binding credentials: https://github.com/awslabs/aws-servicebroker/tree/master/docs