Feat: add docs for ref-url (#901)
Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
This commit is contained in:
parent
0cea68768b
commit
649be213f4
|
|
@ -10,9 +10,12 @@ You can reference and distribute existing Kubernetes objects with KubeVela in th
|
|||
- Promote deployments from canary clusters into production clusters.
|
||||
- Using Kubernetes apiserver as the control plane and storing all Kubernetes objects data in external databases. Then dispatch those data into real Kuberenetes managed clusters.
|
||||
|
||||
Besides, you can also refer to Kubernetes objects from remote URL links.
|
||||
|
||||
## Refer to Existing Kubernetes Objects in Component
|
||||
|
||||
### Refer to objects in cluster
|
||||
|
||||
To use existing Kubernetes objects in the component, you need to use the `ref-objects` typed component and declare which resources you want to refer to. For example, in the following example, the secret `image-credential-to-copy` in namespace `examples` will be taken as the source object for the component. Then you can use the topology policy to dispatch it into hangzhou clusters.
|
||||
|
||||
```yaml
|
||||
|
|
@ -37,6 +40,24 @@ spec:
|
|||
region: hangzhou
|
||||
```
|
||||
|
||||
### Refer to objects from URL
|
||||
|
||||
If your source Kubernetes objects are from remote URLs, you can also refer to them in the component properties as follows. Your remote URL files could include multiple-resources as well.
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: example-app
|
||||
namespace: default
|
||||
spec:
|
||||
components:
|
||||
- name: busybox
|
||||
type: ref-objects
|
||||
properties:
|
||||
urls: ["https://gist.githubusercontent.com/Somefive/b189219a9222eaa70b8908cf4379402b/raw/e603987b3e0989e01e50f69ebb1e8bb436461326/example-busybox-deployment.yaml"]
|
||||
```
|
||||
|
||||
## Details for the *ref-objects* typed component
|
||||
|
||||
The most simple way to specify resources is to directly use `resource: secret` or `resource: deployment` to describe the kind of resources. If no `name` or `labelSelector` is set, the application will try to find the resource with the same name as the component name in the application's namespace. You can also explicitly specify `name` and `namespace` for the target resource as well.
|
||||
|
|
|
|||
|
|
@ -132,8 +132,8 @@ You can also check the deployment and service with the `kubectl` or any other to
|
|||
vela workflow resume app-with-k8s-objects
|
||||
```
|
||||
|
||||
The delivery process can be powerful if you're [distributing resources across multi-clusters](../end-user/components/ref-objects).
|
||||
|
||||
KubeVela also allows referring Kubernetes objects from Kubernetes cluster or remote URL links, so that you do not need to write Kubernetes objects inside Application directly.
|
||||
Read more about it in [ref-objects](../end-user/components/ref-objects).
|
||||
|
||||
## Deploy with UI Console
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,12 @@ You can reference and distribute existing Kubernetes objects with KubeVela in th
|
|||
- Promote deployments from canary clusters into production clusters.
|
||||
- Using Kubernetes apiserver as the control plane and storing all Kubernetes objects data in external databases. Then dispatch those data into real Kuberenetes managed clusters.
|
||||
|
||||
Besides, you can also refer to Kubernetes objects from remote URL links.
|
||||
|
||||
## Refer to Existing Kubernetes Objects in Component
|
||||
|
||||
### Refer to objects in cluster
|
||||
|
||||
To use existing Kubernetes objects in the component, you need to use the `ref-objects` typed component and declare which resources you want to refer to. For example, in the following example, the secret `image-credential-to-copy` in namespace `examples` will be taken as the source object for the component. Then you can use the topology policy to dispatch it into hangzhou clusters.
|
||||
|
||||
```yaml
|
||||
|
|
@ -37,6 +40,24 @@ spec:
|
|||
region: hangzhou
|
||||
```
|
||||
|
||||
### Refer to objects from URL
|
||||
|
||||
If your source Kubernetes objects are from remote URLs, you can also refer to them in the component properties as follows. Your remote URL files could include multiple-resources as well.
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: example-app
|
||||
namespace: default
|
||||
spec:
|
||||
components:
|
||||
- name: busybox
|
||||
type: ref-objects
|
||||
properties:
|
||||
urls: ["https://gist.githubusercontent.com/Somefive/b189219a9222eaa70b8908cf4379402b/raw/e603987b3e0989e01e50f69ebb1e8bb436461326/example-busybox-deployment.yaml"]
|
||||
```
|
||||
|
||||
## Details for the *ref-objects* typed component
|
||||
|
||||
The most simple way to specify resources is to directly use `resource: secret` or `resource: deployment` to describe the kind of resources. If no `name` or `labelSelector` is set, the application will try to find the resource with the same name as the component name in the application's namespace. You can also explicitly specify `name` and `namespace` for the target resource as well.
|
||||
|
|
|
|||
|
|
@ -132,8 +132,8 @@ You can also check the deployment and service with the `kubectl` or any other to
|
|||
vela workflow resume app-with-k8s-objects
|
||||
```
|
||||
|
||||
The delivery process can be powerful if you're [distributing resources across multi-clusters](../end-user/components/ref-objects).
|
||||
|
||||
KubeVela also allows referring Kubernetes objects from Kubernetes cluster or remote URL links, so that you do not need to write Kubernetes objects inside Application directly.
|
||||
Read more about it in [ref-objects](../end-user/components/ref-objects).
|
||||
|
||||
## Deploy with UI Console
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue