From 4f2dbc6673b91a1a41e8568dc6315f118a802a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wecker=20St=C3=A9phane?= Date: Mon, 29 Jan 2024 11:59:00 +0100 Subject: [PATCH] Use tpl instead toYaml (#2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stéphane Wecker --- README.md | 174 +++++++++--------- .../spin/templates/deployment.yaml | 2 +- bouyguestelecom/spin/values.schema.json | 14 +- bouyguestelecom/spin/values.yaml | 2 +- 4 files changed, 96 insertions(+), 96 deletions(-) diff --git a/README.md b/README.md index 9f48694..e4c553d 100644 --- a/README.md +++ b/README.md @@ -67,94 +67,94 @@ spin: ``` ## 📚 API Values -| Key | Type | Default | Description | -|-----------------------------------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| autoscaling.enabled | bool | `true` | Enable or disable Horizontal Pod Autoscaler (Autoscalling)
[More about HPA ](https://kubernetes.io/fr/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/) | -| autoscaling.maxReplicas | int | `10` | Maximum number of pod replicas | -| autoscaling.minReplicas | int | `2` | Minimum number of pod replicas | -| autoscaling.targetCPUUtilizationPercentage | int | `100` | Target CPU Utilization Percentage | -| autoscaling.targetMemoryUtilizationPercentage | int | `100` | Target Memory Utilization Percentage | -| canary.cookie.enabled | bool | `false` | Enable or disable cookie-based routing
[More about canary release](https://dev.to/pavanbelagatti/kubernetes-deployments-rolling-vs-canary-vs-blue-green-4k9p#:~:text=Kubernetes%20canary%20deployment%20is%20a,the%20original%20replica%20set%20running.) | -| canary.cookie.name | string | `"x-hidden-prod"` | Name of the cookie to match | -| canary.enabled | bool | `false` | Enable or disable Canary releases | -| canary.header.enabled | bool | `false` | Enable or disable header-based routing | -| canary.header.name | string | `"cookie"` | Name of the HTTP header to match | -| canary.header.regex | string | `" "` | Regular expression to match the header value | -| canary.percent | object | `{"enabled":false,"value":20}` | Percentage-based routing settings | -| canary.percent.enabled | bool | `false` | Enable or disable percentage-based routing | -| canary.percent.value | int | `20` | Percentage of traffic to route to the Canary release | -| configFiles | object | `{}` | Set configurations files in configmaps.
[More about configMap](https://kubernetes.io/docs/concepts/configuration/configmap/) | -| deployment.affinity | object | `{}` | Pod affinity configurartion : Hard node and soft zone anti-affinity | -| deployment.args | list | `[]` | Additional arguments to pass to the command | -| deployment.containerAdminPort | string | `""` | If defined, forces the container to use an admin port other than the one defined in service.httpAdminPort. | -| deployment.containerEnv | object | `{}` | Additional ENV | -| deployment.containerExtraPorts | string | `""` | Add extra ports to container | -| deployment.containerExtraSpecs | string | `""` | Add extra specifications to container | -| deployment.containerPort | string | `""` | If defined, forces the container to use a port other than the one defined in service.httpPort.
[More about deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) | -| deployment.extraInitContainers | list | `[]` | Add initContainers | -| deployment.extraVolumeMounts | list | `[]` | Add additionnal volumeMounts | -| deployment.extraVolumes | list | `[]` | Add additionnal volumes | -| deployment.image.pullPolicy | string | `"IfNotPresent"` | docker image pull policy | -| deployment.image.repository | string | `"nginx"` | docker image repository url | -| deployment.image.tag | string | `"10"` | docker image tag | +| Key | Type | Default | Description | +|-----------------------------------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| autoscaling.enabled | bool | `true` | Enable or disable Horizontal Pod Autoscaler (Autoscalling)
[More about HPA ](https://kubernetes.io/fr/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/) | +| autoscaling.maxReplicas | int | `10` | Maximum number of pod replicas | +| autoscaling.minReplicas | int | `2` | Minimum number of pod replicas | +| autoscaling.targetCPUUtilizationPercentage | int | `100` | Target CPU Utilization Percentage | +| autoscaling.targetMemoryUtilizationPercentage | int | `100` | Target Memory Utilization Percentage | +| canary.cookie.enabled | bool | `false` | Enable or disable cookie-based routing
[More about canary release](https://dev.to/pavanbelagatti/kubernetes-deployments-rolling-vs-canary-vs-blue-green-4k9p#:~:text=Kubernetes%20canary%20deployment%20is%20a,the%20original%20replica%20set%20running.) | +| canary.cookie.name | string | `"x-hidden-prod"` | Name of the cookie to match | +| canary.enabled | bool | `false` | Enable or disable Canary releases | +| canary.header.enabled | bool | `false` | Enable or disable header-based routing | +| canary.header.name | string | `"cookie"` | Name of the HTTP header to match | +| canary.header.regex | string | `" "` | Regular expression to match the header value | +| canary.percent | object | `{"enabled":false,"value":20}` | Percentage-based routing settings | +| canary.percent.enabled | bool | `false` | Enable or disable percentage-based routing | +| canary.percent.value | int | `20` | Percentage of traffic to route to the Canary release | +| configFiles | object | `{}` | Set configurations files in configmaps.
[More about configMap](https://kubernetes.io/docs/concepts/configuration/configmap/) | +| deployment.affinity | object | `{}` | Pod affinity configurartion : Hard node and soft zone anti-affinity | +| deployment.args | list | `[]` | Additional arguments to pass to the command | +| deployment.containerAdminPort | string | `""` | If defined, forces the container to use an admin port other than the one defined in service.httpAdminPort. | +| deployment.containerEnv | object | `{}` | Additional ENV | +| deployment.containerExtraPorts | string | `""` | Add extra ports to container | +| deployment.containerExtraSpecs | string | `""` | Add extra specifications to container | +| deployment.containerPort | string | `""` | If defined, forces the container to use a port other than the one defined in service.httpPort.
[More about deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) | +| deployment.extraInitContainers | list | `[]` | Add initContainers | +| deployment.extraVolumeMounts | list | `[]` | Add additionnal volumeMounts | +| deployment.extraVolumes | list | `[]` | Add additionnal volumes | +| deployment.image.pullPolicy | string | `"IfNotPresent"` | docker image pull policy | +| deployment.image.repository | string | `"nginx"` | docker image repository url | +| deployment.image.tag | string | `"10"` | docker image tag | | deployment.livenessProbe | object |
`{"failureThreshold":5,"httpGet":`
`{"path":"/","port":80,"scheme":"HTTP"},`
`"initialDelaySeconds":50,"periodSeconds":10,`
`"successThreshold":1,"timeoutSeconds":1}`
| Liveness probe configuration
[More about liveness probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) | -| deployment.livenessProbe.failureThreshold | int | `5` | Number of consecutive unsuccessful checks to be considered not alive | -| deployment.livenessProbe.httpGet.path | string | `"/"` | The path to be used for the HTTP GET request | -| deployment.livenessProbe.httpGet.port | int | `80` | The port on which to perform the GET request | -| deployment.livenessProbe.httpGet.scheme | string | `"HTTP"` | The scheme for the GET request (e.g., HTTP or HTTPS) | -| deployment.livenessProbe.initialDelaySeconds | int | `50` | Initial delay before starting the check (in seconds) | -| deployment.livenessProbe.periodSeconds | int | `10` | Check frequency (in seconds) | -| deployment.livenessProbe.successThreshold | int | `1` | Number of consecutive successful checks to be considered alive | -| deployment.livenessProbe.timeoutSeconds | int | `1` | Maximum wait time for a response (in seconds) | -| deployment.nodeSelector | object | `{}` | An empty object means no node selector is applied, and the pod can be scheduled on any node | -| deployment.podAnnotations | object | `{}` | Additional annotations for the Pod | -| deployment.podSecurityContext | object |
`{"enabled":false,"fsGroup":1001}`
| Pod-level security context configuration | -| deployment.podSecurityContext.enabled | bool | `false`
[More about security context](https://kubernetes.io/docs/concepts/security/pod-security-standards/) | Enable or disable the pod security context | -| deployment.podSecurityContext.fsGroup | int | `1001` | Set the File System Group (fsGroup) for the pod volumes | -| deployment.readinessProbe | object |
`{"failureThreshold":10,"httpGet":`
`{"path":"/","port":80,"scheme":"HTTP"},`
`"initialDelaySeconds":5,"periodSeconds":5,`
`"successThreshold":1,"timeoutSeconds":5}`
| Readiness probe configuration
[More about readiness probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) | -| deployment.readinessProbe.failureThreshold | int | `10` | Number of consecutive unsuccessful checks to be considered not ready | -| deployment.readinessProbe.httpGet.path | string | `"/"` | The path to be used for the HTTP GET request | -| deployment.readinessProbe.httpGet.port | int | `80` | The port on which to perform the GET request | -| deployment.readinessProbe.httpGet.scheme | string | `"HTTP"` | The scheme for the GET request (e.g., HTTP or HTTPS) | -| deployment.readinessProbe.initialDelaySeconds | int | `5` | Initial delay before starting the check (in seconds) | -| deployment.readinessProbe.periodSeconds | int | `5` | Check frequency (in seconds) | -| deployment.readinessProbe.successThreshold | int | `1` | Number of consecutive successful checks to be considered ready | -| deployment.readinessProbe.timeoutSeconds | int | `5` | Maximum wait time for a response (in seconds) | -| deployment.replicaCount | int | `2` | ReplicaCount for the Pod | -| deployment.resources | object | `{limits : {cpu: 100m , memory: 128mi} , requests: {cpu: 100m , memory: 128mi } }` | Resource Management for Pods and Containers
[More about resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | -| deployment.restartPolicy | string | `"Always"` | Pod restart policy. One of `Always`, `OnFailure`, or `Never` | -| deployment.securityContext | object | `{"enabled":false}` | Security context of the containers | -| deployment.startupProbe | string | `""` | Empty means no startup probe is configured | -| deployment.tolerations | list | `[]` | Empty list means no tolerations are applied | -| deployment.volumeMounts | list | `[]` | VolumeMounts | -| flux | object |
`{"configmap":{"enabled":false,`
`"filename":"flux.json"`
`,"filepath":"/usr/src/app/"},`
`"enabled":false,"internal":{}}`
| List of allowed entities for ENP
[More about egress-network-policies](https://cloud.redhat.com/blog/guide-to-kubernetes-egress-network-policies) | -| flux.configmap.enabled | bool | `false` | Indicates if the ConfigMap is enabled (false by default) | -| flux.configmap.filename | string | `"flux.json"` | The name of the Flux configuration file (default: flux.json) | -| flux.configmap.filepath | string | `"/usr/src/app/"` | The file path for Flux configuration (default: /usr/src/app/) | -| flux.enabled | bool | `false` | Indicates if Flux is enabled (false by default) | -| flux.internal | object | `{}` | Internal settings for Flux (empty by default) | -| fullnameOverride | string | `""` | | -| github | object |
`{"enabled":false,"organization":`
`"votre-organisation",`
`"repository":"votre-repo"}`
| Log into github to generate tag image | -| ingress.annotations | object | `{}` | Additional annotations for the Ingress | -| ingress.enabled | bool | `true` | Enable or disable the creation of an Ingress resource for the deployment
[More about ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) | -| ingress.labels | object | `{}` | Additional labels for the Ingress | -| ingress.rules | list |
`[{"host":"chart-example.local","paths":`
`[{"path":"/","pathType": `
`"ImplementationSpecific"}]}]`
| List of rules for the Ingress | -| nameOverride | string | `""` | | -| podDisruptionBudget | object | `{}` | Empty means no PDB is applied
[More about disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) | -| secrets | object | `{"data":{},"type":""}` | Configuration settings for Kubernetes secrets
[More about secrets](https://kubernetes.io/docs/concepts/configuration/secret/) | -| secrets.data | object | `{}` | Key-value pairs stored as base64-encoded strings | -| service.enabled | bool | `true` | Enable or disable the creation of a Kubernetes service for the deployment
[More about service](https://kubernetes.io/docs/concepts/services-networking/service/) | -| service.extraPorts | list | `[]` | Additional Service ports, e. g. for custom admin console | -| service.httpAdminNodePort | string | `""` | The Management node port if type is NodePort (The range of valid ports is 30000-32767) | -| service.httpAdminPort | int | `8081` | The Management port | -| service.httpAdminPortName | string | `"http-admin"` | The Management port name | -| service.httpNodePort | string | `""` | The HTTP Service node port if type is NodePort (The range of valid ports is 30000-32767) | -| service.httpPort | int | `8080` | The http Service port | -| service.type | string | `"ClusterIP"` | The Service type | -| serviceAccount.create | bool | `true` | Specifies whether a service account should be created
[More about service account](https://kubernetes.io/docs/concepts/security/service-accounts/) | -| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | -| serviceAccount.imagePullSecrets | list | `[]` | Image pull secrets that are attached to the ServiceAccount | -| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| deployment.livenessProbe.failureThreshold | int | `5` | Number of consecutive unsuccessful checks to be considered not alive | +| deployment.livenessProbe.httpGet.path | string | `"/"` | The path to be used for the HTTP GET request | +| deployment.livenessProbe.httpGet.port | int | `80` | The port on which to perform the GET request | +| deployment.livenessProbe.httpGet.scheme | string | `"HTTP"` | The scheme for the GET request (e.g., HTTP or HTTPS) | +| deployment.livenessProbe.initialDelaySeconds | int | `50` | Initial delay before starting the check (in seconds) | +| deployment.livenessProbe.periodSeconds | int | `10` | Check frequency (in seconds) | +| deployment.livenessProbe.successThreshold | int | `1` | Number of consecutive successful checks to be considered alive | +| deployment.livenessProbe.timeoutSeconds | int | `1` | Maximum wait time for a response (in seconds) | +| deployment.nodeSelector | object | `{}` | An empty object means no node selector is applied, and the pod can be scheduled on any node | +| deployment.podAnnotations | string | `""` | Additional annotations for the Pod | +| deployment.podSecurityContext | object |
`{"enabled":false,"fsGroup":1001}`
| Pod-level security context configuration | +| deployment.podSecurityContext.enabled | bool | `false`
[More about security context](https://kubernetes.io/docs/concepts/security/pod-security-standards/) | Enable or disable the pod security context | +| deployment.podSecurityContext.fsGroup | int | `1001` | Set the File System Group (fsGroup) for the pod volumes | +| deployment.readinessProbe | object |
`{"failureThreshold":10,"httpGet":`
`{"path":"/","port":80,"scheme":"HTTP"},`
`"initialDelaySeconds":5,"periodSeconds":5,`
`"successThreshold":1,"timeoutSeconds":5}`
| Readiness probe configuration
[More about readiness probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) | +| deployment.readinessProbe.failureThreshold | int | `10` | Number of consecutive unsuccessful checks to be considered not ready | +| deployment.readinessProbe.httpGet.path | string | `"/"` | The path to be used for the HTTP GET request | +| deployment.readinessProbe.httpGet.port | int | `80` | The port on which to perform the GET request | +| deployment.readinessProbe.httpGet.scheme | string | `"HTTP"` | The scheme for the GET request (e.g., HTTP or HTTPS) | +| deployment.readinessProbe.initialDelaySeconds | int | `5` | Initial delay before starting the check (in seconds) | +| deployment.readinessProbe.periodSeconds | int | `5` | Check frequency (in seconds) | +| deployment.readinessProbe.successThreshold | int | `1` | Number of consecutive successful checks to be considered ready | +| deployment.readinessProbe.timeoutSeconds | int | `5` | Maximum wait time for a response (in seconds) | +| deployment.replicaCount | int | `2` | ReplicaCount for the Pod | +| deployment.resources | object | `{limits : {cpu: 100m , memory: 128mi} , requests: {cpu: 100m , memory: 128mi } }` | Resource Management for Pods and Containers
[More about resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | +| deployment.restartPolicy | string | `"Always"` | Pod restart policy. One of `Always`, `OnFailure`, or `Never` | +| deployment.securityContext | object | `{"enabled":false}` | Security context of the containers | +| deployment.startupProbe | string | `""` | Empty means no startup probe is configured | +| deployment.tolerations | list | `[]` | Empty list means no tolerations are applied | +| deployment.volumeMounts | list | `[]` | VolumeMounts | +| flux | object |
`{"configmap":{"enabled":false,`
`"filename":"flux.json"`
`,"filepath":"/usr/src/app/"},`
`"enabled":false,"internal":{}}`
| List of allowed entities for ENP
[More about egress-network-policies](https://cloud.redhat.com/blog/guide-to-kubernetes-egress-network-policies) | +| flux.configmap.enabled | bool | `false` | Indicates if the ConfigMap is enabled (false by default) | +| flux.configmap.filename | string | `"flux.json"` | The name of the Flux configuration file (default: flux.json) | +| flux.configmap.filepath | string | `"/usr/src/app/"` | The file path for Flux configuration (default: /usr/src/app/) | +| flux.enabled | bool | `false` | Indicates if Flux is enabled (false by default) | +| flux.internal | object | `{}` | Internal settings for Flux (empty by default) | +| fullnameOverride | string | `""` | | +| github | object |
`{"enabled":false,"organization":`
`"votre-organisation",`
`"repository":"votre-repo"}`
| Log into github to generate tag image | +| ingress.annotations | object | `{}` | Additional annotations for the Ingress | +| ingress.enabled | bool | `true` | Enable or disable the creation of an Ingress resource for the deployment
[More about ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) | +| ingress.labels | object | `{}` | Additional labels for the Ingress | +| ingress.rules | list |
`[{"host":"chart-example.local","paths":`
`[{"path":"/","pathType": `
`"ImplementationSpecific"}]}]`
| List of rules for the Ingress | +| nameOverride | string | `""` | | +| podDisruptionBudget | object | `{}` | Empty means no PDB is applied
[More about disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) | +| secrets | object | `{"data":{},"type":""}` | Configuration settings for Kubernetes secrets
[More about secrets](https://kubernetes.io/docs/concepts/configuration/secret/) | +| secrets.data | object | `{}` | Key-value pairs stored as base64-encoded strings | +| service.enabled | bool | `true` | Enable or disable the creation of a Kubernetes service for the deployment
[More about service](https://kubernetes.io/docs/concepts/services-networking/service/) | +| service.extraPorts | list | `[]` | Additional Service ports, e. g. for custom admin console | +| service.httpAdminNodePort | string | `""` | The Management node port if type is NodePort (The range of valid ports is 30000-32767) | +| service.httpAdminPort | int | `8081` | The Management port | +| service.httpAdminPortName | string | `"http-admin"` | The Management port name | +| service.httpNodePort | string | `""` | The HTTP Service node port if type is NodePort (The range of valid ports is 30000-32767) | +| service.httpPort | int | `8080` | The http Service port | +| service.type | string | `"ClusterIP"` | The Service type | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created
[More about service account](https://kubernetes.io/docs/concepts/security/service-accounts/) | +| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | +| serviceAccount.imagePullSecrets | list | `[]` | Image pull secrets that are attached to the ServiceAccount | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) diff --git a/bouyguestelecom/spin/templates/deployment.yaml b/bouyguestelecom/spin/templates/deployment.yaml index 86aae3b..c2523a4 100644 --- a/bouyguestelecom/spin/templates/deployment.yaml +++ b/bouyguestelecom/spin/templates/deployment.yaml @@ -20,7 +20,7 @@ spec: metadata: {{- with .Values.deployment.podAnnotations }} annotations: - {{- toYaml . | nindent 8 }} + {{- tpl . $ | nindent 8 }} {{- end }} labels: {{- include "spin.selectorLabels" . | nindent 8 }} diff --git a/bouyguestelecom/spin/values.schema.json b/bouyguestelecom/spin/values.schema.json index cca741a..44fa26c 100644 --- a/bouyguestelecom/spin/values.schema.json +++ b/bouyguestelecom/spin/values.schema.json @@ -83,12 +83,12 @@ ] }, "podAnnotations": { - "type": "object", - "default": {}, + "type": "string", + "default": "", "title": "The podAnnotations Schema", - "required": [], - "properties": {}, - "examples": [{}] + "examples": [ + "" + ] }, "imagePullSecrets": { "type": "array", @@ -617,7 +617,7 @@ "containerPort": "", "containerAdminPort": "", "replicaCount": 2, - "podAnnotations": {}, + "podAnnotations": "", "imagePullSecrets": [], "image": { "repository": "nginx", @@ -1387,7 +1387,7 @@ "containerPort": "", "containerAdminPort": "", "replicaCount": 2, - "podAnnotations": {}, + "podAnnotations": "", "imagePullSecrets": [], "image": { "repository": "nginx", diff --git a/bouyguestelecom/spin/values.yaml b/bouyguestelecom/spin/values.yaml index f882c96..c176daa 100644 --- a/bouyguestelecom/spin/values.yaml +++ b/bouyguestelecom/spin/values.yaml @@ -16,7 +16,7 @@ deployment: # -- ReplicaCount for the Pod replicaCount: 2 # -- Additional annotations for the Pod - podAnnotations: {} + podAnnotations: "" imagePullSecrets: [] # -- Docker image configuration settings image: