From 3817b7bc2b4290dd58fb98840678d5679fc757c4 Mon Sep 17 00:00:00 2001 From: Valentin Fedoskin Date: Sun, 16 Aug 2020 13:19:19 +0200 Subject: [PATCH] add annotations to pod and deployment --- charts/nginx/Chart.yaml | 2 +- charts/nginx/README.md | 18 ++++++++++++------ charts/nginx/templates/deployment.yaml | 3 +++ charts/nginx/values.yaml | 5 +++++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/charts/nginx/Chart.yaml b/charts/nginx/Chart.yaml index 3174dea..35e1e1b 100644 --- a/charts/nginx/Chart.yaml +++ b/charts/nginx/Chart.yaml @@ -5,7 +5,7 @@ description: |- Chart supports environment variables inside of the nginx.conf file. type: application -version: 0.0.8 +version: 0.0.9 appVersion: 1.17.9 home: https://github.com/slamdev/helm-charts/tree/master/charts/nginx icon: https://www.nginx.com/wp-content/uploads/2019/10/favicon-48x48.ico diff --git a/charts/nginx/README.md b/charts/nginx/README.md index 04067af..17147b8 100644 --- a/charts/nginx/README.md +++ b/charts/nginx/README.md @@ -1,20 +1,25 @@ -nginx -===== +# nginx + +![Version: 0.0.9](https://img.shields.io/badge/Version-0.0.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.17.9](https://img.shields.io/badge/AppVersion-1.17.9-informational?style=flat-square) + Helm chart to deploy [nginx](https://www.nginx.com). Chart supports environment variables inside of the nginx.conf file. -Current chart version is `0.0.8` - -Source code can be found [here](https://github.com/slamdev/helm-charts/tree/master/charts/nginx) +**Homepage:** +## Maintainers +| Name | Email | Url | +| ---- | ------ | --- | +| slamdev | valentin.fedoskin@gmail.com | | -## Chart Values +## Values | Key | Type | Default | Description | |-----|------|---------|-------------| | affinity | object | `{}` | affinity for scheduler pod assignment | +| deploymentAnnotations | object | `{}` | annotations to add to the deployment | | dnsmasq.enabled | bool | `false` | enable simple dns server for nginx | | env | list | `[]` | additional environment variables for the deployment | | fullnameOverride | string | `""` | full name of the chart. | @@ -31,6 +36,7 @@ Source code can be found [here](https://github.com/slamdev/helm-charts/tree/mast | nameOverride | string | `""` | override name of the chart | | nginxConf | string | `"# nginx version: ENV_NGINX_VERSION_ENV\nuser nginx;\nworker_processes auto;\nerror_log /var/log/nginx/error.log warn;\npid /var/run/nginx.pid;\nevents {\n worker_connections 1024;\n}\nhttp {\n include /etc/nginx/mime.types;\n default_type application/octet-stream;\n log_format main '$remote_addr - $remote_user [$time_local] \"$request\" '\n '$status $body_bytes_sent \"$http_referer\" '\n '\"$http_user_agent\" \"$http_x_forwarded_for\" '\n '$request_time $upstream_response_time $pipe';\n access_log /var/log/nginx/access.log main;\n sendfile on;\n keepalive_timeout 65;\n server {\n listen 80;\n server_name localhost;\n location / {\n default_type text/plain;\n access_log off;\n error_log off;\n return 200 'ok';\n }\n }\n}"` | nginx config to provision inside of the container | | nodeSelector | object | `{}` | node for scheduler pod assignment | +| podAnnotations | object | `{}` | annotations to add to the pod | | podSecurityContext | object | `{}` | specifies security settings for a pod | | readinessProbe.httpGet.path | string | `"/"` | path for readiness probe | | readinessProbe.httpGet.port | string | `"http"` | port for readiness probe | diff --git a/charts/nginx/templates/deployment.yaml b/charts/nginx/templates/deployment.yaml index d39fbf0..2b40e13 100644 --- a/charts/nginx/templates/deployment.yaml +++ b/charts/nginx/templates/deployment.yaml @@ -3,6 +3,8 @@ kind: Deployment metadata: name: {{ include "nginx.fullname" . }} namespace: {{ .Release.Namespace }} + annotations: + {{- toYaml .Values.deploymentAnnotations | nindent 4 }} labels: {{- include "nginx.labels" . | nindent 4 }} spec: @@ -16,6 +18,7 @@ spec: {{- include "nginx.selectorLabels" . | nindent 8 }} annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + {{- toYaml .Values.podAnnotations | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/charts/nginx/values.yaml b/charts/nginx/values.yaml index 8ba0b1e..7a17f58 100644 --- a/charts/nginx/values.yaml +++ b/charts/nginx/values.yaml @@ -37,6 +37,11 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 +# deploymentAnnotations -- annotations to add to the deployment +deploymentAnnotations: {} +# podAnnotations -- annotations to add to the pod +podAnnotations: {} + service: # service.type -- service type type: ClusterIP