Skip to content

Commit 8ecaf1e

Browse files
authored
Merge pull request #35 from jmenan/feat/chart/update-pod-identity-webhook
2 parents 8dee072 + 42acf37 commit 8ecaf1e

File tree

8 files changed

+93
-51
lines changed

8 files changed

+93
-51
lines changed

charts/amazon-eks-pod-identity-webhook/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: amazon-eks-pod-identity-webhook
33
description: A Kubernetes webhook for pods that need AWS IAM access
4-
version: 1.0.3
4+
version: 1.1.0
55
type: application
66
# renovate: image=amazon/amazon-eks-pod-identity-webhook
77
appVersion: "v0.3.0"

charts/amazon-eks-pod-identity-webhook/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,14 @@ Create the name of the service account to use
7171
{{- default "default" .Values.serviceAccount.name }}
7272
{{- end }}
7373
{{- end }}
74+
75+
{{/*
76+
Get PodDisruptionBudget API Version
77+
*/}}
78+
{{- define "amazon-eks-pod-identity-webhook.pdb.apiVersion" -}}
79+
{{- if and (.Capabilities.APIVersions.Has "policy/v1") (semverCompare ">= 1.21-0" .Capabilities.KubeVersion.Version) -}}
80+
{{- print "policy/v1" -}}
81+
{{- else -}}
82+
{{- print "policy/v1beta1" -}}
83+
{{- end -}}
84+
{{- end -}}

charts/amazon-eks-pod-identity-webhook/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ spec:
3131
imagePullSecrets:
3232
{{- toYaml . | nindent 8 }}
3333
{{- end }}
34+
{{- if .Values.priorityClassName }}
35+
priorityClassName: "{{ .Values.priorityClassName }}"
36+
{{- end }}
3437
containers:
3538
- name: {{ .Chart.Name }}
3639
securityContext:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- if and .Values.podDisruptionBudget.enabled (gt (.Values.replicaCount | int) 1) -}}
2+
apiVersion: {{ include "amazon-eks-pod-identity-webhook.pdb.apiVersion" . }}
3+
kind: PodDisruptionBudget
4+
metadata:
5+
name: {{ include "amazon-eks-pod-identity-webhook.fullname" . }}
6+
labels:
7+
{{- include "amazon-eks-pod-identity-webhook.labels" . | nindent 4 }}
8+
spec:
9+
{{- if .Values.podDisruptionBudget.minAvailable }}
10+
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
11+
{{- end }}
12+
{{- if .Values.podDisruptionBudget.maxUnavailable }}
13+
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
14+
{{- end }}
15+
selector:
16+
matchLabels:
17+
{{- include "amazon-eks-pod-identity-webhook.selectorLabels" . | nindent 6 }}
18+
{{- end -}}

charts/amazon-eks-pod-identity-webhook/templates/podmonitor.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

charts/amazon-eks-pod-identity-webhook/templates/service.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ spec:
1616
targetPort: https
1717
protocol: TCP
1818
name: https
19+
- port: {{ .Values.config.ports.metrics }}
20+
targetPort: metrics
21+
protocol: TCP
22+
name: metrics
1923
selector:
2024
{{- include "amazon-eks-pod-identity-webhook.selectorLabels" . | nindent 4 }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{{- if .Values.metrics.serviceMonitor.enabled -}}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
name: {{ .Release.Name }}
6+
labels:
7+
{{- include "amazon-eks-pod-identity-webhook.labels" . | nindent 4 }}
8+
{{- with .Values.metrics.serviceMonitor.additionalLabels }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
spec:
12+
jobLabel: {{ .Release.Name }}
13+
namespaceSelector:
14+
matchNames:
15+
- {{ include "amazon-eks-pod-identity-webhook.namespace" . }}
16+
selector:
17+
matchLabels:
18+
{{- include "amazon-eks-pod-identity-webhook.selectorLabels" . | nindent 6 }}
19+
endpoints:
20+
- port: metrics
21+
path: /metrics
22+
scheme: http
23+
{{- if .Values.metrics.serviceMonitor.interval }}
24+
interval: {{ .Values.metrics.serviceMonitor.interval }}
25+
{{- end }}
26+
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
27+
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
28+
{{- end }}
29+
{{- if .Values.metrics.serviceMonitor.honorLabels }}
30+
honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
31+
{{- end }}
32+
{{- if .Values.metrics.serviceMonitor.relabelings }}
33+
relabelings: {{- toYaml .Values.metrics.serviceMonitor.relabelings | nindent 6 }}
34+
{{- end }}
35+
{{- end -}}

charts/amazon-eks-pod-identity-webhook/values.yaml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
---
22
# -- String to partially override amazon-eks-pod-identity-webhook.fullname template (will maintain the release name)
3-
nameOverride: ''
3+
nameOverride: ""
44

55
# -- String to partially override amazon-eks-pod-identity-webhook.fullname template (will maintain the release name)
6-
namespaceOverride: ''
6+
namespaceOverride: ""
77

88
# -- String to fully override amazon-eks-pod-identity.fullname template
9-
fullnameOverride: ''
9+
fullnameOverride: ""
1010

1111
# -- Number of amazon-eks-pod-identity-webhook replicas to deploy
1212
replicaCount: 1
1313

14+
# -- https://kubernetes.io/docs/tasks/run-application/configure-pdb/
15+
podDisruptionBudget:
16+
enabled: false
17+
minAvailable:
18+
maxUnavailable:
19+
20+
# -- PriorityClass applied to deployment
21+
priorityClassName: ""
22+
1423
image:
1524
pullPolicy: IfNotPresent
1625
# -- amazon-eks-pod-identity-webhook image registry
@@ -19,7 +28,7 @@ image:
1928
repository: amazon/amazon-eks-pod-identity-webhook
2029
# -- amazon-eks-pod-identity-webhook image tag (immutable tags are recommended).
2130
# @default -- `.Chart.AppVersion`
22-
tag: ''
31+
tag: ""
2332

2433
# -- registry secret names as an array
2534
imagePullSecrets: []
@@ -90,19 +99,19 @@ pki:
9099
# -- Name of the existing cert-manager issuer.
91100
name: selfsigned
92101
# -- ca bundle of the manual generated server tls key
93-
caBundle: ''
102+
caBundle: ""
94103
# -- manual generated server tls cert. Used if pki.certManager.enabled is false
95-
cert: ''
104+
cert: ""
96105
# -- manual generated server tls key. Used if pki.certManager.enabled is false
97-
key: ''
106+
key: ""
98107
# -- name of the external secret (type kubernetes.io/tls). Used if pki.certManager.enabled is false
99-
existingSecret: ''
108+
existingSecret: ""
100109

101110
metrics:
102-
podMonitor:
103-
# -- Create PodMonitor Resource for scraping metrics using PrometheusOperator
111+
serviceMonitor:
112+
# -- Create serviceMonitor Resource for scraping metrics using PrometheusOperator
104113
enabled: false
105-
# -- Specify the namespace in which the podMonitor resource will be created
114+
# -- Specify the namespace in which the serviceMonitor resource will be created
106115
namespace: ""
107116
# -- Used to pass Labels that are required by the installed Prometheus Operator
108117
additionalLabels: {}
@@ -168,7 +177,7 @@ serviceAccount:
168177
create: true
169178
# -- The name of the ServiceAccount to use.
170179
# @default -- A name is generated using the `amazon-eks-pod-identity-webhook.fullname` template
171-
name: ''
180+
name: ""
172181
# -- Annotations for service account. Evaluated as a template.
173182
annotations: {}
174183

0 commit comments

Comments
 (0)