Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / common / mongodb / common / README.md
1 # Bitnami Common Library Chart
2
3 A [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm) for grouping common logic between Bitnami charts.
4
5 ## TL;DR
6
7 ```yaml
8 dependencies:
9   - name: common
10     version: 2.x.x
11     repository: oci://registry-1.docker.io/bitnamicharts
12 ```
13
14 ```console
15 helm dependency update
16 ```
17
18 ```yaml
19 apiVersion: v1
20 kind: ConfigMap
21 metadata:
22   name: {{ include "common.names.fullname" . }}
23 data:
24   myvalue: "Hello World"
25 ```
26
27 Looking to use our applications in production? Try [VMware Tanzu Application Catalog](https://bitnami.com/enterprise), the enterprise edition of Bitnami Application Catalog.
28
29 ## Introduction
30
31 This chart provides a common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager.
32
33 Bitnami charts can be used with [Kubeapps](https://kubeapps.dev/) for deployment and management of Helm Charts in clusters.
34
35 ## Prerequisites
36
37 - Kubernetes 1.23+
38 - Helm 3.8.0+
39
40 ## Parameters
41
42 ## Special input schemas
43
44 ### ImageRoot
45
46 ```yaml
47 registry:
48   type: string
49   description: Docker registry where the image is located
50   example: docker.io
51
52 repository:
53   type: string
54   description: Repository and image name
55   example: bitnami/nginx
56
57 tag:
58   type: string
59   description: image tag
60   example: 1.16.1-debian-10-r63
61
62 pullPolicy:
63   type: string
64   description: Specify a imagePullPolicy. Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
65
66 pullSecrets:
67   type: array
68   items:
69     type: string
70   description: Optionally specify an array of imagePullSecrets (evaluated as templates).
71
72 debug:
73   type: boolean
74   description: Set to true if you would like to see extra information on logs
75   example: false
76
77 ## An instance would be:
78 # registry: docker.io
79 # repository: bitnami/nginx
80 # tag: 1.16.1-debian-10-r63
81 # pullPolicy: IfNotPresent
82 # debug: false
83 ```
84
85 ### Persistence
86
87 ```yaml
88 enabled:
89   type: boolean
90   description: Whether enable persistence.
91   example: true
92
93 storageClass:
94   type: string
95   description: Ghost data Persistent Volume Storage Class, If set to "-", storageClassName: "" which disables dynamic provisioning.
96   example: "-"
97
98 accessMode:
99   type: string
100   description: Access mode for the Persistent Volume Storage.
101   example: ReadWriteOnce
102
103 size:
104   type: string
105   description: Size the Persistent Volume Storage.
106   example: 8Gi
107
108 path:
109   type: string
110   description: Path to be persisted.
111   example: /bitnami
112
113 ## An instance would be:
114 # enabled: true
115 # storageClass: "-"
116 # accessMode: ReadWriteOnce
117 # size: 8Gi
118 # path: /bitnami
119 ```
120
121 ### ExistingSecret
122
123 ```yaml
124 name:
125   type: string
126   description: Name of the existing secret.
127   example: mySecret
128 keyMapping:
129   description: Mapping between the expected key name and the name of the key in the existing secret.
130   type: object
131
132 ## An instance would be:
133 # name: mySecret
134 # keyMapping:
135 #   password: myPasswordKey
136 ```
137
138 #### Example of use
139
140 When we store sensitive data for a deployment in a secret, some times we want to give to users the possibility of using theirs existing secrets.
141
142 ```yaml
143 # templates/secret.yaml
144 ---
145 apiVersion: v1
146 kind: Secret
147 metadata:
148   name: {{ include "common.names.fullname" . }}
149   labels:
150     app: {{ include "common.names.fullname" . }}
151 type: Opaque
152 data:
153   password: {{ .Values.password | b64enc | quote }}
154
155 # templates/dpl.yaml
156 ---
157 ...
158       env:
159         - name: PASSWORD
160           valueFrom:
161             secretKeyRef:
162               name: {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }}
163               key: {{ include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "password") }}
164 ...
165
166 # values.yaml
167 ---
168 name: mySecret
169 keyMapping:
170   password: myPasswordKey
171 ```
172
173 ### ValidateValue
174
175 #### NOTES.txt
176
177 ```console
178 {{- $validateValueConf00 := (dict "valueKey" "path.to.value00" "secret" "secretName" "field" "password-00") -}}
179 {{- $validateValueConf01 := (dict "valueKey" "path.to.value01" "secret" "secretName" "field" "password-01") -}}
180
181 {{ include "common.validations.values.multiple.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }}
182 ```
183
184 If we force those values to be empty we will see some alerts
185
186 ```console
187 helm install test mychart --set path.to.value00="",path.to.value01=""
188     'path.to.value00' must not be empty, please add '--set path.to.value00=$PASSWORD_00' to the command. To get the current value:
189
190         export PASSWORD_00=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-00}" | base64 -d)
191
192     'path.to.value01' must not be empty, please add '--set path.to.value01=$PASSWORD_01' to the command. To get the current value:
193
194         export PASSWORD_01=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-01}" | base64 -d)
195 ```
196
197 ## Upgrading
198
199 ### To 1.0.0
200
201 [On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
202
203 #### What changes were introduced in this major version?
204
205 - Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field.
206 - Use `type: library`. [Here](https://v3.helm.sh/docs/faq/#library-chart-support) you can find more information.
207 - The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts
208
209 #### Considerations when upgrading to this version
210
211 - If you want to upgrade to this version from a previous one installed with Helm v3, you shouldn't face any issues
212 - If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore
213 - If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3
214
215 #### Useful links
216
217 - <https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/>
218 - <https://helm.sh/docs/topics/v2_v3_migration/>
219 - <https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/>
220
221 ## License
222
223 Copyright &copy; 2024 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
224
225 Licensed under the Apache License, Version 2.0 (the "License");
226 you may not use this file except in compliance with the License.
227 You may obtain a copy of the License at
228
229 <http://www.apache.org/licenses/LICENSE-2.0>
230
231 Unless required by applicable law or agreed to in writing, software
232 distributed under the License is distributed on an "AS IS" BASIS,
233 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
234 See the License for the specific language governing permissions and
235 limitations under the License.