k8s resource operation
This document describes how to create k8s resources through yaml files. The k8s resources are for users to create k8s cluster resources in the form of handwritten yaml. All resources in k8s can be created here, such as Secret, PV, etc. There is no corresponding model in the platform resources can be created in this way.This function module only supports the functions of creating, editing, modifying, and deleting, and cannot convert the corresponding resources into the model layer of Rainbond. If you need to deploy the business through the yaml file, please select Add component under the application ->yaml file deployment component
Preconditions
I am very familiar with the yaml file of k8s resources, and prepare a yaml file of k8s resources.
Check if the current team, application is the desired location.
Check whether there are resources of the same type and the same name in the k8s resources of the same level application, so as to reduce the problems encountered in the process of resource creation.
The following will take the Linkerd namespace as an example to introduce the processing of k8s resources on Rainbond.
Add to
Click the Add button
Write yaml file content
After confirming that it is correct, click OK.
Check whether there are any resources that failed to be created, and click View Details to view the specific failure reasons.
caution
- The resource that fails to be created cannot see the resource type and resource name and does not support modification. It needs to be deleted and recreated.
- The created yaml file can support the writing of multiple k8s resources. The resources are divided by
---
before, and they will be disassembled and displayed after creation. :::
Revise
Click the Edit button.
Modify the content of the yaml file.
After confirming that it is correct, click OK.
Check whether there are any resources that failed to be modified, and click View Details to view the specific failure reasons.
- It should be noted that after the yaml file is successfully created, there will be an extra line of content:
resourceVersion:xxxxxx
, which cannot be deleted during the modification process. - When modifying the content of the yaml file, it only supports modifying the current resource, and does not support adding new resources in the yaml file. If you want to create a resource, please go to the creation logic. :::
delete
- After confirming that the resource is not needed, click the Delete button.