github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/applications/README.md (about)

     1  # Prerequisites
     2  
     3  * install sealer in your machine
     4  * if your want to run cloud image on alibaba cloud, need AK,SK first.
     5  
     6  ## Overview
     7  
     8  We choose OpenEBS Jiva or OpenEBS LocalPV as default persistence storage to enable Stateful applications to easily access Dynamic Local PVs
     9  or Replicated PVs. More details about the application can be found in its manifest directory.
    10  
    11  ### Cloud image list
    12  
    13  #### Install tools image
    14  
    15  * registry.cn-qingdao.aliyuncs.com/sealer-apps/helm:v3.6.0
    16  
    17  #### Infra image
    18  
    19  * registry.cn-qingdao.aliyuncs.com/sealer-apps/openebs-cstor:2.11.0
    20  * registry.cn-qingdao.aliyuncs.com/sealer-apps/openebs-jiva:2.11.0
    21  * registry.cn-qingdao.aliyuncs.com/sealer-apps/openebs-localpv:2.11.0
    22  * registry.cn-qingdao.aliyuncs.com/sealer-apps/ingress-nginx-controller:v1.0.0
    23  * registry.cn-qingdao.aliyuncs.com/sealer-apps/ceph-block:v16.2.5
    24  * registry.cn-qingdao.aliyuncs.com/sealer-apps/ceph-file:v16.2.5
    25  * registry.cn-qingdao.aliyuncs.com/sealer-apps/ceph-object:v16.2.5
    26  * registry.cn-qingdao.aliyuncs.com/sealer-apps/minio:2021.6.17
    27  * registry.cn-beijing.aliyuncs.com/mahmut/longhorn:v1.2.3
    28  
    29  #### Database image
    30  
    31  * registry.cn-qingdao.aliyuncs.com/sealer-apps/mysql:8.0.26
    32  * registry.cn-qingdao.aliyuncs.com/sealer-apps/redis:6.2.5
    33  * registry.cn-qingdao.aliyuncs.com/sealer-apps/mongodb:4.4.8
    34  * registry.cn-qingdao.aliyuncs.com/sealer-apps/postgresql:11.12.0
    35  * registry.cn-qingdao.aliyuncs.com/sealer-apps/cassandra:4.0.0
    36  * registry.cn-qingdao.aliyuncs.com/sealer-apps/tidb:v1.2.1
    37  * registry.cn-qingdao.aliyuncs.com/sealer-apps/cockroach:v21.1.7
    38  
    39  #### Message queue image
    40  
    41  * registry.cn-qingdao.aliyuncs.com/sealer-apps/kafka:2.8.0
    42  * registry.cn-qingdao.aliyuncs.com/sealer-apps/zookeeper:3.7.0
    43  * registry.cn-qingdao.aliyuncs.com/sealer-apps/rocketmq:4.5.0
    44  
    45  #### Application image
    46  
    47  * registry.cn-qingdao.aliyuncs.com/sealer-apps/dashboard:v2.2.0
    48  * registry.cn-qingdao.aliyuncs.com/sealer-apps/prometheus-stack:v2.28.1
    49  * registry.cn-qingdao.aliyuncs.com/sealer-apps/loki-stack-promtail:v2.2.0
    50  * registry.cn-qingdao.aliyuncs.com/sealer-apps/loki-stack-fluentbit:v2.2.0
    51  * registry.cn-beijing.aliyuncs.com/mahmut/kube-prometheus-stack:0.53.1
    52  * registry.cn-beijing.aliyuncs.com/mahmut/loki-stack-fluentbit:2.2.0
    53  * registry.cn-beijing.aliyuncs.com/mahmut/loki-stack-promtail:2.2.0
    54  * registry.cn-beijing.aliyuncs.com/mahmut/skywaking:8.0.1
    55  
    56  ## How to run it
    57  
    58  ### Apply a cluster
    59  
    60  you can modify the image name and save it as "clusterfile.yaml", then run sealer apply
    61  cmd  `sealer apply -f clusterfile.yaml`
    62  
    63  ```yaml
    64  apiVersion: zlink.aliyun.com/v1alpha1
    65  kind: Cluster
    66  metadata:
    67    creationTimestamp: null
    68    name: my-cluster
    69  spec:
    70    certSANS:
    71      - aliyun-inc.com
    72      - 10.0.0.2
    73    image: { your cloud image name }
    74    masters:
    75      count: "3"
    76      cpu: "4"
    77      dataDisks:
    78        - "100"
    79      memory: "4"
    80      systemDisk: "100"
    81    network:
    82      podCIDR: 100.64.0.0/10
    83      svcCIDR: 10.96.0.0/22
    84    nodes:
    85      count: "3"
    86      cpu: "4"
    87      dataDisks:
    88        - "100"
    89      memory: "4"
    90      systemDisk: "100"
    91    provider: ALI_CLOUD
    92    ssh:
    93      passwd: Seadent123
    94      pk: xxx
    95      pkPasswd: xxx
    96      user: root
    97  ```
    98  
    99  if you want to apply a cloud image which need persistence storage. we provide openebs as cloud storage backend. OpenEBS
   100  provides block volume support through the iSCSI protocol. Therefore, the iSCSI client (initiator) presence on all
   101  Kubernetes nodes is required. Choose the platform below to find the steps to verify if the iSCSI client is installed and
   102  running or to find the steps to install the iSCSI client.For openebs, different storage engine need to config different
   103  prerequisite. more to see [openebs website](https://openebs.io).
   104  
   105  We provide plugin mechanism, you only need to append below example to "clusterfile.yaml" and apply them together.
   106  
   107  For example, if we use jiva engine as storage backend :
   108  
   109  ```yaml
   110  apiVersion: sealer.aliyun.com/v1alpha1
   111  kind: Plugin
   112  metadata:
   113    name: SHELL
   114  spec:
   115    action: PostInstall
   116    on: role=node
   117    data: |
   118      if type yum >/dev/null 2>&1;then
   119      yum -y install iscsi-initiator-utils
   120      systemctl enable iscsid
   121      systemctl start iscsid
   122      elif type apt-get >/dev/null 2>&1;then
   123      apt-get update
   124      apt-get -y install open-iscsi
   125      systemctl enable iscsid
   126      systemctl start iscsid
   127      fi
   128  ---
   129  ```
   130  
   131  ## How to use it
   132  
   133  See README.md of each application for more details.
   134  
   135  ## How to rebuild it
   136  
   137  Use it as base image to build another useful image .For example, use helm image to build a mysql CloudImage:
   138  
   139  ### Use helm
   140  
   141  Kubefile:
   142  
   143  ```shell
   144  # base CloudImage contains all the files that run a kubernetes cluster needed.
   145  #    1. kubernetes components like kubectl kubeadm kubelet and apiserver images ...
   146  #    2. docker engine, and a private registry
   147  #    3. config files, yaml, static files, scripts ...
   148  FROM registry.cn-qingdao.aliyuncs.com/sealer-apps/helm:v3.6.0
   149  # add helm repo and run helm install
   150  CMD helm repo add bitnami https://charts.bitnami.com/bitnami && helm install my-mysql bitnami/mysql --version 8.8.5
   151  ```
   152  
   153  run below command to build a mysql cloud image
   154  
   155  ```shell
   156  sealer build -t registry.cn-qingdao.aliyuncs.com/sealer-apps/mysql:8.8.5 -m cloud .
   157  ```
   158  
   159  ### Use manifest
   160  
   161  Kubefile:
   162  
   163  See each manifest yaml file under application manifest directory for details , and modify it according to your needs.
   164  
   165  Then run below command to rebuild it
   166  
   167  ```shell
   168  sealer build -t {Your Image Name} -f Kubefile -m cloud .
   169  ```