github.com/oam-dev/kubevela@v1.9.11/docs/examples/apiserver.md (about)

     1  # How to use apiserver
     2  
     3  ## Preparation
     4  
     5  The apiserver is enabled by default, but you need some extra works to make it accessible outside the k8s cluster.
     6  
     7  1. For development environment, you can use `kubectl port-forward` to access the KubeVela apiserver.
     8  
     9  ```shell
    10  kubectl port-forward --namespace vela-system service/kubevela-vela-core-apiserver 8000:80
    11  ```
    12  
    13  2. For production environment, you can set up Ingress to expose the KubeVela apiserver.
    14  
    15  ```shell
    16  cat <<EOF | kubectl apply -f -
    17  apiVersion: networking.k8s.io/v1
    18  kind: Ingress
    19  metadata:
    20    name: kubevela-vela-core-apiserver
    21    namespace: vela-system
    22  spec:
    23    defaultBackend:
    24      service:
    25        name: kubevela-vela-core-apiserver
    26        port:
    27          number: 80
    28  EOF
    29  ```
    30  
    31  ```shell
    32  $ kubectl get ingress -n vela-system
    33  NAME                           CLASS    HOSTS   ADDRESS         PORTS   AGE
    34  kubevela-vela-core-apiserver   <none>   *       <your ip>       80      99m
    35  ```
    36  
    37  ## Api
    38  
    39  ### Create or Update Application
    40  
    41  1. URL
    42  
    43  ```
    44  POST /v1/namespaces/<namespace>/applications/<application name>
    45  ```
    46  
    47  2. Request Body Example
    48  
    49  ```json
    50  {
    51    "components": [
    52      {
    53        "name": "express-server",
    54        "type": "webservice",
    55        "properties": {
    56          "image": "crccheck/hello-world",
    57          "port": 8000
    58        },
    59        "traits": [
    60          {
    61            "type": "ingress",
    62            "properties": {
    63              "domain": "testsvc.example.com",
    64              "http": {
    65                "/": 8000
    66              }
    67            }
    68          }
    69        ]
    70      }
    71    ]
    72  }
    73  ```
    74  
    75  ### Delete Application
    76  
    77  ```
    78  DELETE /v1/namespaces/<namespace>/applications/<application name>
    79  ```