Manual
Kuerbentes APP

Kubernetes APP

The MegaEase Cloud platform can host users' servers, support rapid deployment and management of common software service and cloud-native applications, and allow users to obtain a low-cost, high-availability cloud-native platform that is not locked by the platform.

This document introduces the basic operations of the MegaEase Cloud platform, including the installation of Kubernetes and its APP.

Deploy Kubernetes

The requirement to install Kubernetes App is to install the middleware Kubernetes cluster.

  1. Go to Services Page
  2. Click Create Service and select Kubernetes

  1. Select an available Kubernetes version
  2. The name is automatically generated, or you can write it manually
  3. Select Etcd Nodes Count态Control Plane Count态Kube Node Count
  4. Select Host
  5. Select Networking plugin
  6. Do not change directories if not necessary
  7. Click Create to create Kubernetes cluster

Deploy Kubernetes App

  1. Go to App Page
  2. Click Create App,Select Kubernetes App

  1. There are 3 ways to choose(whatever to be chosen, the final result is an YAML file)

    1. Upload the local YAML file
    2. Edit the template file
    3. Fill out forms step by step
  2. Take Template file as an example, we provide a simple template

  1. Same as Mesh App, We use a complex stack Takeoutapp as an example to create Kubernetes App

  1. Click Submit
  2. Choose the corresponding Cluster Name

  1. We could enable Mesh here If we want service governance

  2. Click Next

  1. Click Create to create Stack

Besides, We could also create the same Stack by filling out forms:

  1. Choose Create Step by Step in step 3 above, and fill it out:

  1. Click Next to enter the page of Component

  1. Click button + below Components, then choose Component, then fill out the form of common properties

  1. Click Next to fill out the form of command and resources

  1. Click Next to fill out the form of access and configuration

  1. Click OK to save the component order-mesh

  1. And the other components restaurant-mesh and delivery-mesh could be created by similar steps.

Appendix

Takeoutapp complete codebase:Mesh Example (opens in a new tab).

we use Takeoutapp as an example to explain some obscure specs. Some unused specs in the component-level are explained in the component order-mesh.

takeoutapp.yaml:

name: takeoutapp
 
 
# Kubernetes namespace.
namespace: takeoutapp
 
 
cluster_name: kubernetes2c221c475
description: An application comprising of order, restaurant, delivery.
 
 
 # Mesh related config.
easemesh:
  enable: false
 
 
# Health check related config.
health_check_retry_times: 3
health_check_interval: 10s
 
 
# When stack status is under retrying state, it should delete old resources
# and redeploy it. The RetryMaxTime is maximum times value of retry deploy
# resource. When retrying times exceed this value, the stack status would
# changed to failed status
retry_max_time: 3
retry_interval: 30s
 
 
# Env applied to all components.
env_variables:
- name: STACK_NAME
  value: takeoutapp
 
 
# pulse event frequency can be specified by user for advance option
# default value is 10 seconds
pulse_event_interval: 10s
 
 
# image_pull_secret_names is a credentials which kubernetes will use it to pull
# the image from the private registry. the value is copied from the cluster configuration.
image_pull_secret_names: {}
 
 
components:
 
 
# Order
- name: order-mesh
  enable: true
  image: megaease/meshdemo
  image_version: latest
  instance_count: 1
 
  # IfNotPresent, Never, Always
  image_pull_policy: IfNotPresent
 
 
  # Stateless creates Deployment, Stateful creates StatefulSet
  type: Stateless
 
 
  # The first element of array map to kubernetes v1/Container command to entrypoint array,
  # the remains elements map to  v1/Container args to entrypoint array.
  command: []
 
 
  # liveness_probe_command is used to check if the component is healthy.
  liveness_probe_command: []
  # readiness_probe_command is used to check if the component is ready for traffic.
  readiness_probe_command: []
 
 
  # Current component launched after launching dependency components.
  dependency_components: []
 
 
  # Parts of volume from Kubernetes, so the naming convention is camel case.
  # All types are the same as Kubernetes.
  volumeMounts: []
  volumeClaimTemplates: []
  volumes: []
 
 
  # Health check config for the component.
  initial_delay_seconds: 10
  probe_timeout_seconds: 5
  probe_period_seconds: 5
  health_check_retry_times: 3
  health_check_interval: 10s
 
 
  # The flag indicate whether component service is type NodePort.
  is_node_port: true
 
 
  annotations:
    component_name: order-mesh
 
 
  named_ports:
  - name: http
    port: 80
  env_variables:
  - name: SERVICE_NAME
    value: order-mesh
  - name: ZIPKIN_URL
    value: https://monitor.megaease.com:32430/report/application-tracing-log
  resource_require:
    cpu: 200m
    memory: 256Mi
  resource_limit:
    cpu: 1200m
    memory: 2048Mi
  configurations:
  - key: listenPort
    value: "7700"
    use_as_file: /etc/port_config
    is_sub_path: true
  - key: listenAddr
    value: 127.0.0.1
    use_as_file: /etc/address_config
    is_sub_path: true
 
 
# Restaurant
- name: restaurant-mesh
  enable: true
  image: megaease/meshdemo
  image_version: latest
  type: Stateless
  instance_count: 1
  named_ports:
  - name: http
    port: 80
  env_variables:
  - name: SERVICE_NAME
    value: restaurant-mesh
  - name: ZIPKIN_URL
    value: https://monitor.megaease.com:32430/report/application-tracing-log
  resource_require:
    cpu: 200m
    memory: 1Gi
  resource_limit:
    cpu: 2000m
    memory: 3Gi
  configurations:
  - key: listenPort
    value: "8800"
    use_as_file: /etc/port_config
    is_sub_path: true
  - key: listenAddr
    value: 0.0.0.0
    use_as_file: /etc/address_config
    is_sub_path: true
 
 
# Delivery
- name: delivery-mesh
  enable: true
  image: megaease/meshdemo
  image_version: latest
  type: Stateless
  instance_count: 1
  named_ports:
  - name: http
    port: 80
  env_variables:
  - name: SERVICE_NAME
    value: delivery-mesh
  - name: ZIPKIN_URL
    value: https://monitor.megaease.com:32430/report/application-tracing-log
  resource_require:
    cpu: 200m
    memory: 256Mi
  resource_limit:
    cpu: 1200m
    memory: 2048Mi
  configurations:
  - key: listenPort
    value: "9900"
    use_as_file: /etc/port_config
    is_sub_path: true
  - key: listenAddr
    value: 127.0.0.1
    use_as_file: /etc/address_config
    is_sub_path: true