@@ -795,6 +795,205 @@ tasks:
795795 cmds :
796796 - echo "All tests completed successfully"
797797
798+ # Documentation generation tasks
799+ docs:helm:generate :
800+ desc : Generate Helm chart documentation from templates
801+ deps : [add:repos:helm, update:deps:helm]
802+ cmds :
803+ - echo "Generating Helm chart documentation..."
804+ - |
805+ # Make sure helm-docs is installed
806+ if ! command -v helm-docs &> /dev/null; then
807+ echo "❌ helm-docs is not installed. Please install it from https://github.com/norwoodj/helm-docs"
808+ exit 1
809+ fi
810+
811+ # Run helm-docs for each chart
812+ for chart in {{.CHARTS}}; do
813+ echo "Generating documentation for $chart chart..."
814+ cd {{.CHART_DIR}}/$chart && helm-docs -t README.md.gotmpl -t README_CHANGELOG.md.gotmpl -t README_CONFIG.md.gotmpl
815+ done
816+
817+ echo "✅ Helm chart documentation generated successfully."
818+
819+ docs:helm:check :
820+ desc : Check if Helm chart documentation is up to date
821+ deps : [add:repos:helm, update:deps:helm]
822+ cmds :
823+ - echo "Checking if Helm chart documentation is up to date..."
824+ - |
825+ # Make sure helm-docs is installed
826+ if ! command -v helm-docs &> /dev/null; then
827+ echo "❌ helm-docs is not installed. Please install it from https://github.com/norwoodj/helm-docs"
828+ exit 1
829+ fi
830+
831+ docs_outdated=false
832+
833+ # For each chart, generate docs to a temp dir and compare with current docs
834+ for chart in {{.CHARTS}}; do
835+ echo "Checking documentation for $chart chart..."
836+
837+ # Create temp directory
838+ tmp_dir=$(mktemp -d)
839+ trap 'rm -rf "$tmp_dir"' EXIT
840+
841+ # Copy current README.md to temp dir
842+ readme_path="{{.CHART_DIR}}/$chart/README.md"
843+ tmp_readme="$tmp_dir/README.md"
844+
845+ if [ -f "$readme_path" ]; then
846+ cp "$readme_path" "$tmp_readme"
847+ else
848+ echo "⚠️ README.md not found for $chart chart. This check will only be useful after docs are generated."
849+ touch "$tmp_readme" # Create empty file for comparison
850+ fi
851+
852+ # Generate fresh docs
853+ cd {{.CHART_DIR}}/$chart && helm-docs -t README.md.gotmpl -t README_CHANGELOG.md.gotmpl -t README_CONFIG.md.gotmpl -o "$tmp_dir"
854+
855+ # Compare with current docs
856+ if [ -f "$readme_path" ] && ! diff -q "$readme_path" "$tmp_readme" > /dev/null; then
857+ echo "❌ Documentation for $chart chart is outdated. Run 'task docs:helm:generate' to update."
858+ docs_outdated=true
859+ else
860+ echo "✅ Documentation for $chart chart is up to date."
861+ fi
862+ done
863+
864+ # Exit with error if any docs are outdated
865+ if [ "$docs_outdated" = true ]; then
866+ echo "❌ Some chart documentation files are outdated. Run 'task docs:helm:generate' to update them."
867+ exit 1
868+ else
869+ echo "✅ All chart documentation is up to date."
870+ fi
871+
872+ docs:kots:summary :
873+ desc : Generate a summary of KOTS manifest files for platform engineers
874+ cmds :
875+ - echo "Generating KOTS manifest summary in docs/KOTS_MANIFEST_GUIDE.md..."
876+ - |
877+ # Create docs directory if it doesn't exist
878+ mkdir -p docs
879+
880+ # Generate the summary document
881+ cat > docs/KOTS_MANIFEST_GUIDE.md << 'EOF'
882+ # MLflow KOTS Manifest Guide
883+
884+ This document provides a technical overview of the Replicated KOTS manifests used to package and deliver the MLflow application.
885+
886+ ## Overview
887+
888+ The manifests in the `applications/mlflow/kots` directory define how MLflow is packaged, configured, and deployed using the Replicated platform.
889+
890+ ## Key Files and Their Purpose
891+
892+ ### kots-app.yaml
893+
894+ Defines the core application properties:
895+ - Application metadata (name, icon, description)
896+ - Status informers for monitoring deployment health
897+ - Port definitions for services
898+ - Release notes handling
899+
900+ ### kots-config.yaml
901+
902+ Contains all user-configurable settings presented during installation:
903+ - Database configuration (embedded PostgreSQL or external)
904+ - S3 storage settings (embedded MinIO or external S3)
905+ - Networking and ingress configuration
906+ - Resource allocation settings
907+
908+ Each configuration option includes:
909+ - Type (string, boolean, password, etc.)
910+ - Default values
911+ - Validation rules
912+ - Help text for users
913+ - Dependencies/when conditions
914+
915+ ### mlflow-chart.yaml
916+
917+ A HelmChart custom resource that:
918+ - References the MLflow Helm chart
919+ - Maps configuration values from user inputs to Helm values
920+ - Defines conditional logic for different deployment scenarios
921+ - Uses templating functions to insert configuration values
922+
923+ ### infra-chart.yaml
924+
925+ Similar to mlflow-chart.yaml but for infrastructure components:
926+ - Configures supporting services (databases, object storage)
927+ - Typically deployed before the main application
928+
929+ ### kots-preflight.yaml
930+
931+ Defines preflight checks to validate the environment before installation:
932+ - Kubernetes version compatibility
933+ - Resource availability (CPU, memory)
934+ - Namespace access permissions
935+ - Storage class availability
936+
937+ ### k8s-app.yaml
938+
939+ Kubernetes Application custom resource for discovery and management.
940+
941+ ### ec.yaml
942+
943+ EntitlementSpec that controls:
944+ - License entitlements and limits
945+ - Feature flags based on license tier
946+ - Usage restrictions
947+
948+ ## Best Practices for Modifications
949+
950+ When making changes to these files:
951+
952+ 1. **Version Consistency**: Update both Helm chart versions and kots-chart references
953+ 2. **Testing**: Test with both new installations and upgrades
954+ 3. **Config Options**: When adding new config options:
955+ - Provide meaningful default values
956+ - Include clear help text
957+ - Consider when dependencies for conditional display
958+ 4. **Templates**: Use consistent templating patterns
959+ 5. **Preflight Checks**: Update preflight checks when requirements change
960+
961+ ## Common Tasks
962+
963+ ### Adding a New Configuration Option
964+
965+ 1. Add the option to `kots-config.yaml` with appropriate metadata
966+ 2. Reference the value in `mlflow-chart.yaml` using template functions
967+ 3. Update preflight checks if the option affects requirements
968+
969+ ### Updating Helm Chart Versions
970+
971+ 1. Update the chartVersion in both infra-chart.yaml and mlflow-chart.yaml
972+ 2. Run `task update:versions:chart` to ensure consistency
973+ 3. Test both installation and upgrade scenarios
974+
975+ ### Adding Support for a New Feature
976+
977+ 1. First, implement the feature in the Helm chart
978+ 2. Add any new configuration options to kots-config.yaml
979+ 3. Connect the configuration to the Helm values in the chart files
980+ 4. Optionally add preflight checks for any new requirements
981+ 5. Test with both embedded and external dependencies
982+
983+ ## Troubleshooting
984+
985+ Common issues when working with these files:
986+
987+ - **Template Rendering Errors**: Check template syntax in .yaml files
988+ - **Preflight Check Failures**: Ensure requirements are correctly specified
989+ - **Configuration Mismatches**: Verify config option names match between files
990+ - **Upgrade Issues**: Test upgrades from earlier versions
991+
992+ For more detailed information, refer to the [Replicated KOTS documentation](https://docs.replicated.com/vendor/packaging-kots-apps).
993+ EOF
994+
995+ echo "✅ KOTS manifest summary generated in docs/KOTS_MANIFEST_GUIDE.md"
996+
798997 # Version extraction
799998 extract:version:chart :
800999 desc : Extract and print the MLflow chart version
0 commit comments