github.com/oam-dev/kubevela@v1.9.11/docs/examples/application/Demo.md (about) 1 # Application Example 2 3 In this Demo, Application application-sample will be converted to appcontext and component 4 5 The fields in the application spec come from the parametes defined in the definition template 6 , so we must install Definition at first 7 8 Step 1: Install ComponentDefinition & Trait Definition 9 ``` 10 kubectl apply -f template.yaml 11 ``` 12 Step 2: Create a sample application in the cluster 13 ``` 14 kubectl apply -f application-sample.yaml 15 ``` 16 Step 3: View the application status 17 ``` 18 kubectl get -f application-sample.yaml -oyaml 19 20 // You can see the following 21 apiVersion: core.oam.dev/v1beta1 22 kind: Application 23 metadata: 24 annotations: 25 kubectl.kubernetes.io/last-applied-configuration: | 26 {"apiVersion":"core.oam.dev/v1beta1","kind":"Application","metadata":{"annotations":{},"name":"application-sample","namespace":"default"},"spec":{"components":[{"name":"myweb","properties":{"cmd":["sleep","1000"],"image":"busybox"},"traits":[{"properties":{"replicas":10},"type":"scaler"},{"properties":{"image":"nginx","name":"sidecar-test"},"type":"sidecar"},{"properties":{"http":{"server":80}},"type":"kservice"}],"type":"worker"}]}} 27 ... 28 spec: 29 components: 30 - name: myweb 31 properties: 32 cmd: 33 - sleep 34 - "1000" 35 image: busybox 36 traits: 37 - properties: 38 replicas: 10 39 type: scaler 40 - properties: 41 image: nginx 42 name: sidecar-test 43 type: sidecar 44 - properties: 45 http: 46 server: 80 47 type: kservice 48 type: worker 49 status: 50 batchRollingState: "" 51 components: 52 - apiVersion: core.oam.dev/v1alpha2 53 kind: Component 54 name: myweb 55 conditions: 56 - reason: Available 57 status: "True" 58 type: Parsed 59 - reason: Available 60 status: "True" 61 type: Built 62 - reason: Available 63 status: "True" 64 type: Applied 65 status: running 66 ... 67 ``` 68