-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat.] Merge Webhook and Server Helm Chart (#817)
* Merge Webhook and Server Helm Chart Signed-off-by: Rahul M Chheda <rahul.chheda@accurics.com> * Dont create LoadBalancer service Signed-off-by: Rahul M Chheda <rahul.chheda@accurics.com> * Allow fail policy Signed-off-by: Rahul M Chheda <rahul.chheda@accurics.com> * Allow webhook failurePolicy to be Fail Signed-off-by: Rahul M Chheda <rahul.chheda@accurics.com> * minor changes and shifting helm charts to deploy/helm/ Signed-off-by: Devang <devang.gaur.7@gmail.com> * addition to the helm chart maintainer list Signed-off-by: Devang <devang.gaur.7@gmail.com> * parameterized deployment replicas Signed-off-by: Devang <devang.gaur.7@gmail.com> * Fix name in maintainers Signed-off-by: Rahul M Chheda <rahul.chheda@accurics.com> * Add comment in helm template for reference Signed-off-by: Rahul M Chheda <rahul.chheda@accurics.com> Co-authored-by: Devang <devang.gaur.7@gmail.com>
- Loading branch information
1 parent
a4d7af9
commit 1839b24
Showing
13 changed files
with
202 additions
and
137 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
59 changes: 0 additions & 59 deletions
59
deploy/helm-charts/webhook/templates/validating-webhook.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .Values.config_name }} | ||
namespace: {{ .Release.Namespace }} | ||
data: | ||
terrascan-config: | | ||
{{ .Files.Get "data/config.toml" | indent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Had to create this file just to support validatingwebhookconfiguration failurePolicy to be FAIL. | ||
# It turns out, webhook doesn't allow the terrascan server pod to come up in case failurePolicy is Fail. | ||
# So, as a workaround, we create the webhook w/ Ignore, and then upgrade it to Fail in. post install chart hook. ref: https://helm.sh/docs/topics/charts_hooks/ | ||
{{- if and .Values.webhook.mode (eq .Values.webhook.failurePolicy "Fail") }} | ||
apiVersion: admissionregistration.k8s.io/v1 | ||
kind: ValidatingWebhookConfiguration | ||
metadata: | ||
name: {{ .Values.name }} | ||
annotations: | ||
"helm.sh/hook": "post-install" | ||
webhooks: | ||
- name: {{ .Values.webhook.name }} | ||
admissionReviewVersions: | ||
{{- range .Values.webhook.admissionReviewVersions }} | ||
- {{ . | printf "%s" }} | ||
{{ end }} | ||
failurePolicy: Fail | ||
sideEffects: {{ .Values.webhook.sideEffects }} | ||
clientConfig: | ||
service: | ||
name: {{ .Values.name }} | ||
namespace: {{ .Release.Namespace }} | ||
path: {{ .Values.terrascan_webhook_key | printf "/v1/k8s/webhooks/%s/scan/validate" }} | ||
caBundle: {{ .Files.Get "data/server.crt" | b64enc }} | ||
rules: | ||
- apiGroups: | ||
{{- range .Values.webhook.apiGroups }} | ||
{{- if eq . ""}} | ||
- "" | ||
{{- else if eq . "*" }} | ||
- "*" | ||
{{- else }} | ||
- {{ . -}} | ||
{{- end }} | ||
{{- end }} | ||
resources: | ||
{{- range .Values.webhook.resources }} | ||
{{- if eq . ""}} | ||
- "" | ||
{{- else if eq . "*" }} | ||
- "*" | ||
{{- else }} | ||
- {{ . -}} | ||
{{- end }} | ||
{{- end }} | ||
apiVersions: | ||
{{- range .Values.webhook.apiVersions }} | ||
{{- if eq . ""}} | ||
- "" | ||
{{- else if eq . "*" }} | ||
- "*" | ||
{{- else }} | ||
- {{ . -}} | ||
{{- end }} | ||
{{- end }} | ||
operations: | ||
{{- range .Values.webhook.operations }} | ||
{{- if eq . ""}} | ||
- "" | ||
{{- else if eq . "*" }} | ||
- "*" | ||
{{- else }} | ||
- {{ . -}} | ||
{{- end }} | ||
{{- end }} | ||
{{- end -}} |
Oops, something went wrong.