├── LICENSE ├── README.md ├── helm ├── .helmignore ├── Chart.yaml ├── README.md ├── requirements.lock ├── requirements.yaml ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── configmap.yaml │ ├── deployment.yaml │ ├── ingress.yaml │ ├── pvc.yaml │ ├── secrets.yaml │ └── service.yaml └── values.yaml └── manifest ├── app.ini ├── createConfigMap.sh ├── deploy.yaml ├── ingress.yaml ├── pvc.yaml └── service.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 | # Setup Gitea on Kubernetes Cluster 2 | 3 | ## Cloned from 4 | 5 | 1. helm 6 | 7 | Mostly cloned from [[WIP] Adds Gitea to the incubator #3408](https://github.com/helm/charts/pull/3408), and [cdrage's original source](https://github.com/cdrage/charts/tree/add-gitea/incubator/gitea). 8 | 9 | And from this, i upgrade Gitea version to 1.5, modifiy PVC using nfs-client, using `initContainers` to initial rights settings. 10 | 11 | 2. manifest 12 | 13 | Cloned from [jmferrer/gitea-kubernetes](https://github.com/jmferrer/gitea-kubernetes) and [norbertvannobelen/gitea-kubernetes](https://github.com/norbertvannobelen/gitea-kubernetes). 14 | 15 | And from this, i upgrade Gitea version to 1.5 and modifiy PVC using nfs-client. 16 | 17 | ## Two ways to setup Gitea on Kubernetes cluster 18 | 19 | 0. Pre 20 | 21 | - Prepare Kubernetes cluster ready before install Gitea; 22 | 23 | - Prepare ingress, namespace, secret etc. 24 | 25 | 1. Helm 26 | 27 | - Clone this repo first: 28 | 29 | ``` 30 | git clone https://github.com/isaron/gitea-kubernetes.git && cd gitea-kubernetes/helm 31 | ``` 32 | 33 | - Check `values.yaml` if you want modify yours config, and save as `myvalue.yaml`, then install using Helm: 34 | ``` 35 | helm dep up . 36 | helm install --name gitea --namespace env . -f myvalue.yaml 37 | ``` 38 | 39 | 2. Manifest 40 | 41 | - Clone this repo first: 42 | ``` 43 | git clone https://github.com/isaron/gitea-kubernetes.git && cd gitea-kubernetes/manifest 44 | ``` 45 | 46 | - Check all files and save them, then install: 47 | ``` 48 | chmod +x createConfigMap.sh && ./createConfigMap.sh 49 | kubectl apply -f . 50 | ``` 51 | -------------------------------------------------------------------------------- /helm/.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 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | charts/ 23 | -------------------------------------------------------------------------------- /helm/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: Git with a cup of tea, painless self-hosted git service 3 | name: gitea 4 | appVersion: 1.5.1 5 | version: 0.0.3 6 | home: https://gitea.io/ 7 | icon: https://gitea.io/images/favicon.png 8 | keywords: 9 | - git 10 | - gitea 11 | maintainers: 12 | - name: cdrage 13 | email: charlie@charliedrage.com 14 | -------------------------------------------------------------------------------- /helm/README.md: -------------------------------------------------------------------------------- 1 | # Gitea Helm Chart 2 | 3 | [Gitea][] is a painless self-hosted Git service. 4 | 5 | ## TL;DR; 6 | 7 | ```console 8 | $ helm install incubator/gitea 9 | ``` 10 | 11 | ## Introduction 12 | 13 | This chart bootstraps a [Gitea][] deployment on a [Kubernetes][] cluster using 14 | the [Helm][] package manager. 15 | 16 | ## Prerequisites Details 17 | 18 | * PV support on underlying infrastructure (if persistence is required) 19 | 20 | ## Installing the Chart 21 | 22 | To install the chart with the release name `my-release`: 23 | 24 | ```console 25 | $ helm install --name my-release incubator/gitea 26 | ``` 27 | 28 | ## Uninstalling the Chart 29 | 30 | To uninstall/delete the `my-release` deployment: 31 | 32 | ```console 33 | $ helm delete my-release 34 | ``` 35 | 36 | The command removes nearly all the Kubernetes components associated with the 37 | chart and deletes the release. 38 | 39 | ## Configuration 40 | 41 | The following tables lists some of the configurable parameters of the Gitea 42 | chart and their default values. 43 | 44 | | Parameter | Description | Default | 45 | |----------------------------------|--------------------------------------------------------------|---------------------------------------------------------| 46 | | `imageRepository` | Gitea image | `gitea/gitea` | 47 | | `imageTag` | Gitea image version | `1.3.2` | 48 | | `imagePullPolicy` | Gitea image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | 49 | | `postgresql.install` | Weather or not to install PostgreSQL dependency | `true` | 50 | | `postgresql.postgresHost` | PostgreSQL host (if `postgresql.install == false`) | `nil` | 51 | | `postgresql.postgresUser` | PostgreSQL User to create | `gitea` | 52 | | `postgresql.postgresPassword` | PostgreSQL Password for the new user | `gitea` | 53 | | `postgresql.postgresDatabase` | PostgreSQL Database to create | `gitea` | 54 | | `postgresql.persistence.enabled` | Enable PostgreSQL persistence using Persistent Volume Claims | `true` | 55 | 56 | See [values.yaml](values.yaml) for a more complete list, and links to the Gitea documentation. 57 | 58 | Specify each parameter using the `--set key=value[,key=value]` argument to 59 | `helm install`. 60 | 61 | Alternatively, a YAML file that specifies the values for the parameters can be 62 | provided while installing the chart. For example, 63 | 64 | ```console 65 | $ helm install --name my-release -f values.yaml incubator/gitea 66 | ``` 67 | 68 | > **Tip**: You can use the default [values.yaml](values.yaml) 69 | 70 | [Gitea]: https://github.com/go-gitea/gitea 71 | [Kubernetes]: https://kubernetes.io 72 | [Helm]: https://helm.sh 73 | -------------------------------------------------------------------------------- /helm/requirements.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: postgresql 3 | repository: https://kubernetes-charts.storage.googleapis.com/ 4 | version: 0.15.0 5 | digest: sha256:10e7b78cc6ff392ee090f479274a8d2ecd813d184a877be140d86115bc356670 6 | generated: 2018-08-30T22:46:44.458804679+08:00 7 | -------------------------------------------------------------------------------- /helm/requirements.yaml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: postgresql 3 | version: 0.15.0 4 | repository: https://kubernetes-charts.storage.googleapis.com/ 5 | condition: postgresql.install 6 | -------------------------------------------------------------------------------- /helm/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | 1. Get the Gitea URL by running: 2 | 3 | {{- if contains "NodePort" .Values.serviceType }} 4 | 5 | export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "gitea.fullname" . }}) 6 | export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") 7 | echo http://$NODE_IP:$NODE_PORT/ 8 | 9 | {{- else if contains "LoadBalancer" .Values.serviceType }} 10 | 11 | NOTE: It may take a few minutes for the LoadBalancer IP to be available. 12 | Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "gitea.fullname" . }}' 13 | 14 | export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "gitea.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') 15 | echo http://$SERVICE_IP/ 16 | {{- else if contains "ClusterIP" .Values.serviceType }} 17 | 18 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "gitea.fullname" . }}" -o jsonpath="{.items[0].metadata.name}") 19 | echo http://127.0.0.1:8080/ 20 | kubectl port-forward $POD_NAME 8080:80 21 | {{- end }} 22 | 23 | 2. Register a user. The first user registered will be the administrator. 24 | -------------------------------------------------------------------------------- /helm/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "gitea.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 | */}} 13 | {{- define "gitea.fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | 18 | {{/* 19 | Create a fully qualified server name. 20 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 21 | */}} 22 | {{- define "gitea.gitea.fullname" -}} 23 | {{- printf "%s-%s" .Release.Name "gitea" | trunc 63 | trimSuffix "-" -}} 24 | {{- end -}} 25 | 26 | {{/* 27 | Create a default fully qualified postgresql name. 28 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 29 | */}} 30 | {{- define "gitea.postgresql.fullname" -}} 31 | {{- $name := default "postgresql" .Values.postgresql.nameOverride -}} 32 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 33 | {{- end -}} 34 | 35 | {{/* 36 | Determine database user based on use of postgresql dependency. 37 | */}} 38 | {{- define "gitea.database.host" -}} 39 | {{- if .Values.postgresql.install -}} 40 | {{- template "gitea.postgresql.fullname" . -}} 41 | {{- else -}} 42 | {{- .Values.service.gitea.databaseHost | quote -}} 43 | {{- end -}} 44 | {{- end -}} 45 | 46 | {{/* 47 | Determine database user based on use of postgresql dependency. 48 | */}} 49 | {{- define "gitea.database.user" -}} 50 | {{- if .Values.postgresql.install -}} 51 | {{- .Values.postgresql.postgresUser | quote -}} 52 | {{- else -}} 53 | {{- .Values.service.gitea.databaseUser | quote -}} 54 | {{- end -}} 55 | {{- end -}} 56 | 57 | {{/* 58 | Determine database password based on use of postgresql dependency. 59 | */}} 60 | {{- define "gitea.database.password" -}} 61 | {{- if .Values.postgresql.install -}} 62 | {{- .Values.postgresql.postgresPassword | quote -}} 63 | {{- else -}} 64 | {{- .Values.service.gitea.databasePassword | quote -}} 65 | {{- end -}} 66 | {{- end -}} 67 | 68 | {{/* 69 | Determine database name based on use of postgresql dependency. 70 | */}} 71 | {{- define "gitea.database.name" -}} 72 | {{- if .Values.postgresql.install -}} 73 | {{- .Values.postgresql.postgresDatabase | quote -}} 74 | {{- else -}} 75 | {{- .Values.service.gitea.databaseName | quote -}} 76 | {{- end -}} 77 | {{- end -}} 78 | -------------------------------------------------------------------------------- /helm/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | kind: ConfigMap 2 | apiVersion: v1 3 | metadata: 4 | name: {{ template "gitea.gitea.fullname" . }}-config 5 | labels: 6 | app: {{ template "gitea.name" . }} 7 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | component: {{ default "gitea" .Values.service.nameOverride }} 11 | data: 12 | 2222: default/{{ template "gitea.fullname" . }}:ssh 13 | app.ini: |- 14 | APP_NAME = {{ .Values.service.gitea.appName }} 15 | RUN_USER = {{ .Values.service.gitea.runUser }} 16 | RUN_MODE = {{ .Values.service.gitea.runMode }} 17 | 18 | [repository] 19 | FORCE_PRIVATE = {{ .Values.service.gitea.forcePrivate }} 20 | DISABLE_HTTP_GIT = {{ .Values.service.gitea.disableHttpGit }} 21 | 22 | [repository.upload] 23 | ENABLED = {{ .Values.service.gitea.repositoryUploadEnabled }} 24 | ALLOWED_TYPES = {{ .Values.service.gitea.repositoryUploadAllowedTypes }} 25 | FILE_MAX_SIZE = {{ .Values.service.gitea.repositoryUploadMaxFileSize }} 26 | MAX_FILES = {{ .Values.service.gitea.repositoryUploadMaxFiles }} 27 | 28 | [server] 29 | PROTOCOL = {{ .Values.service.gitea.serverProtocol }} 30 | DOMAIN = {{ .Values.service.gitea.serverDomain }} 31 | ROOT_URL = {{ .Values.service.gitea.serverRootUrl }} 32 | LANDING_PAGE = {{ .Values.service.gitea.serverLandingPage }} 33 | SSH_PORT = {{ .Values.service.sshPort }} 34 | 35 | [service] 36 | ENABLE_CAPTCHA = {{ .Values.service.gitea.serviceEnableCaptcha }} 37 | ACTIVE_CODE_LIVE_MINUTES = 180 38 | RESET_PASSWD_CODE_LIVE_MINUTES = 180 39 | REGISTER_EMAIL_CONFIRM = {{ .Values.service.gitea.serviceRegisterEmailConfirm }} 40 | DISABLE_REGISTRATION = {{ .Values.service.gitea.serviceDisableRegistration }} 41 | REQUIRE_SIGNIN_VIEW = {{ .Values.service.gitea.serviceRequireSignInView }} 42 | ENABLE_NOTIFY_MAIL = {{ .Values.service.gitea.serviceEnableNotifyMail }} 43 | ENABLE_REVERSE_PROXY_AUTHENTICATION = false 44 | ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false 45 | 46 | [database] 47 | DB_TYPE = {{ .Values.service.gitea.databaseType | quote }} 48 | HOST = {{ template "gitea.database.host" . }} 49 | NAME = {{ template "gitea.database.name" . }} 50 | USER = {{ template "gitea.database.user" . }} 51 | PASSWD = {{ template "gitea.database.password" . }} 52 | SSL_MODE = {{ .Values.service.gitea.databaseSSLMode }} 53 | 54 | [admin] 55 | DISABLE_REGULAR_ORG_CREATION = {{ .Values.service.gitea.disableRegularOrgCreation }} 56 | 57 | [security] 58 | INSTALL_LOCK = true 59 | SECRET_KEY = {{ default "" .Values.service.gitea.securitySecretKey | b64enc | quote }} 60 | 61 | [ui] 62 | EXPLORE_PAGING_NUM = {{ .Values.service.gitea.uiExplorePagingNum }} 63 | ISSUE_PAGING_NUM = {{ .Values.service.gitea.uiIssuePagingNum }} 64 | FEED_MAX_COMMIT_NUM = {{ .Values.service.gitea.uiFeedMaxCommitNum }} 65 | 66 | [cache] 67 | ADAPTER = {{ .Values.service.gitea.cacheAdapter }} 68 | INTERVAL = {{ .Values.service.gitea.cacheInterval }} 69 | HOST = {{ .Values.service.gitea.cacheHost }} 70 | 71 | [webhook] 72 | QUEUE_LENGTH = {{ .Values.service.gitea.webhookQueueLength }} 73 | DELIVER_TIMEOUT = {{ .Values.service.gitea.webhookDeliverTimeout }} 74 | SKIP_TLS_VERIFY = {{ .Values.service.gitea.webhookSkipTlsVerify }} 75 | PAGING_NUM = {{ .Values.service.gitea.webhookPagingNum }} 76 | 77 | [log] 78 | MODE = {{ .Values.service.gitea.logMode }} 79 | LEVEL = {{ .Values.service.gitea.logLevel }} 80 | 81 | [other] 82 | SHOW_FOOTER_BRANDING = {{ .Values.service.gitea.otherShowFooterBranding }} 83 | SHOW_FOOTER_VERSION = {{ .Values.service.gitea.otherShowFooterVersion }} 84 | -------------------------------------------------------------------------------- /helm/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "gitea.gitea.fullname" . }} 5 | labels: 6 | app: {{ template "gitea.name" . }} 7 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | component: {{ default "gitea" .Values.service.nameOverride }} 11 | spec: 12 | replicas: 1 13 | strategy: 14 | type: RollingUpdate 15 | selector: 16 | matchLabels: 17 | app: {{ template "gitea.fullname" . }} 18 | template: 19 | metadata: 20 | labels: 21 | app: {{ template "gitea.fullname" . }} 22 | release: {{ .Release.Name }} 23 | spec: 24 | # Initial rights settings when creating disk can be incorrect for the git user in the gitea container: Use init container to set the rights 25 | initContainers: 26 | - name: init-disk 27 | image: busybox:latest 28 | command: 29 | - /bin/chown 30 | - 1000:1000 31 | - /data 32 | volumeMounts: 33 | - name: data 34 | mountPath: "/data" 35 | containers: 36 | - name: {{ .Chart.Name }} 37 | image: "{{ .Values.image }}:{{ .Values.imageTag }}" 38 | imagePullPolicy: {{ .Values.imagePullPolicy }} 39 | ports: 40 | - containerPort: 3000 41 | - containerPort: {{ .Values.service.sshPort | int }} 42 | # livenessProbe: 43 | # httpGet: 44 | # path: / 45 | # port: 3000 46 | # # This pod takes a very long time to start up. Be cautious when 47 | # # lowering this value to avoid Pod death during startup. 48 | # initialDelaySeconds: 200 49 | # timeoutSeconds: 1 50 | # periodSeconds: 10 51 | # successThreshold: 1 52 | # failureThreshold: 10 53 | # readinessProbe: 54 | # httpGet: 55 | # path: / 56 | # port: 3000 57 | # initialDelaySeconds: 30 58 | # timeoutSeconds: 1 59 | # periodSeconds: 10 60 | # successThreshold: 1 61 | # failureThreshold: 3 62 | resources: 63 | {{ toYaml .Values.resources | indent 12 }} 64 | volumeMounts: 65 | - name: data 66 | mountPath: /data 67 | - name: config 68 | mountPath: /data/gitea/conf/app.ini 69 | subPath: app.ini 70 | volumes: 71 | - name: config 72 | configMap: 73 | name: {{ template "gitea.fullname" . }}-config 74 | - name: data 75 | {{- if .Values.persistence.enabled }} 76 | persistentVolumeClaim: 77 | claimName: {{ template "gitea.fullname" . }} 78 | {{- else }} 79 | emptyDir: {} 80 | {{- end -}} 81 | -------------------------------------------------------------------------------- /helm/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.service.ingress.enabled -}} 2 | {{- $releaseName := .Release.Name -}} 3 | {{- $serviceName := default "gitea" .Values.service.nameOverride -}} 4 | {{- $httpPort := .Values.service.httpPort -}} 5 | apiVersion: extensions/v1beta1 6 | kind: Ingress 7 | metadata: 8 | name: {{ template "gitea.gitea.fullname" . }} 9 | labels: 10 | app: {{ template "gitea.name" . }} 11 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 12 | release: {{ .Release.Name }} 13 | heritage: {{ .Release.Service }} 14 | component: {{ default "gitea" .Values.service.nameOverride }} 15 | annotations: 16 | {{- range $key, $value := .Values.service.ingress.annotations }} 17 | {{ $key }}: {{ $value | quote }} 18 | {{- end }} 19 | spec: 20 | rules: 21 | {{- range .Values.service.ingress.hosts }} 22 | - host: {{ . }} 23 | http: 24 | paths: 25 | - backend: 26 | serviceName: {{ printf "%s-%s" $releaseName $serviceName | trunc 63 | trimSuffix "-" }} 27 | servicePort: {{ $httpPort }} 28 | {{- end -}} 29 | {{- if .Values.service.ingress.tls }} 30 | tls: 31 | {{ toYaml .Values.service.ingress.tls | indent 4 }} 32 | {{- end -}} 33 | {{- end -}} 34 | -------------------------------------------------------------------------------- /helm/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.persistence.enabled }} 2 | kind: PersistentVolumeClaim 3 | apiVersion: v1 4 | metadata: 5 | name: {{ template "gitea.gitea.fullname" . }} 6 | labels: 7 | app: {{ template "gitea.name" . }} 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 9 | release: {{ .Release.Name }} 10 | heritage: {{ .Release.Service }} 11 | component: {{ default "gitea" .Values.service.nameOverride }} 12 | spec: 13 | accessModes: 14 | - {{ .Values.persistence.accessMode | quote }} 15 | resources: 16 | requests: 17 | storage: {{ .Values.persistence.size | quote }} 18 | {{- if .Values.persistence.storageClass }} 19 | {{- if (eq "-" .Values.persistence.storageClass) }} 20 | storageClassName: "" 21 | {{- else }} 22 | storageClassName: "{{ .Values.persistence.storageClass }}" 23 | {{- end }} 24 | {{- end }} 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /helm/templates/secrets.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: {{ template "gitea.gitea.fullname" . }} 5 | labels: 6 | app: {{ template "gitea.name" . }} 7 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | component: {{ default "gitea" .Values.service.nameOverride }} 11 | type: Opaque 12 | data: 13 | postgresql-user: {{ .Values.postgresql.postgresUser | b64enc | quote }} 14 | -------------------------------------------------------------------------------- /helm/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ template "gitea.gitea.fullname" . }} 5 | labels: 6 | app: {{ template "gitea.name" . }} 7 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | component: {{ default "gitea" .Values.service.nameOverride }} 11 | {{- if .Values.service.annotations }} 12 | annotations: 13 | {{ toYaml .Values.service.annotations | indent 4 }} 14 | {{- end }} 15 | 16 | spec: 17 | type: {{ .Values.serviceType }} 18 | ports: 19 | - port: {{ .Values.service.httpPort | int }} 20 | targetPort: 3000 21 | name: {{ default "gitea" .Values.service.nameOverride }}-http 22 | - port: {{ .Values.service.sshPort | int }} 23 | targetPort: {{ .Values.service.sshPort | int }} 24 | name: {{ default "gitea" .Values.service.nameOverride }}-ssh 25 | selector: 26 | app: {{ template "gitea.fullname" . }} 27 | release: {{ .Release.Name }} 28 | -------------------------------------------------------------------------------- /helm/values.yaml: -------------------------------------------------------------------------------- 1 | ## Override the name of the Chart. 2 | ## 3 | # nameOverride: 4 | 5 | ## Kubernetes configuration 6 | ## For minikube, set this to NodePort, elsewhere use LoadBalancer 7 | ## 8 | serviceType: ClusterIP 9 | 10 | replicaCount: 1 11 | 12 | image: gitea/gitea 13 | imageTag: 1.5.1 14 | imagePullPolicy: IfNotPresent 15 | 16 | service: 17 | ## Override the components name (defaults to service). 18 | ## 19 | # nameOverride: 20 | 21 | ## HTTP listen port. 22 | ## ref: https://docs.gitea.io/en-us/config-cheat-sheet 23 | ## 24 | httpPort: 80 25 | 26 | ## SSH listen port. 27 | ## ref: https://docs.gitea.io/en-us/config-cheat-sheet 28 | ## 29 | sshPort: 22 30 | 31 | ## Gitea configuration values 32 | ## ref: https://docs.gitea.io/en-us/config-cheat-sheet 33 | ## 34 | gitea: 35 | 36 | ## Application name, can be your company or team name. 37 | ## 38 | appName: Gitea 39 | 40 | ## Running Gitea with which, user git recommonded. 41 | ## 42 | runUser: git 43 | 44 | ## Either "dev", "prod" or "test". 45 | ## 46 | runMode: prod 47 | 48 | ## Force every new repository to be private. 49 | ## 50 | forcePrivate: false 51 | 52 | ## Indicates whether or not to disable Git clone through HTTP/HTTPS. When 53 | ## disabled, users can only perform Git operations via SSH. 54 | ## 55 | disableHttpGit: false 56 | 57 | ## Indicates whether or not to enable repository file upload feature. 58 | ## 59 | repositoryUploadEnabled: true 60 | 61 | ## File types that are allowed to be uploaded, e.g. image/jpeg|image/png. 62 | ## Leave empty means allow any file typ 63 | ## 64 | repositoryUploadAllowedTypes: 65 | 66 | ## Maximum size of each file in MB. 67 | ## 68 | repositoryUploadMaxFileSize: 3 69 | 70 | ## Maximum number of files per upload. 71 | ## 72 | repositoryUploadMaxFiles: 5 73 | 74 | ## Enable this to use captcha validation for registration. 75 | ## 76 | serviceEnableCaptcha: true 77 | 78 | ## Users need to confirm e-mail for registration 79 | ## 80 | serviceRegisterEmailConfirm: false 81 | 82 | ## Weather or not to allow users to register. 83 | ## 84 | serviceDisableRegistration: false 85 | 86 | ## Weather or not sign in is required to view anything. 87 | ## 88 | serviceRequireSignInView: false 89 | 90 | ## Mail notification 91 | ## 92 | serviceEnableNotifyMail: false 93 | 94 | ## Either "memory", "redis", or "memcache", default is "memory" 95 | ## 96 | cacheAdapter: memory 97 | 98 | ## For "memory" only, GC interval in seconds, default is 60 99 | ## 100 | cacheInterval: 60 101 | 102 | ## For "redis" and "memcache", connection host address 103 | ## redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180 104 | ## memcache: `127.0.0.1:11211` 105 | ## 106 | cacheHost: 107 | 108 | ## The protocol the server listens on. One of 'http', 'https', 'unix' or 'fcgi'. 109 | ## 110 | serverProtocol: http 111 | 112 | ## Enable this to use captcha validation for registration. 113 | ## 114 | serverDomain: gitea.local 115 | 116 | ## Full public URL of Gitea server. 117 | ## 118 | serverRootUrl: http://gitea.local/ 119 | 120 | ## Landing page for non-logged users, can be "home" or "explore" 121 | ## 122 | serverLandingPage: home 123 | 124 | ## Either "mysql", "postgres" or "sqlite3", you can connect to TiDB with 125 | ## MySQL protocol. Default is to use the postgresql configuration included 126 | ## with this chart. 127 | ## 128 | databaseType: postgres 129 | 130 | ## Database host. Unused unless `postgresql.install` is false. 131 | ## 132 | databaseHost: postgres.local 133 | 134 | ## Database user. Unused unless `postgresql.install` is false. 135 | ## 136 | databaseUser: gitea 137 | 138 | ## Database password. Unused unless `postgresql.install` is false. 139 | ## 140 | databasePassword: giteapassword 141 | 142 | ## Database password. Unused unless `postgresql.install` is false. 143 | ## 144 | databaseName: gitea 145 | 146 | ## postgres (database access) only, either "disable", "require" or "verify-full" 147 | databaseSSLMode: disable 148 | 149 | ## Hook task queue length, increase if webhook shooting starts hanging 150 | ## 151 | webhookQueueLength: 1000 152 | 153 | ## Deliver timeout in seconds 154 | ## 155 | webhookDeliverTimeout: 5 156 | 157 | ## Allow insecure certification 158 | ## 159 | webhookSkipTlsVerify: true 160 | 161 | ## Number of history information in each page 162 | ## 163 | webhookPagingNum: 10 164 | 165 | ## Can be "console" and "file", default is "console" 166 | ## Use comma to separate multiple modes, e.g. "console, file" 167 | ## 168 | logMode: console 169 | 170 | ## Either "Trace", "Info", "Warn", "Error", "Fatal", default is "Trace" 171 | ## 172 | logLevel: Trace 173 | 174 | ## Undocumented, but you can take a guess. 175 | ## 176 | otherShowFooterBranding: false 177 | 178 | ## Show version information about Gitea and Go in the footer 179 | ## 180 | otherShowFooterVersion: true 181 | 182 | # Disallow regular (non-admin) users from creating organizations. 183 | disableRegularOrgCreation: false 184 | 185 | ## Change this value for your installation. 186 | ## 187 | securitySecretKey: "gitea" 188 | 189 | ## Number of repositories that are showed in one explore page 190 | ## 191 | uiExplorePagingNum: 20 192 | 193 | ## Number of issues that are showed in one page 194 | ## 195 | uiIssuePagingNum: 10 196 | 197 | ## Number of maximum commits showed in one activity feed. 198 | ## NOTE: This value is also used in how many commits a webhook will send. 199 | ## 200 | uiFeedMaxCommitNum: 5 201 | 202 | ## Ingress configuration. 203 | ## ref: https://kubernetes.io/docs/user-guide/ingress/ 204 | ## 205 | ingress: 206 | ## Enable Ingress. 207 | ## 208 | enabled: true 209 | 210 | ## Annotations. 211 | ## 212 | annotations: 213 | kubernetes.io/ingress.class: nginx 214 | nginx.ingress.kubernetes.io/rewrite-target: / 215 | # kubernetes.io/tls-acme: 'true' 216 | 217 | ## Hostnames. 218 | ## Must be provided if Ingress is enabled. 219 | ## 220 | hosts: 221 | - gitea.local 222 | 223 | ## TLS configuration. 224 | ## Secrets must be manually created in the namespace. 225 | ## 226 | tls: 227 | - secretName: ingress-certs 228 | hosts: 229 | - gitea.local 230 | 231 | ## Service annotations. 232 | ## Allows attaching metadata to services for kubernetes components to act on. 233 | ## 234 | # annotations: 235 | # service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http 236 | 237 | 238 | ## Persistent Volume Storage configuration. 239 | ## ref: https://kubernetes.io/docs/user-guide/persistent-volumes 240 | ## 241 | persistence: 242 | ## Enable persistence using Persistent Volume Claims. 243 | ## 244 | enabled: true 245 | 246 | ## gitea data Persistent Volume Storage Class 247 | ## If defined, storageClassName: 248 | ## If set to "-", storageClassName: "", which disables dynamic provisioning 249 | ## If undefined (the default) or set to null, no storageClassName spec is 250 | ## set, choosing the default provisioner. (gp2 on AWS, standard on 251 | ## GKE, AWS & OpenStack) 252 | ## 253 | ## If you are using minikube, use "standard" as the name, see: 254 | ## https://github.com/kubernetes/minikube/issues/2256 255 | storageClass: "managed-nfs-storage" 256 | 257 | ## Persistent Volume Access Mode. 258 | ## 259 | accessMode: ReadWriteOnce 260 | 261 | ## Persistent Volume Storage Size. 262 | ## 263 | size: 10Gi 264 | 265 | ## Configuration values for the postgresql dependency. 266 | ## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md 267 | ## 268 | postgresql: 269 | 270 | ### Install PostgreSQL dependency 271 | ## 272 | install: false 273 | 274 | ### PostgreSQL User to create. 275 | ## 276 | postgresUser: gitea 277 | 278 | ## PostgreSQL Password for the new user. 279 | ## If not set, a random 10 characters password will be used. 280 | ## 281 | postgresPassword: gitea 282 | 283 | ## PostgreSQL Database to create. 284 | ## 285 | postgresDatabase: gitea 286 | 287 | ## Persistent Volume Storage configuration. 288 | ## ref: https://kubernetes.io/docs/user-guide/persistent-volumes 289 | ## 290 | persistence: 291 | ## Enable PostgreSQL persistence using Persistent Volume Claims. 292 | ## 293 | enabled: true 294 | -------------------------------------------------------------------------------- /manifest/app.ini: -------------------------------------------------------------------------------- 1 | APP_NAME = Gitea 2 | RUN_USER = git 3 | RUN_MODE = prod 4 | 5 | [repository] 6 | FORCE_PRIVATE = false 7 | DISABLE_HTTP_GIT = false 8 | 9 | [repository.upload] 10 | ENABLED = true 11 | ALLOWED_TYPES = 12 | FILE_MAX_SIZE = 3 13 | MAX_FILES = 5 14 | 15 | [server] 16 | PROTOCOL = https 17 | HTTP_PORT = 443 18 | DOMAIN = gitea.local 19 | ROOT_URL = https://gitea.local/ 20 | LANDING_PAGE = home 21 | SSH_PORT = 22 22 | REDIRECT_OTHER_PORT = true 23 | PORT_TO_REDIRECT = 80 24 | 25 | [service] 26 | ENABLE_CAPTCHA = true 27 | ACTIVE_CODE_LIVE_MINUTES = 180 28 | RESET_PASSWD_CODE_LIVE_MINUTES = 180 29 | REGISTER_EMAIL_CONFIRM = false 30 | DISABLE_REGISTRATION = false 31 | REQUIRE_SIGNIN_VIEW = false 32 | ENABLE_NOTIFY_MAIL = false 33 | ENABLE_REVERSE_PROXY_AUTHENTICATION = false 34 | ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false 35 | 36 | [database] 37 | DB_TYPE = postgres 38 | HOST = postgres.local 39 | NAME = gitea 40 | USER = gitea 41 | PASSWD = giteapassword 42 | SSL_MODE = false 43 | 44 | [admin] 45 | DISABLE_REGULAR_ORG_CREATION = false 46 | 47 | [security] 48 | INSTALL_LOCK = true 49 | SECRET_KEY = "Z2l0ZWE=" 50 | 51 | [ui] 52 | EXPLORE_PAGING_NUM = 20 53 | ISSUE_PAGING_NUM = 10 54 | FEED_MAX_COMMIT_NUM = 5 55 | 56 | [cache] 57 | ADAPTER = memory 58 | INTERVAL = 60 59 | HOST = 60 | 61 | [webhook] 62 | QUEUE_LENGTH = 1000 63 | DELIVER_TIMEOUT = 5 64 | SKIP_TLS_VERIFY = true 65 | PAGING_NUM = 10 66 | 67 | [log] 68 | MODE = console 69 | LEVEL = Trace 70 | 71 | [other] 72 | SHOW_FOOTER_BRANDING = false 73 | SHOW_FOOTER_VERSION = true 74 | -------------------------------------------------------------------------------- /manifest/createConfigMap.sh: -------------------------------------------------------------------------------- 1 | kubectl create configmap gitea-config --from-file=app.ini --namespace=env 2 | -------------------------------------------------------------------------------- /manifest/deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: gitea 5 | namespace: env 6 | labels: 7 | name: gitea 8 | spec: 9 | replicas: 1 10 | strategy: 11 | rollingUpdate: 12 | maxSurge: 0 13 | maxUnavailable: 1 14 | type: RollingUpdate 15 | template: 16 | metadata: 17 | labels: 18 | name: gitea 19 | spec: 20 | # Initial rights settings when creating disk can be incorrect for the git user in the gitea container: Use init container to set the rights 21 | initContainers: 22 | - name: init-disk 23 | image: busybox:latest 24 | command: 25 | - /bin/chown 26 | - 1000:1000 27 | - /data 28 | volumeMounts: 29 | - name: gitea 30 | mountPath: "/data" 31 | containers: 32 | - name: gitea 33 | image: "gitea/gitea:1.5" 34 | imagePullPolicy: IfNotPresent 35 | ports: 36 | - containerPort: 3000 37 | - containerPort: 22 38 | volumeMounts: 39 | - name: gitea 40 | mountPath: "/data" 41 | - name: gitea-config 42 | mountPath: /data/gitea/conf 43 | resources: 44 | requests: 45 | cpu: 10m 46 | memory: 50Mi 47 | limits: 48 | cpu: 1 49 | memory: 200Mi 50 | volumes: 51 | - name: gitea 52 | persistentVolumeClaim: 53 | claimName: gitea 54 | - name: gitea-config 55 | configMap: 56 | name: gitea-config 57 | -------------------------------------------------------------------------------- /manifest/ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Ingress 3 | metadata: 4 | name: gitea 5 | namespace: env 6 | annotations: 7 | kubernetes.io/ingress.class: nginx 8 | nginx.ingress.kubernetes.io/rewrite-target: / 9 | spec: 10 | tls: 11 | - hosts: 12 | - gitea.local 13 | secretName: ingress-secrets 14 | rules: 15 | - host: gitea.local 16 | http: 17 | paths: 18 | - path: / 19 | backend: 20 | serviceName: gitea 21 | servicePort: 443 22 | - backend: 23 | serviceName: gitea-ssh 24 | servicePort: 22 25 | -------------------------------------------------------------------------------- /manifest/pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: gitea 5 | namespace: env 6 | annotations: 7 | volume.beta.kubernetes.io/storage-class: "managed-nfs-storage" 8 | spec: 9 | accessModes: 10 | - ReadWriteOnce 11 | resources: 12 | requests: 13 | storage: 10Gi -------------------------------------------------------------------------------- /manifest/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: gitea 5 | namespace: env 6 | labels: 7 | name: gitea 8 | spec: 9 | ports: 10 | - name: gitea 11 | port: 443 12 | targetPort: 3000 13 | - name: gitea-ssh 14 | port: 22 15 | targetPort: 22 16 | selector: 17 | name: gitea 18 | type: ClusterIP 19 | sessionAffinity: ClientIP 20 | --------------------------------------------------------------------------------