Install Budibase in Kubernetes cluster

Kubernetes

Install Budibase in the Kubernetes cluster.

Before we can start using Budibase on Kubernetes, we must install some command line utilities. Follow the guide below to install Kubectl and Helm.

:::tip
We recommend running on K8S nodes with at least 2GB of memory, but for higher capacity use cases we recommend larger instances.
:::

Install a Kubernetes cluster

If you don't already have an existing Kubernetes cluster, follow one of the following guides for your provider.

Install Budibase Helm Chart

Now that your Kubernetes cluster is up and running, you can now install the Budibase helm chart, which will provide all the relevant infrastructure for running Budibase in a K8S environment. Run the following commands to download the helm chart from our repository, and install it.

::: tip
You must install Budibase in a Kubernetes namespace named Budibase. This helps isolate Budibase resources from the rest of the cluster.
:::

helm repo add budibase https://budibase.github.io/budibase/
helm repo update
helm install --create-namespace --namespace budibase budibase budibase/budibase

Wait for a while, Budibase will create all containers and resources. Then you can run:

kubectl get pods -n budibase

You should now be able to see the Budibase installer up and running in your K8S cluster.

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-YuOc9IiB-1650374896976)(https://res.cloudinary.com/daog6scxm/image/upload/v1646670651/docs /Screenshot_2021-08-16_at_22.19.58_pnzppx.png)]

You need to get the IP address of the ingress controller. Budibase utilizes NGINX ingress controller to direct incoming traffic to other Budibase services.

You can access the Budibase installation using the IP address of the ingress controller, which you can obtain with the following command:

kubectl get ingress -n budibase

Visit the entry URL in your browser and you will see the Budibase installation up and running.

Budibase management interface

Upgrade Chart

To get the latest and greatest, you can run the following command to update the repo and install the latest Budibase Helm Chart into your environment!

helm repo update
helm upgrade budibase-kubernetes budibase/budibase

configuration

load balancing

By default, Budibase configures a basic NGINX ingress controller to route traffic to your Budibase service. If you want to run your own load balancer, you can turn off the NGINX ingress controller bundled with Budibase and run your own ingress controller.

ingress:
  nginx: false
  aws: true

Use a custom domain name

If you installed with a custom domain name, you need to add it to the host section of the ingress controller in values.yaml. Notice how we added yourdomain.com. You should then be able to add an A record to your DNS provider pointing to your ingress controller's URL.

ingress:
  enabled: true
  nginx: true
  className: ""
  annotations: 
    kubernetes.io/ingress.class: nginx
  hosts:
    - host: yourdomain.com
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: proxy-service
            port:
              number: 10000 

Extend Budibase

You can scale nodes in your installation by updating the replicaCount for a given service in the values.yaml of the Budibase helm chart. For example, if we want to scale up the worker and app service due to high load, we can update our values.yaml to have a higher replicaCount. After updating, upgrade your chart to apply the changes.

services:
  dns: cluster.local

  proxy:
    port: 10000
    replicaCount: 1

  apps:
    port: 4002
    replicaCount: 2
    logLevel: info

  worker:
    port: 4001
    replicaCount: 2

Secret management

If you set createSecrets to true in values.yaml, budibase will create the following credentials for you:

  • internal API key, which can be used for API requests.
  • A JWT Secret
  • Object storage access key (if using MinIO)
  • Object storage key (if using MinIO)

If you need to read the value of a key, you can use kubectl with the following command to read the value from a k8s key:

# for internal API key
kubectl get secret budibase-budibase -o go-template='{
   
   { .data.internalApiKey }}' -n budibase | base64 --decode

# JWT secret
kubectl get secret budibase-budibase -o go-template='{
   
   { .data.jwtSecret }}' -n budibase | base64 --decode

# MinIO Access Key
kubectl get secret budibase-budibase -o go-template='{
   
   { .data.objectStoreAccess }}' -n budibase | base64 --decode

# MinIO Secret Key
kubectl get secret budibase-budibase -o go-template='{
   
   { .data.objectStoreSecret }}' -n budibase | base64 --decode

Redis

The Budibase helm chart comes with a Redis server included by default. If you want to use your own external Redis cluster, you can configure the values.yaml file in the helm chart, and turn off one of Budibase by enabling off. If you want to bypass the default bundled Redis and use an external Redis cluster hosted on myrediscluster.io, your configuration might look like this.

  redis:
    enabled: false # disable if using external redis
    port: 6379
    replicaCount: 1
    host: "myrediscluster.io"
    password: "your-redis-password"

CouchDB

The Budibase helm chart will automatically start a 3-node couchDB cluster in your environment. If you prefer to use an existing CouchDB instance, you can switch off the one provided by Budibase and point to your own instance. Please note - you must have search installed in your CouchDB cluster to use all search features provided by Budibase. Here is an example configuration of how to point Budibase to a CouchDB installation hosted on mycouch.io:

  couchdb:
    enabled: false
    replicaCount: 3
    url: "http://mycouch.io:1234"
    user: "couchuser"
    password: "couchpassword"

MinIO / Amazon S3

Budibase ships with a MinIO server for object storage. Since MinIO is compatible with Amazon S3, you can switch the bundled MinIO for S3 buckets in your AWS account. This is what values.yaml should look like if you want to use S3 instead of MinIO.

  objectStore:
    minio: false
    browser: false
    port: 9000
    replicaCount: 1
    accessKey: "your-access-key" # AWS_ACCESS_KEY
    secretKey: "your-secret-key" # AWS_SECRET_ACCESS_KEY

troubleshooting

Connection issues in the cluster

Make sure your Budibase installation is running in the Budibase namespace in Kubernetes. The proxy that routes traffic to the Budibase service relies on this.

Still have questions?

If you need help or find a bug, please file a discussion on our GitHub discussion forum. For Kubernetes installations, try to include the following information in your discussions:

Which K8S provider you are using (AWS/MiniKube etc.)
A screenshot/log of the error that is happening A
screenshot of your values.yaml if you changed any configuration
Anything else related to the issue you are having .

Guess you like

Origin blog.csdn.net/weixin_42553583/article/details/124284125