Skip to content

Examples

Real-world examples for common xcsh use cases.

Contents

Example Description
AI Assistant Guide Using the AI assistant for natural language queries
Load Balancers HTTP and TCP load balancer configuration
Cloud Sites AWS and Azure site deployment

Quick Examples

List All Namespaces

xcsh tenant_and_identity list namespace

Output:

NAME           DESCRIPTION
default        Default namespace
shared         Shared namespace
system         System namespace

Create Resource from File

xcsh virtual create http_loadbalancer -f lb.yaml

Get Resource as YAML

xcsh virtual get http_loadbalancer example-lb -o yaml

Output:

metadata:
  name: example-lb
  namespace: default
spec:
  domains:
    - example.com

Delete Resource

xcsh virtual delete http_loadbalancer example-lb -ns example-namespace

Common Workflows

Deploy HTTP Load Balancer

  1. Create an origin pool:
xcsh virtual create origin_pool -f origin-pool.yaml
  1. Create a health check:
xcsh virtual create healthcheck -f healthcheck.yaml
  1. Create the load balancer:
xcsh virtual create http_loadbalancer -f lb.yaml
  1. Verify deployment:
xcsh virtual get http_loadbalancer example-lb -ns example-namespace

Update Configuration

  1. Export current configuration:
xcsh virtual get http_loadbalancer example-lb -ns example-namespace -o yaml > lb.yaml
  1. Edit the file as needed

  2. Apply changes:

xcsh virtual replace http_loadbalancer example-lb -ns example-namespace -f lb.yaml

Cleanup Resources

# Delete load balancer
xcsh virtual delete http_loadbalancer example-lb -ns example-namespace

# Delete origin pool
xcsh virtual delete origin_pool example-pool -ns example-namespace

# Delete health check
xcsh virtual delete healthcheck example-hc -ns example-namespace