- Delete rollout-restart.sh as it was just a simple oc command - Update README.md to show direct oc rollout restart command - Simplify workflow: git push -> GitHub Actions -> oc rollout restart - Keep only essential scripts: deploy-complete.sh, build-and-push.sh, undeploy-complete.sh
2.7 KiB
2.7 KiB
OpenShift Resource Governance Tool - Scripts
Overview
This directory contains scripts for building, deploying, and updating the OpenShift Resource Governance Tool.
Scripts
1. deploy-complete.sh - Initial Deployment
Purpose: Complete deployment from scratch When to use: First time deployment or when you need to recreate everything
What it does:
- Creates namespace
- Applies RBAC (ServiceAccount, ClusterRole, ClusterRoleBinding)
- Applies ConfigMap
- Creates ServiceAccount token secret
- Deploys application
- Creates Service and Route
- Configures TLS
Usage:
./scripts/deploy-complete.sh
2. Updates (Recommended)
Purpose: Update existing deployment with new image When to use: After code changes and GitHub Actions has built new image
Simple command:
oc rollout restart deployment/resource-governance -n resource-governance
With status check:
oc rollout restart deployment/resource-governance -n resource-governance
oc rollout status deployment/resource-governance -n resource-governance
2. build-and-push.sh - Manual Build
Purpose: Build and push image manually (when GitHub Actions is not available) When to use: Manual builds or when GitHub Actions is not working
What it does:
- Builds container image with Podman
- Tests image
- Pushes to Quay.io registry
Usage:
# Login to Quay.io first
podman login quay.io
# Then build and push
./scripts/build-and-push.sh
3. undeploy-complete.sh - Cleanup
Purpose: Remove all resources When to use: When you want to completely remove the application
Usage:
echo 'yes' | ./scripts/undeploy-complete.sh
Recommended Workflow
For Development Updates (Most Common):
- Make code changes
git add . && git commit -m "Your changes" && git push- Wait for GitHub Actions to build new image
oc rollout restart deployment/resource-governance -n resource-governance
For Initial Deployment:
./scripts/deploy-complete.sh
For Manual Build (if needed):
podman login quay.io./scripts/build-and-push.shoc rollout restart deployment/resource-governance -n resource-governance
Security Notes
- No hardcoded credentials: All scripts require manual login to Quay.io
- Common functions: Shared code is in
common.shto avoid duplication - Error handling: All scripts have proper error checking and validation
Troubleshooting
- Not connected to cluster: Run
oc loginfirst - Deployment not found: Run
./scripts/deploy-complete.shfirst - Image not found: Ensure GitHub Actions completed successfully or run
./scripts/build-and-push.sh