|
| 1 | +# Choose Native Plants Application (Live Cluster) |
| 2 | + |
| 3 | +This README provides instructions for deploying and managing the Choose Native Plants application in the live Kubernetes cluster. |
| 4 | + |
| 5 | +## Deployment Process |
| 6 | + |
| 7 | +1. Update the `.holo/sources/choose-native-plants.toml` file to point to the new version tag: |
| 8 | + |
| 9 | +```toml |
| 10 | +[holosource] |
| 11 | +url = "https://github.com/CodeForPhilly/pa-wildflower-selector" |
| 12 | +ref = "refs/tags/vX.Y.Z" # Replace with the new version tag |
| 13 | +``` |
| 14 | + |
| 15 | +2. Update the `release-values.yaml` file with any necessary changes (e.g., new version number): |
| 16 | + |
| 17 | +```yaml |
| 18 | +app: |
| 19 | + image: |
| 20 | + tag: "X.Y.Z" # Replace with the new version number (without the 'v' prefix) |
| 21 | +``` |
| 22 | +
|
| 23 | +Ensure that the version in both files match (with the toml file using the 'v' prefix and release-values.yaml without it). |
| 24 | +
|
| 25 | +3. Create or update any sealed secrets as needed: |
| 26 | +
|
| 27 | +```powershell |
| 28 | +# Create a regular Kubernetes secret YAML file |
| 29 | +# Example for PAC API credentials |
| 30 | +kubectl create secret generic pac-api --from-literal=PAC_API_BASE_URL=https://app.plantagents.org --from-literal=PAC_API_KEY=your-api-key --dry-run=client -o yaml > pac-api-secret.yaml |
| 31 | + |
| 32 | +# Seal the secret |
| 33 | +kubeseal --cert https://sealed-secrets.live.k8s.phl.io/v1/cert.pem --namespace choose-native-plants -f pac-api-secret.yaml -w cfp-live-cluster/choose-native-plants.secrets/pac-api.yaml |
| 34 | +``` |
| 35 | + |
| 36 | +4. Commit and push the changes to the repository: |
| 37 | + |
| 38 | +```powershell |
| 39 | +git add release-values.yaml choose-native-plants.secrets/ |
| 40 | +git commit -m "Update Choose Native Plants configuration" |
| 41 | +git push origin main |
| 42 | +``` |
| 43 | + |
| 44 | +4. The GitOps process will automatically deploy the changes to the live cluster. |
| 45 | + |
| 46 | +## Important Notes |
| 47 | + |
| 48 | +- Direct Helm commands are not used in the live environment. All changes are applied through the GitOps workflow using materialized manifests. |
| 49 | +- The deployment may take some time to complete after pushing changes. |
| 50 | +- Monitor the pod status to verify the deployment: `kubectl get pods -n choose-native-plants` |
| 51 | +- The application is accessible at: |
| 52 | + - https://choose-native-plants.live.k8s.phl.io/ |
| 53 | + - https://choosenativeplants.com/ |
| 54 | + - https://www.choosenativeplants.com/ |
| 55 | + |
| 56 | +## Managing the Application |
| 57 | + |
| 58 | +### Syncing Images |
| 59 | + |
| 60 | +To sync images with the Linode Object Storage, use this command which automatically finds the current pod: |
| 61 | + |
| 62 | +```powershell |
| 63 | +$POD_NAME = kubectl get pods -n choose-native-plants -l app.kubernetes.io/name=choose-native-plants -o jsonpath='{.items[0].metadata.name}' |
| 64 | +kubectl exec -it $POD_NAME -n choose-native-plants -c choose-native-plants-app -- /bin/sh /app/scripts/sync-images |
| 65 | +``` |
| 66 | + |
| 67 | +### Downloading Data (Skip Images) |
| 68 | + |
| 69 | +To download data without images, use this command: |
| 70 | + |
| 71 | +```powershell |
| 72 | +$POD_NAME = kubectl get pods -n choose-native-plants -l app.kubernetes.io/name=choose-native-plants -o jsonpath='{.items[0].metadata.name}' |
| 73 | +kubectl exec -it $POD_NAME -n choose-native-plants -c choose-native-plants-app -- node download --skip-images |
| 74 | +``` |
| 75 | + |
| 76 | +### Massaging Data |
| 77 | + |
| 78 | +To process the data, use this command: |
| 79 | + |
| 80 | +```powershell |
| 81 | +$POD_NAME = kubectl get pods -n choose-native-plants -l app.kubernetes.io/name=choose-native-plants -o jsonpath='{.items[0].metadata.name}' |
| 82 | +kubectl exec -it $POD_NAME -n choose-native-plants -c choose-native-plants-app -- node massage |
| 83 | +``` |
0 commit comments