Beginning with Microclimate Version 18.09, you can add more development languages and sample projects by adding Microclimate extensions, called templates. These templates appear as new language and project types within the Microclimate user interface. You can code and develop in languages of your choice and provide sample projects that are suited to your environment.
Microclimate templates are stored in the
microclimate-workspace/.extensions directory. Templates for Python and Go languages and for additional Java and Node.js sample projects are already included in Microclimate, and you can refer to those as examples.
You can create templates in one of two ways: you can create them using the template wizard, or you can create them manually. Using the wizard is easier if your project uses one of the supported languages, as shown in the following instructions.
To create a template using the wizard:
To make your own template:
microclimate.yaml file to provide the specification for your sample project. See the format specification of the microclimate.yaml file along with the example.
microclimate.yamlfile needs to be placed in a new directory within the
extensionIDfield in your
microclimate.yamlfile, set the
localpathvalue with a period.
kubectlto upload your template directory, which contains
kubectl cp <your template directory> <namespace>/<ibm-microclimate pod>:microclimate-workspace/<icp-username>/.extensions
<your-template-directory>directory must end in a forward slash (/) so that the
kubectlcommand performs a recursive directory copy.
extensionsdirectory in the root of the file system for the
ibm-microclimatepod contains only the templates that Microclimate supplies. Place your new template in the
microclimate-workspace/<icp-username>/.extensionsdirectory as previously described.
ibm-microclimatepod. After you restart, your template appears as a selectable project type when you create a new project.
The following code is an example
microclimate.yaml file for the Go language template as supplied in the
# extensionId must match the directory name, repository name, and chart/ directory extensionId: templateGoExample buildType: docker # Project language to display in the Microclimate UI language: go # Must be "template" creationType: template info: # Customize these to your liking provider: IBM version: 0.0.1 userInterface: # Template label to display in the Microclimate UI label: Go sample template # Description of the template project description: Sample microservice for simple Go app template: # Link to the GitHub repo, if your source is in GitHub giturl: https://github.com/microclimate-dev2ops/microclimateGoTemplate # Git branch to clone new projects from gitbranch: master # Path to your project's root directory relative to this file # Ignored if giturl and gitbranch are set above localpath: . application: # Application's HTTP port port: 8000 # The application' s "root path", default is "/" # Microclimate will ping this endpoint to determine when your app is running contextroot: /my-root-endpoint
Monitoring is unavailable for projects created from a template.