From f0c3b61f568030a220388cef717b4361d6291f58 Mon Sep 17 00:00:00 2001 From: Karl Johan Grahn <6355577+karl-johan-grahn@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:55:15 +0200 Subject: [PATCH] Docs restructuring (#644) * update * update * update --- .github/workflows/pull_request.yaml | 6 ---- .github/workflows/pull_request_docs.yaml | 26 ++++++++++++++ .github/workflows/push_docs.yaml | 22 ++++++++++++ .gitignore | 2 ++ .gitmodules | 3 ++ Dockerfile-docs | 35 +++++++++++++++++++ docs-nginx.conf | 11 ++++++ docs/How-it-works.md | 2 +- docs/features.md | 8 ----- docs/index.md | 12 +++++++ theme_common | 1 + theme_override/mkdocs.yml | 22 ++++++++++++ theme_override/resources/.gitignore | 0 .../resources/assets/images/favicon.svg | 1 + 14 files changed, 136 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/pull_request_docs.yaml create mode 100644 .github/workflows/push_docs.yaml create mode 100644 .gitmodules create mode 100644 Dockerfile-docs create mode 100644 docs-nginx.conf delete mode 100644 docs/features.md create mode 100644 docs/index.md create mode 160000 theme_common create mode 100644 theme_override/mkdocs.yml create mode 100644 theme_override/resources/.gitignore create mode 100644 theme_override/resources/assets/images/favicon.svg diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 4157e0d..c906243 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -13,12 +13,6 @@ env: REGISTRY: ghcr.io jobs: - qa: - uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.71 - with: - MD_CONFIG: .github/md_config.json - DOC_SRC: README.md docs - MD_LINT_CONFIG: .markdownlint.yaml build: runs-on: ubuntu-latest name: Build diff --git a/.github/workflows/pull_request_docs.yaml b/.github/workflows/pull_request_docs.yaml new file mode 100644 index 0000000..855a760 --- /dev/null +++ b/.github/workflows/pull_request_docs.yaml @@ -0,0 +1,26 @@ +name: Pull Request for Documentation Changes + +on: + pull_request_target: + branches: + - master + paths: + - 'README.md' + - 'docs/**' + +jobs: + qa: + uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.71 + with: + MD_CONFIG: .github/md_config.json + DOC_SRC: README.md docs + MD_LINT_CONFIG: .markdownlint.yaml + build: + uses: stakater/.github/.github/workflows/pull_request_container_build.yaml@v0.0.71 + with: + DOCKER_FILE_PATH: Dockerfile-docs + secrets: + CONTAINER_REGISTRY_URL: ghcr.io/stakater/docs + CONTAINER_REGISTRY_USERNAME: stakater-user + CONTAINER_REGISTRY_PASSWORD: ${{ secrets.STAKATER_GITHUB_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }} diff --git a/.github/workflows/push_docs.yaml b/.github/workflows/push_docs.yaml new file mode 100644 index 0000000..2f5caaf --- /dev/null +++ b/.github/workflows/push_docs.yaml @@ -0,0 +1,22 @@ +name: Push Documentation Changes + +on: + push: + branches: + - master + paths: + - 'README.md' + - 'docs/**' + +jobs: + push: + uses: stakater/.github/.github/workflows/push_container.yaml@v0.0.71 + with: + DOCKER_FILE_PATH: Dockerfile-docs + RELEASE_BRANCH: master + secrets: + CONTAINER_REGISTRY_URL: ghcr.io/stakater/docs + CONTAINER_REGISTRY_USERNAME: stakater-user + CONTAINER_REGISTRY_PASSWORD: ${{ secrets.STAKATER_GITHUB_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }} + GH_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 91af8d8..d15af95 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ Reloader !**/chart/reloader *.tgz styles/ +site/ +/mkdocs.yml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..93d493f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "theme_common"] + path = theme_common + url = git@github.com:stakater/stakater-docs-mkdocs-theme.git diff --git a/Dockerfile-docs b/Dockerfile-docs new file mode 100644 index 0000000..d5387e0 --- /dev/null +++ b/Dockerfile-docs @@ -0,0 +1,35 @@ +FROM python:3.12 as builder + +# set workdir +RUN mkdir -p $HOME/application +WORKDIR $HOME/application + +# copy the entire application +COPY --chown=1001:root . . + +RUN pip3 install -r theme_common/requirements.txt + +# Combine Theme Resources +RUN python theme_common/scripts/combine_theme_resources.py theme_common/resources theme_override/resources dist/_theme +# Produce mkdocs file +RUN python theme_common/scripts/combine_mkdocs_config_yaml.py theme_common/mkdocs.yml theme_override/mkdocs.yml mkdocs.yml + +# build the docs +RUN mkdocs build + +FROM nginxinc/nginx-unprivileged:1.25-alpine as deploy +COPY --from=builder $HOME/application/site/ /usr/share/nginx/html/reloader/ +COPY docs-nginx.conf /etc/nginx/conf.d/default.conf + +# set non-root user +USER 1001 + +LABEL name="Stakater Reloader Documentation" \ + maintainer="Stakater " \ + vendor="Stakater" \ + release="1" \ + summary="Documentation for Stakater Reloader" + +EXPOSE 8080:8080/tcp + +CMD ["nginx", "-g", "daemon off;"] diff --git a/docs-nginx.conf b/docs-nginx.conf new file mode 100644 index 0000000..f389714 --- /dev/null +++ b/docs-nginx.conf @@ -0,0 +1,11 @@ +server { + listen 8080; + root /usr/share/nginx/html/; + index index.html; + error_page 403 404 /404.html; + location = /404.html { + internal; + } + # redirects issued by nginx will be relative + absolute_redirect off; +} diff --git a/docs/How-it-works.md b/docs/How-it-works.md index 547c4c4..4240f50 100644 --- a/docs/How-it-works.md +++ b/docs/How-it-works.md @@ -1,4 +1,4 @@ -# How it works? +# How does Reloader work? Reloader watches for `ConfigMap` and `Secret` and detects if there are changes in data of these objects. After change detection Reloader performs rolling upgrade on relevant Pods via associated `Deployment`, `Daemonset` and `Statefulset`. diff --git a/docs/features.md b/docs/features.md deleted file mode 100644 index 4a2d026..0000000 --- a/docs/features.md +++ /dev/null @@ -1,8 +0,0 @@ -# Features - -These are the key features of Reloader: - -1. Restart pod in a `deployment` on change in linked/related configmap's or secret's -1. Restart pod in a `daemonset` on change in linked/related configmap's or secret's -1. Restart pod in a `statefulset` on change in linked/related configmap's or secret's -1. Restart pod in a `rollout` on change in linked/related configmap's or secret's diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..9cb508c --- /dev/null +++ b/docs/index.md @@ -0,0 +1,12 @@ +# Introduction + +Reloader can watch changes in `ConfigMap` and `Secret` and do rolling upgrades on Pods with their associated `DeploymentConfigs`, `Deployments`, `Daemonsets` `Statefulsets` and `Rollouts`. + +These are the key features of Reloader: + +1. Restart pod in a `deployment` on change in linked/related configmap's or secret's +1. Restart pod in a `daemonset` on change in linked/related configmap's or secret's +1. Restart pod in a `statefulset` on change in linked/related configmap's or secret's +1. Restart pod in a `rollout` on change in linked/related configmap's or secret's + +This site contains more details on how Reloader works. For an overview, please see the repository's [README file](https://github.com/stakater/Reloader/blob/master/README.md). diff --git a/theme_common b/theme_common new file mode 160000 index 0000000..f63139f --- /dev/null +++ b/theme_common @@ -0,0 +1 @@ +Subproject commit f63139f84ac5bd44d3ec567294c3bb30cb8c9ba6 diff --git a/theme_override/mkdocs.yml b/theme_override/mkdocs.yml new file mode 100644 index 0000000..265ec60 --- /dev/null +++ b/theme_override/mkdocs.yml @@ -0,0 +1,22 @@ +site_name: Stakater Reloader +docs_dir: docs +site_url: https://docs.stakater.com/reloader/ +repo_url: https://github.com/stakater/reloader +edit_uri: blob/master/docs/ + +theme: + favicon: assets/images/favicon.svg + +nav: + - index.md + - How-to Guides: + - Verify-Reloader-Working.md + - Alerting.md + - Reloader-with-Sealed-Secrets.md + - Helm2-to-Helm3.md + - References: + - How-it-works.md + - Container Build.md + - Comparisons with similar tools: + - Reloader-vs-ConfigmapController.md + - Reloader-vs-k8s-trigger-controller.md diff --git a/theme_override/resources/.gitignore b/theme_override/resources/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/theme_override/resources/assets/images/favicon.svg b/theme_override/resources/assets/images/favicon.svg new file mode 100644 index 0000000..c353305 --- /dev/null +++ b/theme_override/resources/assets/images/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file