From 6ae3880704cd715e30dcdfe0e18519dea33e95ca Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 22 Mar 2024 18:15:01 -0500 Subject: [PATCH] Website: Update build script to exclude folders with an underscore prefix & rename docs/Deploy/kubernetes/ (#17817) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: #17582 Changes: - Updated the `build-static-content` script to not generate HTML pages for files in subfolders that are prefixed with an underscore - Renamed the `docs/Deploy/kubernetes` folder » `docs/Deploy/_kubernetes` - Documented this new behavior on the communications page of the handbook. - Updated commands on the Deploy Fleet on Kubernetes page. --------- Co-authored-by: Mike McNeil --- CODEOWNERS | 2 +- docs/Deploy/Deploy-Fleet-on-Kubernetes.md | 12 ++++++------ docs/Deploy/{kubernetes => _kubernetes}/README.md | 0 .../{kubernetes => _kubernetes}/fleet-deployment.yml | 0 .../{kubernetes => _kubernetes}/fleet-migrations.yml | 0 .../{kubernetes => _kubernetes}/fleet-service.yml | 0 handbook/company/communications.md | 2 ++ website/scripts/build-static-content.js | 4 ++++ 8 files changed, 13 insertions(+), 7 deletions(-) rename docs/Deploy/{kubernetes => _kubernetes}/README.md (100%) rename docs/Deploy/{kubernetes => _kubernetes}/fleet-deployment.yml (100%) rename docs/Deploy/{kubernetes => _kubernetes}/fleet-migrations.yml (100%) rename docs/Deploy/{kubernetes => _kubernetes}/fleet-service.yml (100%) diff --git a/CODEOWNERS b/CODEOWNERS index a44b1a2d2..681373981 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -68,7 +68,7 @@ go.mod @fleetdm/go /docs/Using-Fleet/REST-API.md @rachaelshaw # « REST API reference documentation /docs/Contributing/API-for-contributors.md @rachaelshaw # « Advanced / contributors-only API reference documentation /schema @eashaw # « Data tables (osquery/fleetd schema) documentation -/docs/Deploy/kubernetes/ @dherder # « Kubernetes best practice +/docs/Deploy/_kubernetes/ @dherder # « Kubernetes best practice ############################################################################################## # 🫧 Pricing and features # diff --git a/docs/Deploy/Deploy-Fleet-on-Kubernetes.md b/docs/Deploy/Deploy-Fleet-on-Kubernetes.md index 2d3559985..c5318ccb2 100644 --- a/docs/Deploy/Deploy-Fleet-on-Kubernetes.md +++ b/docs/Deploy/Deploy-Fleet-on-Kubernetes.md @@ -8,7 +8,7 @@ There are 2 primary ways to deploy the Fleet server to a Kubernetes cluster. The We will assume you have `kubectl` and MySQL and Redis are all set up and running. Optionally you have minikube to test your deployment locally on your machine. -To deploy the Fleet server and connect to its dependencies (MySQL and Redis), we will use [Fleet's best practice `fleet-deployment.yml` file](https://github.com/fleetdm/fleet/blob/main/docs/Deploy/kubernetes/fleet-deployment.yml). +To deploy the Fleet server and connect to its dependencies (MySQL and Redis), we will use [Fleet's best practice `fleet-deployment.yml` file](https://github.com/fleetdm/fleet/blob/main/docs/Deploy/_kubernetes/fleet-deployment.yml). Let's tell Kubernetes to create the cluster by running the below command. @@ -83,14 +83,14 @@ Note: this step is not neccessary when using the Fleet Helm Chart as it handles The last step is to run the Fleet database migrations on your new MySQL server. To do this, run the following: ```sh -kubectl create -f ./docs/Deploy/kubernetes/fleet-migrations.yml +kubectl create -f ./docs/Deploy/_kubernetes/fleet-migrations.yml ``` In Kubernetes, you can only run a job once. If you'd like to run it again (i.e.: you'd like to run the migrations again using the same file), you must delete the job before re-creating it. To delete the job and re-run it, you can run the following commands: ```sh -kubectl delete -f ./docs/Deploy/kubernetes/fleet-migrations.yml -kubectl create -f ./docs/Deploy/kubernetes/fleet-migrations.yml +kubectl delete -f ./docs/Deploy/_kubernetes/fleet-migrations.yml +kubectl create -f ./docs/Deploy/_kubernetes/fleet-migrations.yml ``` #### Redis @@ -158,7 +158,7 @@ kubectl create secret tls fleet-tls --key=./tls.key --cert=./tls.crt First we must deploy the instances of the Fleet webserver. The Fleet webserver is described using a Kubernetes deployment object. To create this deployment, run the following: ```sh -kubectl apply -f ./docs/Deploy/fleet-deployment.yml +kubectl apply -f ./docs/Deploy/_kubernetes/fleet-deployment.yml ``` You should be able to get an instance of the webserver running via `kubectl get pods` and you should see the following logs: @@ -174,7 +174,7 @@ ts=2017-11-16T02:48:38.441148166Z transport=https address=0.0.0.0:443 msg=listen Now that the Fleet server is running on our cluster, we have to expose the Fleet webservers to the internet via a load balancer. To create a Kubernetes `Service` of type `LoadBalancer`, run the following: ```sh -kubectl apply -f ./docs/Deploy/fleet-service.yml +kubectl apply -f ./docs/Deploy/_kubernetes/fleet-service.yml ``` #### Configure DNS diff --git a/docs/Deploy/kubernetes/README.md b/docs/Deploy/_kubernetes/README.md similarity index 100% rename from docs/Deploy/kubernetes/README.md rename to docs/Deploy/_kubernetes/README.md diff --git a/docs/Deploy/kubernetes/fleet-deployment.yml b/docs/Deploy/_kubernetes/fleet-deployment.yml similarity index 100% rename from docs/Deploy/kubernetes/fleet-deployment.yml rename to docs/Deploy/_kubernetes/fleet-deployment.yml diff --git a/docs/Deploy/kubernetes/fleet-migrations.yml b/docs/Deploy/_kubernetes/fleet-migrations.yml similarity index 100% rename from docs/Deploy/kubernetes/fleet-migrations.yml rename to docs/Deploy/_kubernetes/fleet-migrations.yml diff --git a/docs/Deploy/kubernetes/fleet-service.yml b/docs/Deploy/_kubernetes/fleet-service.yml similarity index 100% rename from docs/Deploy/kubernetes/fleet-service.yml rename to docs/Deploy/_kubernetes/fleet-service.yml diff --git a/handbook/company/communications.md b/handbook/company/communications.md index 86b100c5b..bc96271f7 100644 --- a/handbook/company/communications.md +++ b/handbook/company/communications.md @@ -296,6 +296,8 @@ Our handbook and docs pages are written in Markdown and are editable from our we 6. GitHub will run a series of automated checks and notify the reviewer. At this point, you are done and can safely close the browser page at any time. 8. Check the “Files changed” section on the Open a pull request page to double-check your proposed changes. +> Note: Pages in the `./docs/Contributing/` folder and folders with a underscore prefix (e.g., `./docs/Deploy/_kubernetes/`) are not included in the documentation on the Fleet website. + ### Merging changes When merging a PR to the master branch of the [Fleet repo](https://github.com/fleetdm/fleet), remember that whatever you merge gets deployed live immediately. Ensure that the appropriate quality checks have been completed before merging. [Learn about the website QA process](#quality). diff --git a/website/scripts/build-static-content.js b/website/scripts/build-static-content.js index 4e039ab4f..67060ea9a 100644 --- a/website/scripts/build-static-content.js +++ b/website/scripts/build-static-content.js @@ -207,6 +207,10 @@ module.exports = { if(sectionRepoPath === 'docs/' && _.startsWith(pageUnextensionedUnwhitespacedLowercasedRelPath, 'contributing/')){ continue; } + // Skip pages in folders starting with an underscore character. + if(sectionRepoPath === 'docs/' && _.startsWith(pageRelSourcePath.split(/\//).slice(-2)[0], '_')){ + continue; + } let RX_README_FILENAME = /\/?readme\.?m?d?$/i;// « for matching `readme` or `readme.md` (case-insensitive) at the end of a file path // Determine this page's default (fallback) display title.