OpenResty XRay™ Helm Deployment on Kubernetes Cluster

Name

OpenResty XRay™ Helm Deployment on Kubernetes Cluster

Table of Content

Overview

Deploying OpenResty XRay using Helm simplifies the management of the application lifecycle within a Kubernetes cluster. Helm using a packaging format called charts. Deployments usually use Helm repositories, but there is not yet support for Helm repositories for OpenResty XRay, so we’ll use local Helm chart packages for now.

Prerequisites

Before you begin, ensure you have the following:

  • A Kubernetes cluster is operational.
  • Helm CLI is installed and configured to work with your cluster.
  • Sufficient permissions to deploy applications to the cluster.
  • Knowledge of your Kubernetes cluster’s storage options, as this will be required for persistent storage configuration.

Installation

Add Helm Repository (Currently not supported)

Note: Adding the OpenResty XRay Helm repository is not supported at this time. The Helm chart will be distributed as a local package.

Install Using Local Helm Chart

  1. Download the OpenResty XRay Helm chart package provided to you, usually a .tar.gz file.

  2. Unpack the Helm chart package in a directory of your choice.

  3. Navigate to the directory where you have unpacked the Helm chart:

    cd path_to_directory/orxray
    
  4. Before proceeding with installation, it is essential to configure the values.yaml file according to your environment and needs.

Configuration

Values.yaml Overview

The values.yaml file contains all the configurable options for the OpenResty XRay Helm chart. It is crucial to review and modify this file to match your specific requirements.

Ingress Configuration

If you intend to use an Ingress controller or an Application Gateway, you must configure the Ingress section within the values.yaml file accordingly.

ingress:
  enabled: true
  annotations: {}
  # kubernetes.io/ingress.class: nginx
  # kubernetes.io/tls-acme: "true"
  paths: []
  hosts:
    - host: xray-console.example.com
      paths: ["/"]
  tls: []
  # - secretName: chart-example-tls
  #   hosts:
  #     - chart-example.local

Persistent Volume Claim Override

For persistent data storage, the persistentVolumeClaimOverride section allows you to specify custom storageClassName and volumeName. Ensure that these values are set according to the storage options available in your Kubernetes cluster.

persistentVolumeClaimOverride:
  consoleData:
    storageClassName: <your-storage-class-name>
    volumeName: <your-volume-name>

Resources Limits and Requests

Default resource requests and limits are set in the values.yaml file, but you can modify them to suit the workload of your Kubernetes nodes.

resources:
  console:
    limits:
      cpu: "2"
      memory: 4Gi
    requests:
      cpu: "500m"
      memory: 512Mi

HTTP Proxy Configuration (Optional)

In case your network requires an http proxy to connect to the Internet, you need to configure the yaml file as follows:

customInfo:
  env:
    httpProxy: "http://proxyserver.example.com:8080"
    httpProxyAuthorization: "Basic `base64 'username:password'`"

Deploy OpenResty XRay

Once the above configuration file has been confirmed for modification, to deploy OpenResty XRay to your Kubernetes cluster, execute the following command:

helm install openresty-xray ./orxray -f ./orxray/values.yaml

Basic Ops

Check Console Server Status

To check the status of the OpenResty XRay Console Server, run:

kubectl get pods -l "app.kubernetes.io/name=orxray"

View Console Server Logs

To view the logs for the OpenResty XRay Console Server:

kubectl logs -l "app.kubernetes.io/name=orxray" -c xray-console

Upgrade Components

To upgrade OpenResty XRay, first download the latest chart package and unpack it. Then run the following commands:

helm upgrade openresty-xray ./orxray -f ./orxray/values.yaml

Remember, there is no need to delete your persistent volume claims (PVCs) if they are not changing with the upgrade. Existing data will not be affected.

Conclusion

Using Helm to deploy OpenResty XRay in a Kubernetes cluster can streamline and simplify the application deployment process. Ensure you review and correctly configure your values.yaml file, especially the Ingress settings and persistent volume claims, to match your cluster’s environment and your application’s requirements.