├── LICENSE ├── README.md ├── examples ├── base │ ├── gitdocs-deployment.yaml │ ├── kustomization.yaml │ └── nginx-configmap.yaml └── overlays │ ├── docsy │ ├── kustomization.yaml │ └── patch.yaml │ ├── kind-website │ ├── kustomization.yaml │ └── patch.yaml │ ├── kubernetes-website │ ├── kustomization.yaml │ └── patch.yaml │ └── private-repo │ ├── kustomization.yaml │ └── patch.yaml └── helm-chart ├── .helmignore ├── Chart.yaml ├── public ├── gitdocs-0.1.1.tgz ├── gitdocs-0.1.2.tgz └── index.yaml ├── templates ├── _helpers.tpl ├── deployment.yaml ├── hpa.yaml ├── ingress.yaml ├── nginx-configmap.yaml ├── service.yaml └── serviceaccount.yaml └── values.yaml /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GitDocs 2 | A GitOps approach for hosting self-updating docs on Kubernetes - similar to Netlify. 3 | 4 | With GitDocs you can create markdown documents in a central git repository and easily access them on a Kubernetes cluster. The git sync will occur every 30 seconds and can be set with the `GIT_SYNC_WAIT` environment variable in `examples/base/gitdocs-deployment.yaml`. 5 | 6 | GitDocs is not an application, it is the "glue" between 3 microservices ([git-sync](https://github.com/kubernetes/git-sync), [hugo](https://gohugo.io), [nginx](https://www.nginx.com)) that gains superpowers when ran in a pod on Kubernetes. 7 | 8 | ![](https://i.imgur.com/VIe32Ai.png) 9 | 10 | 11 | By containing the entire documentation lifecycle a pod, all you need is: 12 | - access to a git repo 13 | - access to a kubernetes cluster (v1.14 or later) 14 | 15 | GitDocs is designed to run anywhere, including on-prem, and supports private or public git repositories. 16 | 17 | ## Quick start 18 | 19 | 1) Clone repo 20 | 21 | ``` 22 | git clone https://github.com/jimangel/GitDocs 23 | cd GitDocs 24 | ``` 25 | 26 | 1) Apply the configmap and deployment 27 | 28 | The nginx.conf is created as a separate configmap to allow you to tweak any settings. 29 | 30 | ``` 31 | kubectl apply -f examples/base/nginx-configmap.yaml 32 | kubectl apply -f examples/base/gitdocs-deployment.yaml 33 | ``` 34 | 35 | 1) Use kubectl proxy to preview 36 | 37 | ``` 38 | kubectl port-forward deployment/gitdocs 8080:8080 39 | ``` 40 | 41 | Open a browser to http://localhost:8080 and browse. 42 | 43 | ## Clean up 44 | 45 | ``` 46 | kubectl delete -f examples/base/nginx-configmap.yaml 47 | kubectl delete -f examples/base/gitdocs-deployment.yaml 48 | ``` 49 | 50 | ## Deploy with Helm 51 | 52 | ``` 53 | helm repo add jimangel https://jimangel-charts.storage.googleapis.com 54 | helm repo update 55 | 56 | helm install gitdocs jimangel/gitdocs 57 | # https://github.com/jimangel/GitDocs/blob/master/helm-chart/values.yaml 58 | 59 | # use a custom website repo 60 | helm install gitdocs jimangel/gitdocs --set gitSync.env.gitSyncRepo="https://github.com/kubernetes/website.git" 61 | 62 | # add an ingress object 63 | helm install gitdocs jimangel/gitdocs --set gitSync.env.gitSyncRepo="https://github.com/kubernetes/website.git" --set ingress.enabeld="true" --set ingress.hosts[0]="mysite.example.com" 64 | 65 | # test locally 66 | kubectl port-forward deployment/gitdocs 8080:8080 67 | 68 | # clean up 69 | helm delete gitdocs 70 | 71 | # TODO: some sites are not formatted the same, the "arg" should be more dynamic to account for that. 72 | # TODO: clean up all kustomize with helm alternatives. 73 | ``` 74 | 75 | ## Going further 76 | 77 | From here you can create your own ingress and TLS strategy. Also, by abstracting the nginx config, you could always provide the SSL configuration to the pod. 78 | 79 | Expose pod with a service: 80 | 81 | ``` 82 | kubectl expose deployment/gitdocs --port 8080 83 | ``` 84 | 85 | Sample ingress: 86 | 87 | ``` 88 | cat < **Deploy** or **Access** keys) 165 | 166 | ``` 167 | cat ${HOME}/git-docs-ssh.pub 168 | ``` 169 | 170 | 1) Test SSH access to repository manually first 171 | 172 | ``` 173 | # add the SSH key to your local user's SSH keys 174 | ssh-add ${HOME}/git-docs-ssh 175 | 176 | # clone repo using SSH (should NOT prompt for password - do NOT use HTTPS) 177 | git clone git@:.git 178 | ``` 179 | 180 | 1) Create SSH key as Kubernetes secret 181 | 182 | ``` 183 | # The name "git-docs-ssh-key" is important to our patch 184 | kubectl create secret generic git-docs-ssh-key --from-file=ssh=${HOME}/git-docs-ssh 185 | ``` 186 | 187 | 1) Edit PLACEHOLDER_REPO_PATH & PLACEHOLDER_HUGO_VERSION in `patch.yaml` deployment patch. 188 | 189 | 190 | ``` 191 | # do NOT forget to escape your URL that your replace it with by using a backslash 192 | sed -i.bak 's/PLACEHOLDER_REPO_PATH/git@github.com:jimangel\/examplerepo.git/' examples/overlays/private-repo/patch.yaml 193 | 194 | # update the hugo version 195 | sed -i.bak 's/PLACEHOLDER_HUGO_VERSION/0.104.3/' examples/overlays/private-repo/patch.yaml 196 | 197 | # if on mac 198 | # rm -rf examples/overlays/private-repo/patch.yaml.bak 199 | ``` 200 | 201 | 1) Deploy private-repo overlay 202 | 203 | ``` 204 | kubectl apply -k examples/overlays/private-repo 205 | kubectl port-forward deployment/gitdocs 8080:8080 206 | kubectl delete -k examples/overlays/private-repo 207 | ``` 208 | 209 | ## Troubleshooting 210 | 211 | kubectl logs -f deployment/gitdocs -c hugo 212 | 213 | ``` 214 | NAMESPACE EVENTS: kubectl get events -n 215 | 216 | # git-sync 217 | LOGS: kubectl logs -f deployment/gitdocs -c git-sync 218 | EXEC: kubectl exec -it $POD -c git-sync -- /bin/sh 219 | 220 | # hugo 221 | LOGS: kubectl logs -f deployment/gitdocs -c hugo 222 | EXEC: kubectl exec -it $POD -c hugo -- /bin/sh 223 | 224 | # nginx 225 | LOGS: kubectl logs -f deployment/gitdocs -c nginx 226 | EXEC: kubectl exec -it $POD -c nginx -- /bin/sh d 227 | CONFIG: kubectl edit cm nginx-conf -o yaml 228 | ``` 229 | 230 | ## Change version of Hugo 231 | 232 | If using kustomize (see [example overlays](examples/overlays/)) change the hugo image tag in `patch.yaml` 233 | 234 | More info: https://github.com/klakegg/docker-hugo. 235 | 236 | > Note: This might cause issues with permissions if using an image <0.70.0. 237 | 238 | ## Running offline / air-gapped 239 | 240 | There's two ways to run the klakegg/hugo container, with an edge tag or with a version tag: 241 | 242 | - edge tag: `klakegg/hugo:edge-ext-alpine` 243 | - uses the latest container built by klakegg 244 | - the version is specified as a `HUGO_VERISON` environment variable 245 | - **the `HUGO_VERISON` is downloaded from the internet when container starts** 246 | - version tag: `klakegg/hugo:0.65.2-ext-alpine` 247 | - uses the specific version in the tag and does not download from the internet 248 | - no need to set `HUGO_VERISON` environment variable 249 | 250 | The reason GitDocs used to be built using the edge build, is because there was a issue running the container with a non-root user. This was [fixed](https://github.com/klakegg/docker-hugo/issues/24) in klakegg/hugo releases `>=0.70.1`. 251 | 252 | To run in an air-gapped environment, use a specific klakegg/hugo releases `>=0.70.1` (ex: `klakegg/hugo:0.70.1-ext-alpine`). 253 | 254 | There still might be issues running in air-gapped environments if your website content calls any external resources. 255 | 256 | ## Updating 257 | 258 | - Update kustomize examples/base/gitdocs-deployment.yaml 259 | - Hugo image version 260 | - GitSync image version 261 | - Update kustomize patch examples 262 | - Update helm-chart dir default values.yaml 263 | - tags 264 | - Hugo image version 265 | - GitSync image version 266 | - push 267 | - `cd helm-chart/public` 268 | - `helm package ../` 269 | - `helm repo index . --url https://jimangel-charts.storage.googleapis.com` 270 | - Walk through each demo for correctness 271 | - Repack helm chart 272 | - Revise the README.md 273 | 274 | ## TODO: 275 | 276 | - Security 277 | - Create network policies to isolate this pod 278 | - More hardening / vuln scanning 279 | - Makefile 280 | - for deploying, building, and updating 281 | - Use helm to generate the base for kustomize to save effort 282 | 283 | ## Thanks 284 | 285 | A lot of this is built on top of the example present in the git-sync repo: https://github.com/kubernetes/git-sync/tree/master/demo 286 | -------------------------------------------------------------------------------- /examples/base/gitdocs-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: gitdocs 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | name: gitdocs 10 | template: 11 | metadata: 12 | labels: 13 | name: gitdocs 14 | spec: 15 | securityContext: 16 | fsGroup: 65534 17 | runAsUser: 65533 18 | runAsGroup: 65534 19 | containers: 20 | - name: git-sync 21 | image: k8s.gcr.io/git-sync/git-sync:v3.6.2 22 | imagePullPolicy: Always 23 | volumeMounts: 24 | - name: markdown 25 | mountPath: /tmp/git 26 | env: 27 | - name: GIT_SYNC_REPO 28 | value: https://github.com/wowchemy/starter-hugo-academic.git 29 | #value: https://github.com/kubernetes/website.git 30 | - name: GIT_SYNC_BRANCH 31 | value: main 32 | - name: GIT_SYNC_DEST 33 | value: git-sync 34 | - name: GIT_SYNC_WAIT 35 | value: "30" 36 | securityContext: 37 | allowPrivilegeEscalation: false 38 | ########################## 39 | - name: hugo 40 | # The extended edition is used in those images containing ext in the name. 41 | image: klakegg/hugo:0.101.0-ext-alpine 42 | imagePullPolicy: Always 43 | env: 44 | - name: HUGO_DESTINATION 45 | value: "../../target" 46 | volumeMounts: 47 | - name: markdown 48 | mountPath: /src 49 | - name: html 50 | mountPath: /target 51 | command: ["/bin/sh","-c"] 52 | args: ["while ! ls /src/git-sync/config* 1> /dev/null 2>&1; do echo 'No Config' && sleep 1; done && hugo --watch --source=/src/git-sync/ --cleanDestinationDir"] 53 | securityContext: 54 | allowPrivilegeEscalation: false 55 | ####################### 56 | - name: nginx 57 | # image: nginx 58 | image: nginxinc/nginx-unprivileged 59 | imagePullPolicy: Always 60 | volumeMounts: 61 | - name: html 62 | mountPath: /usr/share/nginx/html 63 | - name: nginx-conf 64 | mountPath: /etc/nginx/nginx.conf # mount nginx-conf volume to /etc/nginx 65 | subPath: nginx.conf 66 | readOnly: true 67 | securityContext: 68 | allowPrivilegeEscalation: false 69 | ###################### 70 | volumes: 71 | - name: markdown 72 | emptyDir: {} 73 | - name: html 74 | emptyDir: {} 75 | - name: nginx-conf 76 | configMap: 77 | name: nginx-conf # place ConfigMap `nginx-conf` on /etc/nginx 78 | items: 79 | - key: nginx.conf 80 | path: nginx.conf -------------------------------------------------------------------------------- /examples/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - gitdocs-deployment.yaml 3 | - nginx-configmap.yaml -------------------------------------------------------------------------------- /examples/base/nginx-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: nginx-conf 5 | data: 6 | nginx.conf: | 7 | worker_processes 1; 8 | pid /tmp/nginx.pid; 9 | error_log /var/log/nginx/error.log warn; 10 | events { 11 | # When you need > 8000 * cpu_cores connections, you start optimizing your OS, 12 | # and this is probably the point at which you hire people who are smarter than 13 | # you, as this is *a lot* of requests. 14 | worker_connections 8000; 15 | } 16 | http { 17 | proxy_temp_path /tmp/proxy_temp; 18 | client_body_temp_path /tmp/client_temp; 19 | fastcgi_temp_path /tmp/fastcgi_temp; 20 | uwsgi_temp_path /tmp/uwsgi_temp; 21 | scgi_temp_path /tmp/scgi_temp; 22 | 23 | include /etc/nginx/mime.types; 24 | default_type application/octet-stream; 25 | 26 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 27 | '$status $body_bytes_sent "$http_referer" ' 28 | '"$http_user_agent" "$http_x_forwarded_for"'; 29 | 30 | access_log /var/log/nginx/access.log main; 31 | 32 | sendfile on; 33 | #tcp_nopush on; 34 | 35 | keepalive_timeout 65; 36 | 37 | #gzip on; 38 | 39 | include /etc/nginx/conf.d/*.conf; 40 | } -------------------------------------------------------------------------------- /examples/overlays/docsy/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../../base 3 | patchesStrategicMerge: 4 | - patch.yaml -------------------------------------------------------------------------------- /examples/overlays/docsy/patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: gitdocs 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: git-sync 10 | env: 11 | - name: GIT_SYNC_REPO 12 | value: "https://github.com/google/docsy-example.git" 13 | - name: GIT_SYNC_BRANCH 14 | value: master 15 | - name: GIT_SYNC_DEPTH 16 | value: "1" 17 | - name: hugo 18 | # https://github.com/google/docsy-example/blob/master/netlify.toml 19 | image: klakegg/hugo:0.104.3-ext-alpine 20 | -------------------------------------------------------------------------------- /examples/overlays/kind-website/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../../base 3 | patchesStrategicMerge: 4 | - patch.yaml -------------------------------------------------------------------------------- /examples/overlays/kind-website/patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: gitdocs 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: git-sync 10 | env: 11 | - name: GIT_SYNC_REPO 12 | value: https://github.com/kubernetes-sigs/kind.git 13 | - name: hugo 14 | # https://github.com/kubernetes-sigs/kind/blob/main/netlify.toml 15 | image: klakegg/hugo:0.101.0-ext-alpine 16 | env: 17 | - name: HUGO_DESTINATION 18 | value: "../../../target" 19 | args: ["while ! ls /src/git-sync/site/config* 1> /dev/null 2>&1; do echo 'No Config' && sleep 1; done && hugo --watch --source=/src/git-sync/site --cleanDestinationDir"] -------------------------------------------------------------------------------- /examples/overlays/kubernetes-website/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../../base 3 | patchesStrategicMerge: 4 | - patch.yaml -------------------------------------------------------------------------------- /examples/overlays/kubernetes-website/patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: gitdocs 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: git-sync 10 | env: 11 | - name: GIT_SYNC_REPO 12 | value: https://github.com/kubernetes/website.git 13 | - name: hugo 14 | # https://github.com/kubernetes/website/blob/main/netlify.toml 15 | image: klakegg/hugo:0.101.0-ext-alpine -------------------------------------------------------------------------------- /examples/overlays/private-repo/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../../base 3 | patchesStrategicMerge: 4 | - patch.yaml -------------------------------------------------------------------------------- /examples/overlays/private-repo/patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: gitdocs 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: git-sync 10 | volumeMounts: 11 | - name: ssh-key-volume 12 | mountPath: "/etc/git-secret" 13 | env: 14 | - name: GIT_SYNC_REPO 15 | value: "git@github.com:jimangel/howoldiseli.git" 16 | - name: GIT_SYNC_SSH 17 | value: "true" 18 | - name: GIT_KNOWN_HOSTS 19 | value: "false" 20 | - name: hugo 21 | image: klakegg/hugo:0.104.3-ext-alpine 22 | volumes: 23 | - name: ssh-key-volume 24 | secret: 25 | secretName: git-docs-ssh-key 26 | defaultMode: 0400 27 | -------------------------------------------------------------------------------- /helm-chart/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /helm-chart/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: gitdocs 2 | description: A GitOps approach to documentation on Kubernetes. 3 | apiVersion: v2 4 | type: application 5 | icon: https://i.imgur.com/VIe32Ai.png 6 | home: https://github.com/jimangel/GitDocs 7 | 8 | sources: 9 | - https://github.com/jimangel/GitDocs/tree/master/helm-chart 10 | 11 | # This is the chart version. This version number should be incremented each time you make changes 12 | # to the chart and its templates, including the app version. 13 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 14 | version: 0.1.2 15 | 16 | # This is the version number of the application being deployed. This version number should be 17 | # incremented each time you make changes to the application. Versions are not expected to 18 | # follow Semantic Versioning. They should reflect the version the application is using. 19 | appVersion: 1.0.0 20 | 21 | keywords: 22 | - gitops 23 | - docs 24 | - gitdocs 25 | 26 | maintainers: 27 | - name: Jim Angel 28 | email: jameswangel@gmail.com -------------------------------------------------------------------------------- /helm-chart/public/gitdocs-0.1.1.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimangel/GitDocs/cd5ce18da78ba8f649e7e40afd5fec1d6810242a/helm-chart/public/gitdocs-0.1.1.tgz -------------------------------------------------------------------------------- /helm-chart/public/gitdocs-0.1.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimangel/GitDocs/cd5ce18da78ba8f649e7e40afd5fec1d6810242a/helm-chart/public/gitdocs-0.1.2.tgz -------------------------------------------------------------------------------- /helm-chart/public/index.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | entries: 3 | gitdocs: 4 | - apiVersion: v2 5 | appVersion: 1.0.0 6 | created: "2023-01-03T21:56:16.455484-06:00" 7 | description: A GitOps approach to documentation on Kubernetes. 8 | digest: 0f6a238c8488a69a6480e3c1e8f1b793ffbf8b726e6dcab23062d2da9d34e3d2 9 | home: https://github.com/jimangel/GitDocs 10 | icon: https://i.imgur.com/VIe32Ai.png 11 | keywords: 12 | - gitops 13 | - docs 14 | - gitdocs 15 | maintainers: 16 | - email: jameswangel@gmail.com 17 | name: Jim Angel 18 | name: gitdocs 19 | sources: 20 | - https://github.com/jimangel/GitDocs/tree/master/helm-chart 21 | type: application 22 | urls: 23 | - https://jimangel-charts.storage.googleapis.com/gitdocs-0.1.2.tgz 24 | version: 0.1.2 25 | - apiVersion: v2 26 | appVersion: 1.0.0 27 | created: "2023-01-03T21:56:16.45483-06:00" 28 | description: A GitOps approach to documentation on Kubernetes. 29 | digest: 7d0e44f00f658777652ef059bcdde3fef5af0eaf3539f9014a4667fd10709253 30 | home: https://github.com/jimangel/GitDocs 31 | icon: https://i.imgur.com/VIe32Ai.png 32 | keywords: 33 | - gitops 34 | - docs 35 | - gitdocs 36 | maintainers: 37 | - email: jameswangel@gmail.com 38 | name: Jim Angel 39 | name: gitdocs 40 | sources: 41 | - https://github.com/jimangel/GitDocs/tree/master/helm-chart 42 | type: application 43 | urls: 44 | - https://jimangel-charts.storage.googleapis.com/gitdocs-0.1.1.tgz 45 | version: 0.1.1 46 | generated: "2023-01-03T21:56:16.453964-06:00" 47 | -------------------------------------------------------------------------------- /helm-chart/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "gitdocs.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 7 | {{- end }} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "gitdocs.fullname" -}} 15 | {{- if .Values.fullnameOverride }} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 17 | {{- else }} 18 | {{- $name := default .Chart.Name .Values.nameOverride }} 19 | {{- if contains $name .Release.Name }} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 21 | {{- else }} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 23 | {{- end }} 24 | {{- end }} 25 | {{- end }} 26 | 27 | {{/* 28 | Create chart name and version as used by the chart label. 29 | */}} 30 | {{- define "gitdocs.chart" -}} 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 32 | {{- end }} 33 | 34 | {{/* 35 | Common labels 36 | */}} 37 | {{- define "gitdocs.labels" -}} 38 | helm.sh/chart: {{ include "gitdocs.chart" . }} 39 | {{ include "gitdocs.selectorLabels" . }} 40 | {{- if .Chart.AppVersion }} 41 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 42 | {{- end }} 43 | app.kubernetes.io/managed-by: {{ .Release.Service }} 44 | {{- end }} 45 | 46 | {{/* 47 | Selector labels 48 | */}} 49 | {{- define "gitdocs.selectorLabels" -}} 50 | app.kubernetes.io/name: {{ include "gitdocs.name" . }} 51 | app.kubernetes.io/instance: {{ .Release.Name }} 52 | {{- end }} 53 | 54 | {{/* 55 | Create the name of the service account to use 56 | */}} 57 | {{- define "gitdocs.serviceAccountName" -}} 58 | {{- if .Values.serviceAccount.create }} 59 | {{- default (include "gitdocs.fullname" .) .Values.serviceAccount.name }} 60 | {{- else }} 61 | {{- default "default" .Values.serviceAccount.name }} 62 | {{- end }} 63 | {{- end }} 64 | -------------------------------------------------------------------------------- /helm-chart/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ include "gitdocs.fullname" . }} 5 | labels: 6 | {{- include "gitdocs.labels" . | nindent 4 }} 7 | spec: 8 | {{- if not .Values.autoscaling.enabled }} 9 | replicas: {{ .Values.replicaCount }} 10 | {{- end }} 11 | selector: 12 | matchLabels: 13 | {{- include "gitdocs.selectorLabels" . | nindent 6 }} 14 | template: 15 | metadata: 16 | {{- with .Values.podAnnotations }} 17 | annotations: 18 | {{- toYaml . | nindent 8 }} 19 | {{- end }} 20 | labels: 21 | {{- include "gitdocs.selectorLabels" . | nindent 8 }} 22 | spec: 23 | {{- with .Values.imagePullSecrets }} 24 | imagePullSecrets: 25 | {{- toYaml . | nindent 8 }} 26 | {{- end }} 27 | serviceAccountName: {{ include "gitdocs.serviceAccountName" . }} 28 | securityContext: 29 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 30 | containers: 31 | ############# GIT-SYNC ############# 32 | - name: {{ .Values.gitSync.name }} 33 | image: "{{ .Values.gitSync.image.registry }}/{{ .Values.gitSync.image.repository }}:{{ .Values.gitSync.image.tag }}" 34 | imagePullPolicy: {{ .Values.gitSync.image.pullPolicy }} 35 | {{- if .Values.gitSync.volumeMounts }} 36 | volumeMounts: 37 | {{ toYaml .Values.gitSync.volumeMounts | indent 8 }} 38 | {{- end }} 39 | env: 40 | - name: GIT_SYNC_REPO 41 | value: {{ .Values.gitSync.env.gitSyncRepo }} 42 | - name: GIT_SYNC_DEST 43 | value: {{ .Values.gitSync.env.gitSyncDest }} 44 | - name: GIT_SYNC_BRANCH 45 | value: {{ .Values.gitSync.env.gitSyncBranch }} 46 | - name: GIT_SYNC_WAIT 47 | value: "{{ .Values.gitSync.env.gitSyncWait }}" 48 | securityContext: 49 | {{- toYaml .Values.gitSync.securityContext | nindent 10 }} 50 | ############# HUGO ############# 51 | - name: {{ .Values.hugo.name }} 52 | image: "{{ .Values.hugo.image.registry }}/{{ .Values.hugo.image.repository }}:{{ .Values.hugo.image.tag }}" 53 | imagePullPolicy: {{ .Values.hugo.image.pullPolicy }} 54 | {{- if .Values.hugo.volumeMounts }} 55 | volumeMounts: 56 | {{ toYaml .Values.hugo.volumeMounts | indent 8 }} 57 | {{- end }} 58 | {{- if .Values.hugo.env }} 59 | env: 60 | {{ toYaml .Values.hugo.env | indent 8 }} 61 | {{- end }} 62 | command: ["/bin/sh","-c"] 63 | args: ["while ! ls /src/git-sync/config* 1> /dev/null 2>&1; do echo 'No Config' && sleep 1; done && hugo --watch --source=/src/git-sync/ --cleanDestinationDir"] 64 | securityContext: 65 | {{- toYaml .Values.hugo.securityContext | nindent 10 }} 66 | ############# NGINX ############# 67 | - name: {{ .Values.nginx.name }} 68 | image: "{{ .Values.nginx.image.registry }}/{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag }}" 69 | imagePullPolicy: {{ .Values.nginx.image.pullPolicy }} 70 | ports: 71 | - containerPort: {{ .Values.internalServicePort }} 72 | {{- if .Values.nginx.volumeMounts }} 73 | volumeMounts: 74 | {{ toYaml .Values.nginx.volumeMounts | indent 8 }} 75 | {{- end }} 76 | {{- if .Values.nginx.env }} 77 | env: 78 | {{ toYaml .Values.nginx.env | indent 8 }} 79 | {{- end }} 80 | securityContext: 81 | {{- toYaml .Values.nginx.securityContext | nindent 10 }} 82 | ########## SHARED VOL ############ 83 | volumes: 84 | - name: markdown 85 | emptyDir: {} 86 | - name: html 87 | emptyDir: {} 88 | - name: nginx-conf 89 | configMap: 90 | name: {{ .Values.nginx.config.name }} # mounts ConfigMap `nginx-conf` in /etc/nginx 91 | items: 92 | - key: nginx.conf 93 | path: nginx.conf 94 | {{- if .Values.volumes }} 95 | {{ toYaml .Values.controller.volumes | indent 6 }} 96 | {{- end }} 97 | {{- with .Values.nodeSelector }} 98 | nodeSelector: 99 | {{- toYaml . | nindent 8 }} 100 | {{- end }} 101 | {{- with .Values.affinity }} 102 | affinity: 103 | {{- toYaml . | nindent 8 }} 104 | {{- end }} 105 | {{- with .Values.tolerations }} 106 | tolerations: 107 | {{- toYaml . | nindent 8 }} 108 | {{- end }} -------------------------------------------------------------------------------- /helm-chart/templates/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.autoscaling.enabled }} 2 | apiVersion: autoscaling/v2beta1 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ include "gitdocs.fullname" . }} 6 | labels: 7 | {{- include "gitdocs.labels" . | nindent 4 }} 8 | spec: 9 | scaleTargetRef: 10 | apiVersion: apps/v1 11 | kind: Deployment 12 | name: {{ include "gitdocs.fullname" . }} 13 | minReplicas: {{ .Values.autoscaling.minReplicas }} 14 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 15 | metrics: 16 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} 17 | - type: Resource 18 | resource: 19 | name: cpu 20 | targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} 21 | {{- end }} 22 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} 23 | - type: Resource 24 | resource: 25 | name: memory 26 | targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} 27 | {{- end }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /helm-chart/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.ingress.enabled -}} 2 | {{- $fullName := include "gitdocs.fullname" . -}} 3 | {{- $svcPort := .Values.service.port -}} 4 | {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} 5 | apiVersion: networking.k8s.io/v1 6 | {{- else -}} 7 | apiVersion: extensions/v1beta1 8 | {{- end }} 9 | kind: Ingress 10 | metadata: 11 | name: {{ $fullName }} 12 | labels: 13 | {{- include "gitdocs.labels" . | nindent 4 }} 14 | {{- with .Values.ingress.annotations }} 15 | annotations: 16 | {{- toYaml . | nindent 4 }} 17 | {{- end }} 18 | spec: 19 | {{- if .Values.ingress.tls }} 20 | tls: 21 | {{- range .Values.ingress.tls }} 22 | - hosts: 23 | {{- range .hosts }} 24 | - {{ . | quote }} 25 | {{- end }} 26 | secretName: {{ .secretName }} 27 | {{- end }} 28 | {{- end }} 29 | rules: 30 | {{- range .Values.ingress.hosts }} 31 | - host: {{ .host | quote }} 32 | http: 33 | paths: 34 | - pathType: Prefix 35 | path: "/" 36 | backend: 37 | service: 38 | name: {{ $fullName }} 39 | port: 40 | number: {{ $svcPort }} 41 | {{- end }} 42 | {{- end }} 43 | -------------------------------------------------------------------------------- /helm-chart/templates/nginx-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ .Values.nginx.config.name }} 5 | namespace: {{ .Release.Namespace }} 6 | labels: 7 | {{- include "gitdocs.labels" . | nindent 4 }} 8 | {{- if .Values.nginx.config.annotations }} 9 | annotations: 10 | {{ toYaml .Values.nginx.config.annotations | indent 4 }} 11 | {{- end }} 12 | data: 13 | {{- if .Values.nginx.config.entries }} 14 | {{ toYaml .Values.nginx.config.entries | indent 2 }} 15 | {{- end }} -------------------------------------------------------------------------------- /helm-chart/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "gitdocs.fullname" . }} 5 | labels: 6 | {{- include "gitdocs.labels" . | nindent 4 }} 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | - port: {{ .Values.service.port }} 11 | targetPort: {{ .Values.internalServicePort }} 12 | selector: 13 | {{- include "gitdocs.selectorLabels" . | nindent 4 }} 14 | -------------------------------------------------------------------------------- /helm-chart/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "gitdocs.serviceAccountName" . }} 6 | labels: 7 | {{- include "gitdocs.labels" . | nindent 4 }} 8 | {{- with .Values.serviceAccount.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /helm-chart/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for gitdocs. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 1 6 | 7 | # Internal service <--> container (nginx) port 8 | internalServicePort: "8080" 9 | 10 | volumes: [] 11 | 12 | gitSync: 13 | name: git-sync 14 | image: 15 | registry: k8s.gcr.io 16 | repository: git-sync/git-sync 17 | pullPolicy: Always 18 | # Overrides the image tag whose default is the chart appVersion. 19 | tag: v3.6.2 20 | volumeMounts: 21 | - name: markdown 22 | mountPath: /tmp/git 23 | env: 24 | # Git repo to sync 25 | # ex: https://github.com/kubernetes/website.git 26 | # ex: https://github.com/sourcethemes/academic-kickstart.git 27 | gitSyncBranch: "main" 28 | gitSyncRepo: https://github.com/sourcethemes/academic-kickstart.git 29 | gitSyncDest: git-sync 30 | gitSyncWait: "30" 31 | securityContext: 32 | allowPrivilegeEscalation: false 33 | 34 | hugo: 35 | name: hugo 36 | image: 37 | registry: docker.io 38 | repository: klakegg/hugo 39 | pullPolicy: Always 40 | # Overrides the image tag whose default is the chart appVersion. 41 | tag: 0.101.0-ext-alpine 42 | volumeMounts: 43 | - name: markdown 44 | mountPath: /src 45 | - name: html 46 | mountPath: /target 47 | env: 48 | - name: HUGO_DESTINATION 49 | value: "../../target" 50 | securityContext: 51 | allowPrivilegeEscalation: false 52 | 53 | nginx: 54 | name: nginx 55 | image: 56 | registry: docker.io 57 | repository: nginxinc/nginx-unprivileged 58 | pullPolicy: Always 59 | # Overrides the image tag whose default is the chart appVersion. 60 | tag: latest 61 | volumeMounts: 62 | - name: html 63 | mountPath: /usr/share/nginx/html 64 | - name: nginx-conf 65 | mountPath: /etc/nginx/nginx.conf # mount nginx-conf volume to /etc/nginx 66 | subPath: nginx.conf 67 | readOnly: true 68 | env: 69 | securityContext: 70 | allowPrivilegeEscalation: false 71 | # nginx configmap... 72 | config: 73 | # configmap name 74 | name: "nginx-conf" 75 | annotations: 76 | entries: 77 | nginx.conf: | 78 | worker_processes 1; 79 | pid /tmp/nginx.pid; 80 | error_log /var/log/nginx/error.log warn; 81 | events { 82 | # When you need > 8000 * cpu_cores connections, you start optimizing your OS, 83 | # and this is probably the point at which you hire people who are smarter than 84 | # you, as this is *a lot* of requests. 85 | worker_connections 8000; 86 | } 87 | http { 88 | proxy_temp_path /tmp/proxy_temp; 89 | client_body_temp_path /tmp/client_temp; 90 | fastcgi_temp_path /tmp/fastcgi_temp; 91 | uwsgi_temp_path /tmp/uwsgi_temp; 92 | scgi_temp_path /tmp/scgi_temp; 93 | 94 | include /etc/nginx/mime.types; 95 | default_type application/octet-stream; 96 | 97 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 98 | '$status $body_bytes_sent "$http_referer" ' 99 | '"$http_user_agent" "$http_x_forwarded_for"'; 100 | 101 | access_log /var/log/nginx/access.log main; 102 | 103 | sendfile on; 104 | #tcp_nopush on; 105 | 106 | keepalive_timeout 65; 107 | 108 | #gzip on; 109 | 110 | include /etc/nginx/conf.d/*.conf; 111 | } 112 | 113 | imagePullSecrets: 114 | 115 | serviceAccount: 116 | # Specifies whether a service account should be created 117 | create: false 118 | # Annotations to add to the service account 119 | annotations: {} 120 | # The name of the service account to use. 121 | # If not set and create is true, a name is generated using the fullname template 122 | name: "" 123 | 124 | podAnnotations: {} 125 | 126 | podSecurityContext: 127 | fsGroup: 65534 128 | runAsUser: 65533 129 | runAsGroup: 65534 130 | 131 | service: 132 | # type loadbalancer alone works. 133 | # type: LoadBalancer 134 | type: ClusterIP 135 | port: 8080 136 | 137 | ingress: 138 | enabled: false 139 | annotations: {} 140 | # kubernetes.io/ingress.class: nginx 141 | # kubernetes.io/tls-acme: "true" 142 | hosts: 143 | - host: gitdocs.mydns.dog 144 | paths: 145 | - path: "/" 146 | tls: [] 147 | # - secretName: chart-example-tls 148 | # hosts: 149 | # - chart-example.local 150 | 151 | resources: {} 152 | # We usually recommend not to specify default resources and to leave this as a conscious 153 | # choice for the user. This also increases chances charts run on environments with little 154 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 155 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 156 | # limits: 157 | # cpu: 100m 158 | # memory: 128Mi 159 | # requests: 160 | # cpu: 100m 161 | # memory: 128Mi 162 | 163 | autoscaling: 164 | enabled: false 165 | minReplicas: 1 166 | maxReplicas: 100 167 | targetCPUUtilizationPercentage: 80 168 | # targetMemoryUtilizationPercentage: 80 169 | 170 | nodeSelector: {} 171 | 172 | tolerations: [] 173 | 174 | affinity: {} --------------------------------------------------------------------------------