Sessions
A session is a time-bound training event where participants receive access to isolated environments. Sessions can exist within a seminar or as standalone events.
What is a Session?
Sessions are the core unit of training delivery in Teabar:
- Time-bound: Has a defined start and end time
- Environment provisioning: Creates environments for participants
- Automatic cleanup: Resources are released when the session ends
- Activity tracking: Monitor what participants do during the session
┌─────────────────────────────────────────────────────────────┐
│ Session: "K8s Basics" │
│ June 15, 09:00 - 13:00 │
│ │
│ Blueprint: kubernetes-training │
│ Isolation: namespace │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Participant Environments │ │
│ │ │ │
│ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │
│ │ │ Alice │ │ Bob │ │ Charlie │ ... │ │
│ │ │ ns-001 │ │ ns-002 │ │ ns-003 │ │ │
│ │ └─────────┘ └─────────┘ └─────────┘ │ │
│ │ │ │
│ │ Shared Kubernetes Cluster │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘ Session Types
Within a Seminar
Sessions that are part of a larger training program:
# Create session in a seminar
teactl session create
--seminar kubernetes-101
--name "day1-basics"
--blueprint k8s-basic
--start "2024-06-15 09:00"
--duration 4h Standalone Sessions
One-off workshops or labs without a parent seminar:
# Create standalone session
teactl session create
--name "docker-workshop"
--blueprint docker-training
--start "2024-06-20 14:00"
--duration 3h
--org acme-training Creating Sessions
Basic Creation
# Create with required options
teactl session create
--name "kubernetes-workshop"
--blueprint kubernetes-training
--start "2024-06-15 09:00"
--duration 4h
# Create with participant limit
teactl session create
--name "kubernetes-workshop"
--blueprint kubernetes-training
--start "2024-06-15 09:00"
--duration 4h
--max-participants 25 Participant Isolation Modes
Configure how participants are isolated within a session:
# Namespace isolation (shared cluster, isolated namespaces)
teactl session create
--name "k8s-workshop"
--blueprint k8s-basic
--isolation namespace
--start "2024-06-15 09:00"
--duration 4h
# Cluster isolation (dedicated cluster per participant)
teactl session create
--name "k8s-advanced"
--blueprint k8s-full
--isolation cluster
--start "2024-06-15 09:00"
--duration 4h
# VM isolation (dedicated VM per participant)
teactl session create
--name "linux-admin"
--blueprint linux-vm
--isolation vm
--start "2024-06-15 09:00"
--duration 4h | Isolation Mode | Description | Best For |
|---|---|---|
namespace | Shared infrastructure, K8s namespace per participant | Cost-effective, basic K8s training |
cluster | Dedicated cluster per participant | Advanced K8s, cluster-admin exercises |
vm | Dedicated VM per participant | OS-level training, full root access |
Note
Session Lifecycle
Sessions progress through these states:
| State | Description |
|---|---|
scheduled | Session created, waiting for start time |
provisioning | Start time reached, environments being created |
active | All environments ready, session in progress |
extending | Duration being extended |
ending | Session ending, cleanup in progress |
completed | Session finished, environments destroyed |
cancelled | Session cancelled before starting |
# View session status
teactl session status kubernetes-workshop
# Output:
# Session: kubernetes-workshop
# State: active
# Started: 2024-06-15 09:00 UTC
# Ends: 2024-06-15 13:00 UTC
# Time remaining: 2h 34m
#
# Participants: 18/25
# Environments:
# ready: 18
# creating: 0
# failed: 0 Adding Participants
Direct Addition
# Add by email
teactl session participant add kubernetes-workshop
--email [email protected]
# Add multiple
teactl session participant add kubernetes-workshop
--emails [email protected],[email protected],[email protected]
# Import from file
teactl session participant import kubernetes-workshop
--file participants.csv Self-Registration
# Generate registration link
teactl session register-link kubernetes-workshop
# Output:
# Registration URL: https://teabar.dev/join/abc123xyz
# Valid until: 2024-06-15 09:00 UTC
# Slots remaining: 25 Participant Access Methods
Participants can access their environments through multiple methods:
Web Terminal
# Get web access URL
teactl session participant kubernetes-workshop [email protected]
# Output includes:
# Web Terminal: https://teabar.dev/terminal/env-abc123 Unique Access Links
Each participant receives a unique URL to access their environment:
# Send access links to all participants
teactl session notify kubernetes-workshop --send-access-links
# Get specific participant's link
teactl session access-link kubernetes-workshop --participant [email protected] Kubeconfig Download
For Kubernetes environments:
# Participant downloads their kubeconfig
teactl env kubeconfig kubernetes-workshop-alice-001 > ~/.kube/config
# Or use directly
export KUBECONFIG=$(teactl env kubeconfig kubernetes-workshop-alice-001)
kubectl get pods SSH Access
For VM-based environments:
# Get SSH connection info
teactl session ssh kubernetes-workshop --participant [email protected]
# Direct SSH
teactl env ssh kubernetes-workshop-alice-001 Activity Tracking
Monitor what participants do during the session:
# View activity summary
teactl session activity kubernetes-workshop
# View specific participant's activity
teactl session activity kubernetes-workshop --participant [email protected]
# Real-time activity stream
teactl session activity kubernetes-workshop --follow Tracked Activities
| Activity Type | Description |
|---|---|
git.* | Git operations (push, pull, clone, commit) |
kubectl.* | Kubernetes API calls |
shell.* | Terminal commands |
pipeline.* | CI/CD pipeline runs |
milestone.* | Custom checkpoint events |
# Filter by activity type
teactl session activity kubernetes-workshop --type kubectl
# Export activity log
teactl session activity kubernetes-workshop --export json > activity.json Checkpoints
Save and restore environment state during sessions:
# Create checkpoint for participant
teactl session checkpoint create kubernetes-workshop
--participant [email protected]
--name "after-deployment"
# Restore to checkpoint
teactl session checkpoint restore kubernetes-workshop
--participant [email protected]
--name "after-deployment"
# Create checkpoint for all participants
teactl session checkpoint create kubernetes-workshop
--all
--name "starting-point" Tip
Session Management
Extending Duration
# Extend for all participants
teactl session extend kubernetes-workshop --duration 1h
# Extend for specific participant
teactl session extend kubernetes-workshop
--participant [email protected]
--duration 30m Resetting Environments
# Reset single participant's environment
teactl session reset kubernetes-workshop
--participant [email protected]
# Reset all failed environments
teactl session reset kubernetes-workshop --failed
# Reset to specific checkpoint
teactl session reset kubernetes-workshop
--participant [email protected]
--checkpoint "starting-point" Monitoring
# Open live dashboard
teactl session dashboard kubernetes-workshop --open
# View resource utilization
teactl session resources kubernetes-workshop
# Check for issues
teactl session health kubernetes-workshop Notifications
Configure automated notifications:
# Set up session notifications
teactl session notify kubernetes-workshop
--on-ready "Your environment is ready at {access_url}"
--on-warning "30 minutes remaining"
--on-ending "Session ending in 5 minutes"
# Send custom message
teactl session message kubernetes-workshop
--subject "Break time!"
--body "We'll resume in 15 minutes" Concurrent Sessions
Multiple sessions can run simultaneously:
# Within same seminar
teactl session create --seminar k8s-101 --name "morning-cohort" ...
teactl session create --seminar k8s-101 --name "afternoon-cohort" ...
# List active sessions
teactl session list --state active Session Cleanup
Sessions clean up automatically when they end:
# View cleanup status
teactl session status kubernetes-workshop --cleanup
# Force early cleanup
teactl session end kubernetes-workshop
# End but keep environments
teactl session end kubernetes-workshop --keep-environments
# Cancel scheduled session
teactl session cancel kubernetes-workshop Costs
Track session costs in real-time:
# View current costs
teactl session cost kubernetes-workshop
# Output:
# Session: kubernetes-workshop
# Duration: 4 hours
# Participants: 18
#
# Current costs:
# Compute: $32.40
# Storage: $1.80
# Network: $0.90
# Platform: $5.40
# Total: $40.50
#
# Projected final: $54.00
# Per participant: $3.00 Best Practices
- Start provisioning early: Use
--pre-provisionto create environments before the session start time - Set realistic durations: Add 30-60 minute buffer for late starters
- Test your blueprint: Run a single-participant test session first
- Enable monitoring: Watch the dashboard during the session
- Create starting checkpoints: Allow easy recovery if participants break things
- Configure notifications: Keep participants informed about time remaining