First build config-generator gem and install it. Currently latest code for config-generator gem is under https://github.com/dtk/kube-crd-parsers/tree/master-candidate/tests/config-generator/assets
Clone kube-crd-parser from link above
cd kube-crd-parsers/tests/config-generator/assets
gem build config-driver.gemspec
gem install config-driver-0.0.1.gem
After config-driver gem is installed, you can run sinatra api with:
rackup config.ru
First make sure that valid attributes are set in input params.yaml file. For that you can use script:
cd kube-crd-parsers/tests/config-generator/assets/end-to-end
bash replace_stubbed_values.sh -r us-east-1 -v vpcid1 -c cidrblock1 -h "{t1:1,t2:2}"
If you need to set additional attributes for any of the components in assembly you can do that under assemblies -> assembly_name -> components in base component_def meta file, e.g.:
kube-crd-parsers/tests/config-generator/assets/end-to-end/config/aws_vpc/target/meta.yaml#L28
Try out end to end example:
start sinatra api application as described above.
curl endpoint to generate crds and apply to kubernetes Note that you can change parent_dir parameter to point to directory where config and input directories are located. For this example you can leave it as is.
curl -X POST http://localhost:9292/generate-crds -H "Content-Type: application/json" -d '{"parent_dir":"kube-crd-parsers/tests/config-generator/assets/end-to-end"}'
curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/assemblies/<assembly_name> -H "Content-Type: application/json"
curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/assemblies/<assembly_name>/components/<component_name> -H "Content-Type: application/json"
curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/assemblies/<assembly_name>/components/<component_name>/attributes -H "Content-Type: application/json"
curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/assemblies/<assembly_name>/components/<component_name>/attributes?filter=metadata -H "Content-Type: application/json"
curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/assemblies/<assembly_name>/components/<component_name>/attributes?filter=values -H "Content-Type: application/json"
curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name> -H "Content-Type: application/json"
curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name>/status -H "Content-Type: application/json"
curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name>/steps -H "Content-Type: application/json"
curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name>/attributes -H "Content-Type: application/json"
curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name>/attributes?filter=metadata -H "Content-Type: application/json"
curl -X GET http://localhost:9292/api/v1/namespaces/<namespace_name>/workflowinstances/<workflow_instance_name>/attributes?filter=values -H "Content-Type: application/json"
curl -X POST http://localhost:9292/workflow-instance -H "Content-Type: application/json" -d '{"template_name":"<workflow_name>", "namespace":"<namespace_name>", "name":"<workflow_instance_name>"}'
Content type
Image
Digest
Size
168.4 MB
Last updated
over 6 years ago
docker pull getdtk/controller-manager-api