Creating the Kubernetes objects extension
Kubernetes (K8s) is a very demanding topic when working with microservices or containers. We have seen in the previous chapters, how you can declaratively deploy K8s objects such as Deployments
and Services
inside K8s clusters, for which we create a YAML
file containing the K8s object-specific information. The YAML
file has a fixed-tab delimited format and a single space or invalid indentation can cause the deployment to fail. Let's see how this happens.
Generating the code snippet extension project for K8s objects
In this section, we will create an extension that will help us to scaffold the Deployment
and Service
templates for K8s objects. Let's begin:
- To start with, we will first create a new folder named
K8sext
. Then run the following command to start building the extension:yo code
- From the list of extensions, choose
New Code Snippets
shown as follows: