├── .gitignore
├── .helmignore
├── Chart.yaml
├── LICENSE
├── Makefile
├── README.md
├── charts
├── README.md
├── django-0.1.0.tgz
├── django-0.2.0.tgz
├── django-0.3.0.tgz
├── django-1.0.0.tgz
├── index.html
└── index.yaml
├── templates
├── NOTES.txt
├── _helpers.tpl
├── celery-beat
│ └── deployment.yaml
├── celery-flower
│ ├── deployment.yaml
│ ├── ingress.yaml
│ └── service.yaml
├── celery-worker
│ └── deployment.yaml
├── django-core
│ ├── configmap.yaml
│ ├── pvc.yaml
│ ├── role.yaml
│ ├── rolebinding.yaml
│ └── serviceaccount.yaml
├── django-job
│ ├── collectstatic.yaml
│ └── migrate.yaml
├── django-server
│ ├── deployment.yaml
│ ├── hpa.yaml
│ ├── ingress.yaml
│ └── service.yaml
├── grpc-server
│ ├── deployment.yaml
│ ├── hpa.yaml
│ ├── ingress.yaml
│ └── service.yaml
└── tests
│ └── test-connection.yaml
└── values.yaml
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | pip-wheel-metadata/
24 | share/python-wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | *.py,cover
51 | .hypothesis/
52 | .pytest_cache/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | target/
76 |
77 | # Jupyter Notebook
78 | .ipynb_checkpoints
79 |
80 | # IPython
81 | profile_default/
82 | ipython_config.py
83 |
84 | # pyenv
85 | .python-version
86 |
87 | # pipenv
88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
91 | # install all needed dependencies.
92 | #Pipfile.lock
93 |
94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95 | __pypackages__/
96 |
97 | # Celery stuff
98 | celerybeat-schedule
99 | celerybeat.pid
100 |
101 | # SageMath parsed files
102 | *.sage.py
103 |
104 | # Environments
105 | .env
106 | .venv
107 | env/
108 | venv/
109 | ENV/
110 | env.bak/
111 | venv.bak/
112 |
113 | # Spyder project settings
114 | .spyderproject
115 | .spyproject
116 |
117 | # Rope project settings
118 | .ropeproject
119 |
120 | # mkdocs documentation
121 | /site
122 |
123 | # mypy
124 | .mypy_cache/
125 | .dmypy.json
126 | dmypy.json
127 |
128 | # Pyre type checker
129 | .pyre/
130 |
--------------------------------------------------------------------------------
/.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 | charts/
25 |
--------------------------------------------------------------------------------
/Chart.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v2
2 | name: django
3 | description: A Helm chart for Kubernetes
4 |
5 | # A chart can be either an 'application' or a 'library' chart.
6 | #
7 | # Application charts are a collection of templates that can be packaged into versioned archives
8 | # to be deployed.
9 | #
10 | # Library charts provide useful utilities or functions for the chart developer. They're included as
11 | # a dependency of application charts to inject those utilities and functions into the rendering
12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed.
13 | type: application
14 |
15 | # This is the chart version. This version number should be incremented each time you make changes
16 | # to the chart and its templates, including the app version.
17 | version: 1.0.0
18 |
19 | # This is the version number of the application being deployed. This version number should be
20 | # incremented each time you make changes to the application.
21 | # appVersion: 1.16.0
22 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | package:
2 | helm package . -d charts; \
3 | helm repo index charts --url https://itswcg.github.io/django-helm/charts;
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Helm Chart for Django
2 | This helm chart install django in a kubernetes cluster.
3 |
4 | ### Install Helm
5 | Read and follow the [Helm installation guide](https://helm.sh/docs/intro/install/).
6 |
7 | Note: The charts in this repository require Helm version 3.x or later.
8 |
9 | ### Add the Django Helm Chart repo
10 | In order to be able to use the charts in this repository, add the name and URL to your Helm client:
11 | ```bash
12 | helm repo add django https://itswcg.github.io/django-helm/charts/
13 | helm repo update
14 | ```
15 |
16 | ### Install charts
17 | ```bash
18 | helm install my-release django/django -f values.yaml
19 | ```
20 |
21 | ### Configuration
22 | django-helm includes
23 |
24 | * django-server
25 | * django-config
26 | * django-volumes
27 | * django-celery-beat
28 | * django-celery-work
29 | * django-celery-flower
30 | * django-grpc-server
31 | * django-migrate-job
32 | * django-collectstatic-job
33 | * django-log
34 |
35 | see [values.yaml](https://github.com/itswcg/django-helm/blob/master/values.yaml)
36 |
37 | ### For production
38 | Integrated alicloud hpa, sls.
--------------------------------------------------------------------------------
/charts/README.md:
--------------------------------------------------------------------------------
1 | ## Django Chart Repository
2 | The repository holds the files needed for a Django chart repository.
--------------------------------------------------------------------------------
/charts/django-0.1.0.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itswcg/django-helm/11b65c8bfdc70cfa95689c497f52b003992f70f7/charts/django-0.1.0.tgz
--------------------------------------------------------------------------------
/charts/django-0.2.0.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itswcg/django-helm/11b65c8bfdc70cfa95689c497f52b003992f70f7/charts/django-0.2.0.tgz
--------------------------------------------------------------------------------
/charts/django-0.3.0.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itswcg/django-helm/11b65c8bfdc70cfa95689c497f52b003992f70f7/charts/django-0.3.0.tgz
--------------------------------------------------------------------------------
/charts/django-1.0.0.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itswcg/django-helm/11b65c8bfdc70cfa95689c497f52b003992f70f7/charts/django-1.0.0.tgz
--------------------------------------------------------------------------------
/charts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Django Chart Repository
4 |
5 |
6 | Django Chart Repository
--------------------------------------------------------------------------------
/charts/index.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | entries:
3 | django:
4 | - apiVersion: v2
5 | created: "2020-05-21T13:39:36.956667+08:00"
6 | description: A Helm chart for Kubernetes
7 | digest: 46d9b7d4ad4f0021ceba1c2253b8cb5e3509ab9b7bf483218a6bf4665a86befc
8 | name: django
9 | type: application
10 | urls:
11 | - https://itswcg.github.io/django-helm/charts/django-1.0.0.tgz
12 | version: 1.0.0
13 | - apiVersion: v2
14 | created: "2020-05-21T13:39:36.955738+08:00"
15 | description: A Helm chart for Kubernetes
16 | digest: 0f85a5c3e7726fe4d43c50e46d9e3791f72d1ffea84d19f337780f9398853f81
17 | name: django
18 | type: application
19 | urls:
20 | - https://itswcg.github.io/django-helm/charts/django-0.3.0.tgz
21 | version: 0.3.0
22 | - apiVersion: v2
23 | created: "2020-05-21T13:39:36.954228+08:00"
24 | description: A Helm chart for Kubernetes
25 | digest: 36e21a03a76ad43816085dfc6e8d97d9e66d6e8a93ee666a623fcc136c4936f7
26 | name: django
27 | type: application
28 | urls:
29 | - https://itswcg.github.io/django-helm/charts/django-0.2.0.tgz
30 | version: 0.2.0
31 | - apiVersion: v2
32 | appVersion: 1.16.0
33 | created: "2020-05-21T13:39:36.952031+08:00"
34 | description: A Helm chart for Kubernetes
35 | digest: 24dba1d7cdf8d843eafa714c74c4d1f82cf0575183b17e4abd31a6d81842754a
36 | name: django
37 | type: application
38 | urls:
39 | - https://itswcg.github.io/django-helm/charts/django-0.1.0.tgz
40 | version: 0.1.0
41 | generated: "2020-05-21T13:39:36.95043+08:00"
42 |
--------------------------------------------------------------------------------
/templates/NOTES.txt:
--------------------------------------------------------------------------------
1 | Please enjoy.
--------------------------------------------------------------------------------
/templates/_helpers.tpl:
--------------------------------------------------------------------------------
1 | {{/* vim: set filetype=mustache: */}}
2 | {{/*
3 | Expand the name of the chart.
4 | */}}
5 | {{- define "django-helm.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 "django-helm.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 "django-helm.chart" -}}
31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32 | {{- end -}}
33 |
34 | {{/*
35 | Common labels
36 | */}}
37 | {{- define "django-helm.labels" -}}
38 | helm.sh/chart: {{ include "django-helm.chart" . }}
39 | {{ include "django-helm.selectorLabels" . }}
40 | {{- if .Chart.AppVersion }}
41 | app.kubernetes.io/version: {{ .Values.image.tag | quote }}
42 | {{- end }}
43 | app.kubernetes.io/managed-by: {{ .Release.Service }}
44 | {{- end -}}
45 |
46 | {{/*
47 | Selector labels
48 | */}}
49 | {{- define "django-helm.selectorLabels" -}}
50 | app.kubernetes.io/name: {{ include "django-helm.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 "django-helm.serviceAccountName" -}}
58 | {{- if .Values.serviceAccount.create -}}
59 | {{ default (include "django-helm.fullname" .) .Values.serviceAccount.name }}
60 | {{- else -}}
61 | {{ default "default" .Values.serviceAccount.name }}
62 | {{- end -}}
63 | {{- end -}}
64 |
--------------------------------------------------------------------------------
/templates/celery-beat/deployment.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.celeryBeat.enabled -}}
2 | apiVersion: apps/v1
3 | kind: Deployment
4 | metadata:
5 | name: {{.Release.Name}}-celery-beat
6 | labels:
7 | {{- include "django-helm.labels" . | nindent 4 }}
8 | app.kubernetes.io/component: celery-beat
9 | spec:
10 | replicas: 1
11 | selector:
12 | matchLabels:
13 | {{- include "django-helm.labels" . | nindent 6 }}
14 | app.kubernetes.io/component: celery-beat
15 | strategy:
16 | type: Recreate
17 | template:
18 | metadata:
19 | labels:
20 | {{- include "django-helm.labels" . | nindent 8 }}
21 | app.kubernetes.io/component: celery-beat
22 | annotations:
23 | checksum/config: {{include (print $.Template.BasePath "/django-core/configmap.yaml") . | sha256sum }}
24 | spec:
25 | {{- with .Values.image.imagePullSecrets }}
26 | imagePullSecrets:
27 | {{- toYaml . | nindent 8 }}
28 | {{- end }}
29 | securityContext:
30 | {{- toYaml .Values.celeryBeat.podSecurityContext | nindent 8 }}
31 | containers:
32 | - name: {{ .Chart.Name }}
33 | securityContext:
34 | {{- toYaml .Values.celeryBeat.securityContext | nindent 12 }}
35 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
36 | imagePullPolicy: {{ .Values.image.pullPolicy }}
37 | {{- with .Values.celeryBeat.command }}
38 | command:
39 | {{- toYaml . | nindent 12 }}
40 | {{- end }}
41 | envFrom:
42 | - configMapRef:
43 | name: {{.Release.Name}}-config
44 | env:
45 | - name: aliyun_logs_{{.Release.Name}}-celery-beat
46 | value: stdout
47 | resources:
48 | {{- toYaml .Values.celeryBeat.resources | nindent 12 }}
49 | {{- with .Values.celeryBeat.nodeSelector }}
50 | nodeSelector:
51 | {{- toYaml . | nindent 8 }}
52 | {{- end }}
53 | {{- with .Values.celeryBeat.affinity }}
54 | affinity:
55 | {{- toYaml . | nindent 8 }}
56 | {{- end }}
57 | {{- with .Values.celeryBeat.tolerations }}
58 | tolerations:
59 | {{- toYaml . | nindent 8 }}
60 | {{- end }}
61 | {{- end -}}
--------------------------------------------------------------------------------
/templates/celery-flower/deployment.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.celerFlower.enabled -}}
2 | apiVersion: apps/v1
3 | kind: Deployment
4 | metadata:
5 | name: {{.Release.Name}}-celery-flower
6 | labels:
7 | {{- include "django-helm.labels" . | nindent 4 }}
8 | app.kubernetes.io/component: celery-flower
9 | spec:
10 | replicas: 1
11 | selector:
12 | matchLabels:
13 | {{- include "django-helm.labels" . | nindent 6 }}
14 | app.kubernetes.io/component: celery-flower
15 | strategy:
16 | rollingUpdate:
17 | maxSurge: 25%
18 | maxUnavailable: 25%
19 | type: RollingUpdate
20 | template:
21 | metadata:
22 | labels:
23 | {{- include "django-helm.labels" . | nindent 8 }}
24 | app.kubernetes.io/component: celery-flower
25 | annotations:
26 | checksum/config: {{include (print $.Template.BasePath "/django-core/configmap.yaml") . | sha256sum }}
27 | spec:
28 | {{- with .Values.image.imagePullSecrets }}
29 | imagePullSecrets:
30 | {{- toYaml . | nindent 8 }}
31 | {{- end }}
32 | securityContext:
33 | {{- toYaml .Values.celeryBeat.podSecurityContext | nindent 8 }}
34 | containers:
35 | - name: {{ .Chart.Name }}
36 | securityContext:
37 | {{- toYaml .Values.celeryBeat.securityContext | nindent 12 }}
38 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
39 | imagePullPolicy: {{ .Values.image.pullPolicy }}
40 | {{- with .Values.celerFlower.command }}
41 | command:
42 | {{- toYaml . | nindent 12 }}
43 | {{- end }}
44 | envFrom:
45 | - configMapRef:
46 | name: {{.Release.Name}}-config
47 | env:
48 | - name: aliyun_logs_{{.Release.Name}}-celery-flower
49 | value: stdout
50 | ports:
51 | - name: flower
52 | containerPort: {{ .Values.celerFlower.service.port }}
53 | protocol: TCP
54 | resources:
55 | {{- toYaml .Values.celerFlower.resources | nindent 12 }}
56 | {{- with .Values.celerFlower.nodeSelector }}
57 | nodeSelector:
58 | {{- toYaml . | nindent 8 }}
59 | {{- end }}
60 | {{- with .Values.celerFlower.affinity }}
61 | affinity:
62 | {{- toYaml . | nindent 8 }}
63 | {{- end }}
64 | {{- with .Values.celerFlower.tolerations }}
65 | tolerations:
66 | {{- toYaml . | nindent 8 }}
67 | {{- end }}
68 | {{- end -}}
--------------------------------------------------------------------------------
/templates/celery-flower/ingress.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.celerFlower.ingress.enabled -}}
2 | {{- $fullName := include "django-helm.fullname" . -}}
3 | {{- $svcPort := .Values.celerFlower.service.port -}}
4 | {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
5 | apiVersion: networking.k8s.io/v1beta1
6 | {{- else -}}
7 | apiVersion: extensions/v1beta1
8 | {{- end }}
9 | kind: Ingress
10 | metadata:
11 | name: {{.Release.Name}}-celery-flower
12 | labels:
13 | {{- include "django-helm.labels" . | nindent 4 }}
14 | {{- with .Values.celerFlower.ingress.annotations }}
15 | annotations:
16 | {{- toYaml . | nindent 4 }}
17 | {{- end }}
18 | spec:
19 | {{- if .Values.celerFlower.ingress.tls }}
20 | tls:
21 | {{- range .Values.celerFlower.ingress.tls }}
22 | - hosts:
23 | {{- range .hosts }}
24 | - {{ . | quote }}
25 | {{- end }}
26 | secretName: {{ .secretName }}
27 | {{- end }}
28 | {{- end }}
29 | rules:
30 | {{- range .Values.celerFlower.ingress.hosts }}
31 | - host: {{ .host | quote }}
32 | http:
33 | paths:
34 | {{- range .paths }}
35 | - path: {{ . }}
36 | backend:
37 | serviceName: {{ $fullName }}
38 | servicePort: {{ $svcPort }}
39 | {{- end }}
40 | {{- end }}
41 | {{- end }}
42 |
--------------------------------------------------------------------------------
/templates/celery-flower/service.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.celerFlower.enabled -}}
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: {{.Release.Name}}-celery-flower
6 | labels:
7 | {{- include "django-helm.labels" . | nindent 4 }}
8 | spec:
9 | type: {{ .Values.celerFlower.service.type }}
10 | ports:
11 | - port: {{ .Values.celerFlower.service.port }}
12 | targetPort: flower
13 | protocol: TCP
14 | name: flower
15 | selector:
16 | {{- include "django-helm.labels" . | nindent 4 }}
17 | app.kubernetes.io/component: celery-flower
18 | {{- end -}}
--------------------------------------------------------------------------------
/templates/celery-worker/deployment.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.celeryWorker.enabled -}}
2 | {{- range .Values.celeryWorker.queue -}}
3 | apiVersion: apps/v1
4 | kind: Deployment
5 | metadata:
6 | name: {{$.Release.Name}}-celery-work-{{.name}}
7 | labels:
8 | {{- include "django-helm.labels" $ | nindent 4 }}
9 | app.kubernetes.io/component: {{$.Release.Name}}-celery-work-{{.name}}
10 | spec:
11 | replicas: {{ .replicaCount }}
12 | selector:
13 | matchLabels:
14 | {{- include "django-helm.labels" $ | nindent 6 }}
15 | app.kubernetes.io/component: {{$.Release.Name}}-celery-work-{{.name}}
16 | strategy:
17 | rollingUpdate:
18 | maxSurge: 25%
19 | maxUnavailable: 25%
20 | type: RollingUpdate
21 | template:
22 | metadata:
23 | labels:
24 | {{- include "django-helm.labels" $ | nindent 8 }}
25 | app.kubernetes.io/component: {{$.Release.Name}}-celery-work-{{.name}}
26 | annotations:
27 | checksum/config: {{include (print $.Template.BasePath "/django-core/configmap.yaml") $ | sha256sum }}
28 | spec:
29 | {{- with $.Values.image.imagePullSecrets }}
30 | imagePullSecrets:
31 | {{- toYaml . | nindent 8 }}
32 | {{- end }}
33 | securityContext:
34 | {{- toYaml .podSecurityContext | nindent 8 }}
35 | containers:
36 | - name: {{ $.Chart.Name }}
37 | securityContext:
38 | {{- toYaml .securityContext | nindent 12 }}
39 | image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
40 | imagePullPolicy: {{ $.Values.image.pullPolicy }}
41 | {{- with .command }}
42 | command:
43 | {{- toYaml . | nindent 12 }}
44 | {{- end }}
45 | envFrom:
46 | - configMapRef:
47 | name: {{$.Release.Name}}-config
48 | env:
49 | - name: aliyun_logs_{{$.Release.Name}}-celery-work-{{.name}}
50 | value: stdout
51 | resources:
52 | {{- toYaml .resources | nindent 12 }}
53 | {{- with .nodeSelector }}
54 | nodeSelector:
55 | {{- toYaml . | nindent 8 }}
56 | {{- end }}
57 | {{- with .affinity }}
58 | affinity:
59 | {{- toYaml . | nindent 8 }}
60 | {{- end }}
61 | {{- with .tolerations }}
62 | tolerations:
63 | {{- toYaml . | nindent 8 }}
64 | {{- end }}
65 | ---
66 | {{- end -}}
67 | {{- end -}}
68 |
--------------------------------------------------------------------------------
/templates/django-core/configmap.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ConfigMap
3 | metadata:
4 | name: {{.Release.Name}}-config
5 | data:
6 | {{- range $key, $val := .Values.configmap.data }}
7 | {{$key}}: {{ $val | quote }}
8 | {{- end }}
--------------------------------------------------------------------------------
/templates/django-core/pvc.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.pvc.created -}}
2 | apiVersion: v1
3 | kind: PersistentVolumeClaim
4 | metadata:
5 | name: {{.Release.Name}}-nfs-pvc
6 | spec:
7 | accessModes:
8 | - ReadWriteMany
9 | storageClassName: {{ .Values.pvc.storageClassName }}
10 | resources:
11 | requests:
12 | storage: 5Gi
13 | {{- end -}}
14 |
--------------------------------------------------------------------------------
/templates/django-core/role.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itswcg/django-helm/11b65c8bfdc70cfa95689c497f52b003992f70f7/templates/django-core/role.yaml
--------------------------------------------------------------------------------
/templates/django-core/rolebinding.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itswcg/django-helm/11b65c8bfdc70cfa95689c497f52b003992f70f7/templates/django-core/rolebinding.yaml
--------------------------------------------------------------------------------
/templates/django-core/serviceaccount.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.serviceAccount.created -}}
2 | apiVersion: v1
3 | kind: ServiceAccount
4 | serviceAccountName: {{ include "django-helm.serviceAccountName" . }}
5 | metadata:
6 | name: {{ include "django-helm.serviceAccountName" . }}
7 | labels:
8 | {{- include "django-helm.labels" . | nindent 4 }}
9 | {{- with .Values.serviceAccount.annotations }}
10 | annotations:
11 | {{- toYaml . | nindent 4 }}
12 | {{- end }}
13 | {{- end -}}
14 |
--------------------------------------------------------------------------------
/templates/django-job/collectstatic.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.collectstaticJob.enabled -}}
2 | apiVersion: batch/v1
3 | kind: Job
4 | metadata:
5 | name: {{.Release.Name}}-collectstatic
6 | labels:
7 | {{- include "django-helm.labels" . | nindent 4 }}
8 | app.kubernetes.io/component: collectstatic-job
9 | spec:
10 | template:
11 | # ttlSecondsAfterFinished: 60
12 | spec:
13 | {{- with .Values.image.imagePullSecrets }}
14 | imagePullSecrets:
15 | {{- toYaml . | nindent 8 }}
16 | {{- end }}
17 | securityContext:
18 | {{- toYaml .Values.djangoServer.podSecurityContext | nindent 8 }}
19 | containers:
20 | - name: {{ .Chart.Name }}
21 | securityContext:
22 | {{- toYaml .Values.djangoServer.securityContext | nindent 12 }}
23 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
24 | imagePullPolicy: {{ .Values.image.pullPolicy }}
25 | command: ["python", "manage.py", "collectstatic"]
26 | envFrom:
27 | - configMapRef:
28 | name: {{.Release.Name}}-config
29 | restartPolicy: Never
30 | backoffLimit: 0
31 | {{- end -}}
--------------------------------------------------------------------------------
/templates/django-job/migrate.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.migrateJob.enabled -}}
2 | apiVersion: batch/v1
3 | kind: Job
4 | metadata:
5 | name: {{.Release.Name}}-migrate
6 | labels:
7 | {{- include "django-helm.labels" . | nindent 4 }}
8 | app.kubernetes.io/component: migrate-job
9 | spec:
10 | template:
11 | # ttlSecondsAfterFinished: 60
12 | spec:
13 | {{- with .Values.image.imagePullSecrets }}
14 | imagePullSecrets:
15 | {{- toYaml . | nindent 8 }}
16 | {{- end }}
17 | securityContext:
18 | {{- toYaml .Values.djangoServer.podSecurityContext | nindent 8 }}
19 | containers:
20 | - name: {{ .Chart.Name }}
21 | securityContext:
22 | {{- toYaml .Values.djangoServer.securityContext | nindent 12 }}
23 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
24 | imagePullPolicy: {{ .Values.image.pullPolicy }}
25 | command: ["python", "manage.py", "migrate", "--settings=$(DJANGO_SETTINGS_MODULE)"]
26 | envFrom:
27 | - configMapRef:
28 | name: {{.Release.Name}}-config
29 | restartPolicy: Never
30 | backoffLimit: 0
31 | {{- end -}}
--------------------------------------------------------------------------------
/templates/django-server/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: {{.Release.Name}}-django-server
5 | labels:
6 | {{- include "django-helm.labels" . | nindent 4 }}
7 | app.kubernetes.io/component: django-server
8 | spec:
9 | replicas: {{ .Values.djangoServer.replicaCount }}
10 | selector:
11 | matchLabels:
12 | {{- include "django-helm.labels" . | nindent 6 }}
13 | app.kubernetes.io/component: django-server
14 | strategy:
15 | rollingUpdate:
16 | maxSurge: 25%
17 | maxUnavailable: 25%
18 | type: RollingUpdate
19 | template:
20 | metadata:
21 | labels:
22 | {{- include "django-helm.labels" . | nindent 8 }}
23 | app.kubernetes.io/component: django-server
24 | annotations:
25 | checksum/config: {{include (print $.Template.BasePath "/django-core/configmap.yaml") . | sha256sum }}
26 | spec:
27 | {{- with .Values.image.imagePullSecrets }}
28 | imagePullSecrets:
29 | {{- toYaml . | nindent 8 }}
30 | {{- end }}
31 | securityContext:
32 | {{- toYaml .Values.djangoServer.podSecurityContext | nindent 8 }}
33 | containers:
34 | - name: {{ .Chart.Name }}
35 | securityContext:
36 | {{- toYaml .Values.djangoServer.securityContext | nindent 12 }}
37 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
38 | imagePullPolicy: {{ .Values.image.pullPolicy }}
39 | readinessProbe:
40 | httpGet:
41 | path: {{ .Values.djangoServer.probe.readiness.path }}
42 | port: django
43 | initialDelaySeconds: 15
44 | periodSeconds: 10
45 | livenessProbe:
46 | httpGet:
47 | path: {{ .Values.djangoServer.probe.liveness.path }}
48 | port: django
49 | failureThreshold: 1
50 | periodSeconds: 10
51 | {{- with .Values.djangoServer.command }}
52 | command:
53 | {{- toYaml . | nindent 12 }}
54 | {{- end }}
55 | envFrom:
56 | - configMapRef:
57 | name: {{.Release.Name}}-config
58 | env:
59 | - name: aliyun_logs_{{.Release.Name}}-django-server
60 | value: stdout
61 | ports:
62 | - name: django
63 | containerPort: 8000
64 | protocol: TCP
65 | resources:
66 | {{- toYaml .Values.djangoServer.resources | nindent 12 }}
67 | {{- with .Values.djangoServer.nodeSelector }}
68 | nodeSelector:
69 | {{- toYaml . | nindent 8 }}
70 | {{- end }}
71 | {{- with .Values.djangoServer.affinity }}
72 | affinity:
73 | {{- toYaml . | nindent 8 }}
74 | {{- end }}
75 | {{- with .Values.djangoServer.tolerations }}
76 | tolerations:
77 | {{- toYaml . | nindent 8 }}
78 | {{- end }}
79 |
--------------------------------------------------------------------------------
/templates/django-server/hpa.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: autoscaling/v2beta1
2 | kind: HorizontalPodAutoscaler
3 | metadata:
4 | name: {{.Release.Name}}-django-server
5 | labels:
6 | {{- include "django-helm.labels" . | nindent 4 }}
7 | spec:
8 | scaleTargetRef:
9 | apiVersion: apps/v1
10 | kind: Deployment
11 | name: {{.Release.Name}}-django-server
12 | minReplicas: 1
13 | maxReplicas: 10
14 | metrics:
15 | - type: Resource
16 | resource:
17 | name: cpu
18 | targetAverageUtilization: 1
19 |
--------------------------------------------------------------------------------
/templates/django-server/ingress.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.djangoServer.ingress.enabled -}}
2 | {{- $fullName := include "django-helm.fullname" . -}}
3 | {{- $svcPort := .Values.djangoServer.service.port -}}
4 | {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
5 | apiVersion: networking.k8s.io/v1beta1
6 | {{- else -}}
7 | apiVersion: extensions/v1beta1
8 | {{- end }}
9 | kind: Ingress
10 | metadata:
11 | name: {{.Release.Name}}-django-server
12 | labels:
13 | {{- include "django-helm.labels" . | nindent 4 }}
14 | {{- with .Values.djangoServer.ingress.annotations }}
15 | annotations:
16 | {{- toYaml . | nindent 4 }}
17 | {{- end }}
18 | spec:
19 | {{- if .Values.djangoServer.ingress.tls }}
20 | tls:
21 | {{- range .Values.djangoServer.ingress.tls }}
22 | - hosts:
23 | {{- range .hosts }}
24 | - {{ . | quote }}
25 | {{- end }}
26 | secretName: {{ .secretName }}
27 | {{- end }}
28 | {{- end }}
29 | rules:
30 | {{- range .Values.djangoServer.ingress.hosts }}
31 | - host: {{ .host | quote }}
32 | http:
33 | paths:
34 | {{- range .paths }}
35 | - path: {{ . }}
36 | backend:
37 | serviceName: {{ $fullName }}-server
38 | servicePort: {{ $svcPort }}
39 | {{- end }}
40 | {{- end }}
41 | {{- end }}
42 |
--------------------------------------------------------------------------------
/templates/django-server/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{.Release.Name}}-django-server
5 | labels:
6 | {{- include "django-helm.labels" . | nindent 4 }}
7 | spec:
8 | type: {{ .Values.djangoServer.service.type }}
9 | ports:
10 | - port: {{ .Values.djangoServer.service.port }}
11 | targetPort: django
12 | protocol: TCP
13 | name: django
14 | selector:
15 | {{- include "django-helm.labels" . | nindent 4 }}
16 | app.kubernetes.io/component: django-server
--------------------------------------------------------------------------------
/templates/grpc-server/deployment.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.grpcServer.enabled -}}
2 | apiVersion: apps/v1
3 | kind: Deployment
4 | metadata:
5 | name: {{.Release.Name}}-grpc-server
6 | labels:
7 | {{- include "django-helm.labels" . | nindent 4 }}
8 | app.kubernetes.io/component: grpc-server
9 | spec:
10 | replicas: {{ .Values.grpcServer.replicaCount }}
11 | selector:
12 | matchLabels:
13 | {{- include "django-helm.labels" . | nindent 6 }}
14 | app.kubernetes.io/component: grpc-server
15 | strategy:
16 | rollingUpdate:
17 | maxSurge: 25%
18 | maxUnavailable: 25%
19 | type: RollingUpdate
20 | template:
21 | metadata:
22 | labels:
23 | {{- include "django-helm.labels" . | nindent 8 }}
24 | app.kubernetes.io/component: grpc-server
25 | annotations:
26 | checksum/config: {{include (print $.Template.BasePath "/django-core/configmap.yaml") . | sha256sum }}
27 | spec:
28 | {{- with .Values.image.imagePullSecrets }}
29 | imagePullSecrets:
30 | {{- toYaml . | nindent 8 }}
31 | {{- end }}
32 | securityContext:
33 | {{- toYaml .Values.grpcServer.podSecurityContext | nindent 8 }}
34 | containers:
35 | - name: {{ .Chart.Name }}
36 | securityContext:
37 | {{- toYaml .Values.grpcServer.securityContext | nindent 12 }}
38 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
39 | imagePullPolicy: {{ .Values.image.pullPolicy }}
40 | readinessProbe:
41 | httpGet:
42 | path: /
43 | port: http
44 | initialDelaySeconds: 15
45 | periodSeconds: 10
46 | livenessProbe:
47 | httpGet:
48 | path: /
49 | port: http
50 | failureThreshold: 1
51 | periodSeconds: 10
52 | {{- with .Values.grpcServer.command }}
53 | command:
54 | {{- toYaml . | nindent 12 }}
55 | {{- end }}
56 | envFrom:
57 | - configMapRef:
58 | name: {{.Release.Name}}-config
59 | env:
60 | - name: aliyun_logs_{{.Release.Name}}-grpc-server
61 | value: stdout
62 | ports:
63 | - name: grpc
64 | containerPort: 8001
65 | protocol: TCP
66 | resources:
67 | {{- toYaml .Values.grpcServer.resources | nindent 12 }}
68 | {{- with .Values.djangoServer.nodeSelector }}
69 | nodeSelector:
70 | {{- toYaml . | nindent 8 }}
71 | {{- end }}
72 | {{- with .Values.grpcServer.affinity }}
73 | affinity:
74 | {{- toYaml . | nindent 8 }}
75 | {{- end }}
76 | {{- with .Values.grpcServer.tolerations }}
77 | tolerations:
78 | {{- toYaml . | nindent 8 }}
79 | {{- end }}
80 | {{- end }}
--------------------------------------------------------------------------------
/templates/grpc-server/hpa.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itswcg/django-helm/11b65c8bfdc70cfa95689c497f52b003992f70f7/templates/grpc-server/hpa.yaml
--------------------------------------------------------------------------------
/templates/grpc-server/ingress.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itswcg/django-helm/11b65c8bfdc70cfa95689c497f52b003992f70f7/templates/grpc-server/ingress.yaml
--------------------------------------------------------------------------------
/templates/grpc-server/service.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.grpcServer.enabled -}}
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: {{.Release.Name}}-grpc-server
6 | labels:
7 | {{- include "django-helm.labels" . | nindent 4 }}
8 | spec:
9 | type: {{ .Values.grpcServer.service.type }}
10 | ports:
11 | - port: {{ .Values.grpcServer.service.port }}
12 | targetPort: grpc
13 | protocol: TCP
14 | name: grpc
15 | selector:
16 | {{- include "django-helm.labels" . | nindent 4 }}
17 | app.kubernetes.io/component: grpc-server
18 | {{- end -}}
--------------------------------------------------------------------------------
/templates/tests/test-connection.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Pod
3 | metadata:
4 | name: "{{ include "django-helm.fullname" . }}-test-connection"
5 | labels:
6 | {{- include "django-helm.labels" . | nindent 4 }}
7 | annotations:
8 | "helm.sh/hook": test-success
9 | spec:
10 | containers:
11 | - name: wget
12 | image: busybox
13 | command: ['wget']
14 | args: ['{{ include "django-helm.fullname" . }}:{{ .Values.djangoServer.service.port }}']
15 | restartPolicy: Never
16 |
--------------------------------------------------------------------------------
/values.yaml:
--------------------------------------------------------------------------------
1 | image:
2 | # image config
3 | repository: itswcg/django-helm-application
4 | tag: latest
5 | pullPolicy: Always
6 | imagePullSecrets: []
7 |
8 | configmap:
9 | # django environment
10 | data:
11 | DJANGO_SETTINGS_MODULE: config.settings.production
12 | # DATABASE_URL:
13 | # REDIS_URL:
14 | # CELERY_BROKER_URL:
15 |
16 | pvc:
17 | created: false
18 | storageClassName:
19 |
20 | serviceAccount:
21 | # Specifies whether a service account should be created
22 | created: false
23 | # Annotations to add to the service account
24 | annotations: {}
25 | # The name of the service account to use.
26 | # If not set and create is true, a name is generated using the fullname template
27 | name:
28 |
29 | djangoServer:
30 | replicaCount: 1
31 |
32 | command: ["gunicorn", "--workers", "1", "--bind", ":8000",
33 | "--log-level", "INFO", "config.wsgi"]
34 |
35 | podSecurityContext: {}
36 | # fsGroup: 2000
37 |
38 | securityContext: {}
39 | # capabilities:
40 | # drop:
41 | # - ALL
42 | # readOnlyRootFilesystem: true
43 | # runAsNonRoot: true
44 | # runAsUser: 1000
45 |
46 | service:
47 | type: ClusterIP
48 | port: 8000
49 |
50 | hpa:
51 | enabled: false
52 |
53 | ingress:
54 | enabled: false
55 | annotations: {}
56 | # kubernetes.io/ingress.class: nginx
57 | # kubernetes.io/tls-acme: "true"
58 | hosts:
59 | - host: chart-example.local
60 | paths: []
61 | tls: []
62 | # - secretName: chart-example-tls
63 | # hosts:
64 | # - chart-example.local
65 |
66 | probe:
67 | readiness:
68 | path: /
69 | liveness:
70 | path: /
71 |
72 | resources: {}
73 | # We usually recommend not to specify default resources and to leave this as a conscious
74 | # choice for the user. This also increases chances charts run on environments with little
75 | # resources, such as Minikube. If you do want to specify resources, uncomment the following
76 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
77 | # limits:
78 | # cpu: 100m
79 | # memory: 128Mi
80 | # requests:
81 | # cpu: 100m
82 | # memory: 128Mi
83 |
84 | nodeSelector: {}
85 |
86 | tolerations: []
87 |
88 | affinity: {}
89 |
90 | celeryBeat:
91 | enabled: false
92 |
93 | command: ["celery", "beat", "-A", "config.celery_app", "-l", "info"]
94 |
95 | podSecurityContext: {}
96 |
97 | securityContext: {}
98 |
99 | resources: {}
100 |
101 | nodeSelector: {}
102 |
103 | tolerations: []
104 |
105 | affinity: {}
106 |
107 | celeryWorker:
108 | enabled: false
109 |
110 | queue:
111 | # This is a list that supports multiple queues
112 | - name: celery
113 | replicaCount: 1
114 | command: ["celery", "worker", "-A", "config.celery_app", "-l", "info", "-Q", "celery"]
115 | podSecurityContext: {}
116 | securityContext: {}
117 | resources: {}
118 | nodeSelector: {}
119 | tolerations: []
120 | affinity: {}
121 |
122 | celerFlower:
123 | enabled: false
124 |
125 | command: ["celery", "flower", "-A", "config.celery_app", "--address=0.0.0.0", "--port=5555"]
126 |
127 | service:
128 | type: ClusterIP
129 | port: 5555
130 |
131 | ingress:
132 | enabled: false
133 | annotations: {}
134 | hosts:
135 | - host: chart-example.local
136 | paths: []
137 | tls: []
138 |
139 | podSecurityContext: {}
140 |
141 | securityContext: {}
142 |
143 | resources: {}
144 |
145 | nodeSelector: {}
146 |
147 | tolerations: []
148 |
149 | affinity: {}
150 |
151 | grpcServer:
152 | enabled: false
153 | replicaCount: 1
154 |
155 | command: ["python", "manage.py", "grpcrunserver", "8001"]
156 |
157 | podSecurityContext: {}
158 |
159 | securityContext: {}
160 |
161 | service:
162 | type: ClusterIP
163 | port: 8001
164 |
165 | hpa:
166 | enabled: false
167 |
168 | ingress:
169 | enabled: false
170 | annotations: {}
171 | hosts:
172 | - host: chart-example.local
173 | paths: []
174 | tls: []
175 |
176 | resources: {}
177 |
178 | nodeSelector: {}
179 |
180 | tolerations: []
181 |
182 | affinity: {}
183 |
184 | collectstaticJob:
185 | enabled: false
186 |
187 | migrateJob:
188 | enabled: false
189 |
--------------------------------------------------------------------------------