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

     1  # Overview
     2  
     3  This image chooses OpenEBS LocalPV as its persistence storage engine.
     4  
     5  Components included in this image:
     6  
     7  * 1 StatefulSet with 3 replicas for cassandra cluster which requests "80Gi" storage.
     8  
     9  ## How to use it
    10  
    11  CockroachDB can be accessed via port 26257 at the following DNS name from within your cluster:
    12  
    13  my-cockroachdb-public.cockroachdb-system.svc.cluster.local
    14  
    15  Because CockroachDB supports the PostgreSQL wire protocol, you can connect to the cluster using any available PostgreSQL
    16  client.
    17  
    18  For example, you can open up a SQL shell to the cluster by running:
    19  
    20  ```
    21  kubectl run -it --rm cockroach-client \
    22      --image=cockroachdb/cockroach \
    23      --restart=Never \
    24      --command -- \
    25      ./cockroach sql --insecure --host=my-cockroachdb-public.cockroachdb-system
    26  ```
    27  
    28  From there, you can interact with the SQL shell as you would any other SQL shell, confident that any data you write will
    29  be safe and available even if parts of your cluster fail.
    30  
    31  Finally, to open up the CockroachDB admin UI, you can port-forward from your local machine into one of the instances in
    32  the cluster:
    33  
    34  ```
    35  kubectl port-forward my-cockroachdb-0 8080
    36  ```
    37  
    38  Then you can access the admin UI at [http://localhost:8080/](http://localhost:8080/) in your web browser.
    39  
    40  For more information on using CockroachDB, please see the project's docs at [CockroachDB official website](https://www.cockroachlabs.com/docs/).
    41  
    42  ## How to rebuild it use helm
    43  
    44  Kubefile:
    45  
    46  ```shell
    47  FROM registry.cn-qingdao.aliyuncs.com/sealer-apps/openebs-localpv:2.11.0
    48  # add helm repo and run helm install
    49  RUN helm repo add cockroachdb https://charts.cockroachdb.com/
    50  # set persistence.storageClass=local-hostpath, which is provided by base image openebs-localpv:2.11.0.
    51  CMD helm install my-cockroachdb --create-namespace --namespace cockroachdb-system --set persistence.storageClass=local-hostpath cockroachdb/cockroachdb --version 6.0.9
    52  ```
    53  
    54  run below command to build it
    55  
    56  ```shell
    57  sealer build -t {Your Image Name} -f Kubefile -m cloud .
    58  ```
    59  
    60  More parameters see [official document here](https://artifacthub.io/packages/helm/cockroachdb/cockroachdb).