Helloooo!
In my previous post we’ve created Kubernetes Zones and assigned Tags to the Deployment Plans in that Zone. Now we will create a basic Kubernetes Blueprint in vRA 8 by using Cloud Assembly.
The steps we will cover are:
- Create K8s Blueprint (Cloud Assembly)
- Make K8s Blueprint visible in the Catalog (Service Broker)
- Add Custom Form to K8s Blueprint (Service Broker)
Please note that by default your Cluster’s Name will be equal to the Deployment Name. You need to keep the K8s Naming Convention in mind. This means you should not enter ‘spaces’ for example in your Deployment Name field otherwise your Deployment will fail!
Create K8s Blueprint – Cloud Assembly
The first step is to create a K8s Blueprint which can get deployed using the Deployment Plans we’ve specified in our Kubernetes Zone.
Our Blueprint will have the following:
- An input parameter ‘K8s Master Hostname‘ for the Requestor to provide
- We will always provision this Blueprint from the Small Deployment Plan we’ve tagged in our previous post with the tag ‘small‘.
- Will only contain 1 K8s worker node.
The steps below will achieve this:
- Log on to vRA 8 and go to Cloud Assembly
- Once in Cloud Assembly go to ‘Blueprints‘ and click ‘New‘:
- Provide the details of your Blueprint to your likings:
- Now you will be taken to the Design Canvas of the Blueprint. Search for ‘Kubernetes‘ and drag & drop the ‘K8S Cluster‘ on to the Design Canvas:
- On the right pane you can enter something like this:
formatVersion: 1 inputs: hostname: type: string title: K8s Master Hostname resources: Cloud_K8S_Cluster_1: type: Cloud.K8S.Cluster properties: hostname: '${input.hostname}' port: 8443 connectBy: ip workers: 1 constraints: - tag: small
You see that we will provide an Input Parameter to our K8s blueprint of type ‘string‘ and name ‘K8s Master Hostname‘. That Input Parameter will be used to set the Hostname Property of our K8s cluster.
By defining ‘constraints‘ we define which Deployment Plan to use. In our case it will be the Deployment Plan which is tagged with the ‘small‘ tag.
Also node we will only deploy 1 worker node. This is defined in the property ‘workers‘.
- In the UI it should look something like this:
- Lets version our Blueprint by clicking ‘Version‘ on the bottom left:
Make sure to select ‘Release this version to the catalog‘ for it to appear in the Service Broker Catalog. Click ‘Create‘ to continue.
Let’s make sure Service Broker sees our Blueprint!
Make K8s Blueprint visible in the Catalog – Service Broker
- In Service Broker make sure that you have added ‘Cloud Assembly Blueprint‘ as a Content Source for Service Broker. If your Blueprint does not show up, open your Content Source & click ‘Save & Import‘ again to force the import.
- Now your Cloud Assembly Blueprint should show up under ‘Content‘:
Let’s create a Custom Form for it!
Add Custom Form to K8s Blueprint – Service Broker
As highlighted earlier: Deployment Name will be the Name of the K8s Cluster. Hence that field cannot contain a white space for example.
In the Custom Form we will rename the Field ‘Deployment Name’ to ‘Cluster Name’. Optionally you can also add Regex Validation on the field to provide descriptive error handling to your requestors.
- In Service Broker under ‘Content‘ click the ‘3 dots‘ next to our K8s Cluster Blueprint and choose ‘Customize Form‘ (choose ‘Customize Icon’ to set a Custom Icon on the Catalog Item):
- In the Form rename the ‘Deployment Name‘ field to ‘Cluster Name‘ and add a Regex Validation (Optionally). Order the fields to your likings:
- When you’re finished, make sure to click ‘Activate Custom Form‘ for the Form to appear on the Blueprint.
This is how the result looks like:
Ready for Requesting!
2 thoughts on “vRA 8 – Create a Kubernetes Blueprint with Custom Form”