This repository has been archived by the owner on Apr 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AWS validator for core resources
- Loading branch information
Showing
35 changed files
with
1,340 additions
and
15 deletions.
There are no files selected for viewing
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
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,21 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj |
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,5 @@ | ||
apiVersion: v1 | ||
appVersion: "1.0" | ||
description: A Helm chart for the Gardener AWS validator | ||
name: gardener-extensions-validator-aws | ||
version: 0.1.0 |
4 changes: 4 additions & 0 deletions
4
controllers/provider-aws/charts/validator-aws/charts/application/Chart.yaml
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,4 @@ | ||
apiVersion: v1 | ||
description: A Helm chart to deploy the gardener-extensions-validator-aws application related resources | ||
name: application | ||
version: 0.1.0 |
1 change: 1 addition & 0 deletions
1
controllers/provider-aws/charts/validator-aws/charts/application/templates/_helpers.tpl
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 @@ | ||
../../../templates/_helpers.tpl |
30 changes: 30 additions & 0 deletions
30
controllers/provider-aws/charts/validator-aws/charts/application/templates/rbac.yaml
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,30 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "name" . }} | ||
labels: | ||
{{ include "labels" . | indent 4 }} | ||
rules: | ||
- apiGroups: | ||
- core.gardener.cloud | ||
resources: | ||
- cloudprofiles | ||
verbs: | ||
- get | ||
- list | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "name" . }} | ||
labels: | ||
{{ include "labels" . | indent 4 }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ include "name" . }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "name" . }} | ||
namespace: {{ .Release.Namespace }} |
7 changes: 7 additions & 0 deletions
7
...ollers/provider-aws/charts/validator-aws/charts/application/templates/serviceaccount.yaml
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,7 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "name" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{ include "labels" . | indent 4 }} |
27 changes: 27 additions & 0 deletions
27
...er-aws/charts/validator-aws/charts/application/templates/validatingwebhook-validator.yaml
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,27 @@ | ||
apiVersion: admissionregistration.k8s.io/v1beta1 | ||
kind: ValidatingWebhookConfiguration | ||
metadata: | ||
name: {{ include "name" . }} | ||
webhooks: | ||
- name: validation.aws.provider.extensions.gardener.cloud | ||
rules: | ||
- apiGroups: | ||
- "core.gardener.cloud" | ||
apiVersions: | ||
- v1alpha1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- shoots | ||
failurePolicy: Fail | ||
clientConfig: | ||
{{- if .Values.global.virtualGarden.enabled }} | ||
url: {{ printf "https://gardener-extensions-validator-aws.%s/webhooks/validate-shoot-aws" .Release.Namespace }} | ||
{{- else }} | ||
service: | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ include "name" . }} | ||
path: /webhooks/validate-shoot-aws | ||
{{- end }} | ||
caBundle: {{ required ".Values.webhookConfig.caBundle is required" (b64enc .Values.global.webhookConfig.caBundle) }} |
8 changes: 8 additions & 0 deletions
8
controllers/provider-aws/charts/validator-aws/charts/application/values.yaml
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 @@ | ||
global: | ||
virtualGarden: | ||
enabled: false | ||
webhookConfig: | ||
caBundle: | | ||
-----BEGIN CERTIFICATE----- | ||
... | ||
-----END CERTIFICATE------- |
4 changes: 4 additions & 0 deletions
4
controllers/provider-aws/charts/validator-aws/charts/runtime/Chart.yaml
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,4 @@ | ||
apiVersion: v1 | ||
description: A Helm chart to deploy the gardener-extensions-validator-aws runtime related resources | ||
name: runtime | ||
version: 0.1.0 |
1 change: 1 addition & 0 deletions
1
controllers/provider-aws/charts/validator-aws/charts/runtime/templates/_helpers.tpl
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 @@ | ||
../../../templates/_helpers.tpl |
72 changes: 72 additions & 0 deletions
72
controllers/provider-aws/charts/validator-aws/charts/runtime/templates/deployment.yaml
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,72 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "name" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{ include "labels" . | indent 4 }} | ||
spec: | ||
revisionHistoryLimit: 0 | ||
replicas: {{ .Values.global.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{ include "labels" . | indent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
checksum/secret-gardener-extensions-validator-aws-cert: {{ include (print $.Template.BasePath "/secret-cert.yaml") . | sha256sum }} | ||
{{- if .Values.global.kubeconfig }} | ||
checksum/gardener-extensions-validator-aws-kubeconfig: {{ include (print $.Template.BasePath "/secret-kubeconfig.yaml") . | sha256sum }} | ||
{{- end }} | ||
labels: | ||
{{ include "labels" . | indent 8 }} | ||
spec: | ||
{{- if .Values.global.kubeconfig }} | ||
automountServiceAccountToken: false | ||
{{- end }} | ||
containers: | ||
- name: {{ include "name" . }} | ||
image: {{ include "image" .Values.global.image }} | ||
imagePullPolicy: {{ .Values.global.image.pullPolicy }} | ||
command: | ||
- /gardener-extension-hyper | ||
- gardener-extensions-validator-aws | ||
- --webhook-config-server-port={{ .Values.global.webhookConfig.serverPort }} | ||
- --webhook-config-cert-dir=/etc/gardener-extensions-validator-aws/srv | ||
{{- if .Values.global.kubeconfig }} | ||
- --kubeconfig=/etc/gardener-extensions-validator-aws/kubeconfig/kubeconfig | ||
{{- end }} | ||
ports: | ||
- name: webhook-server | ||
containerPort: {{ .Values.global.webhookConfig.serverPort }} | ||
protocol: TCP | ||
livenessProbe: | ||
tcpSocket: | ||
port: {{ .Values.global.webhookConfig.serverPort }} | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
{{- if .Values.global.resources }} | ||
resources: | ||
{{ toYaml .Values.global.resources | nindent 10 }} | ||
{{- end }} | ||
volumeMounts: | ||
- name: gardener-extensions-validator-aws-cert | ||
mountPath: /etc/gardener-extensions-validator-aws/srv | ||
readOnly: true | ||
{{- if .Values.global.kubeconfig }} | ||
- name: gardener-extensions-validator-aws-kubeconfig | ||
mountPath: /etc/gardener-extensions-validator-aws/kubeconfig | ||
readOnly: true | ||
{{- end }} | ||
serviceAccountName: {{ include "name" . }} | ||
volumes: | ||
- name: gardener-extensions-validator-aws-cert | ||
secret: | ||
secretName: gardener-extensions-validator-aws-cert | ||
defaultMode: 420 | ||
{{- if .Values.global.kubeconfig }} | ||
- name: gardener-extensions-validator-aws-kubeconfig | ||
secret: | ||
secretName: gardener-extensions-validator-aws-kubeconfig | ||
defaultMode: 420 | ||
{{- end }} |
15 changes: 15 additions & 0 deletions
15
controllers/provider-aws/charts/validator-aws/charts/runtime/templates/secret-cert.yaml
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,15 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: gardener-extensions-validator-aws-cert | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app: gardener | ||
role: controller-manager | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: "{{ .Release.Name }}" | ||
heritage: "{{ .Release.Service }}" | ||
type: Opaque | ||
data: | ||
tls.crt: {{ required ".Values.global.webhookConfig.tls.crt is required" (b64enc .Values.global.webhookConfig.tls.crt) }} | ||
tls.key: {{ required ".Values.global.webhookConfig.tls.key is required" (b64enc .Values.global.webhookConfig.tls.key) }} |
14 changes: 14 additions & 0 deletions
14
...rollers/provider-aws/charts/validator-aws/charts/runtime/templates/secret-kubeconfig.yaml
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,14 @@ | ||
{{- if .Values.global.kubeconfig }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: gardener-extensions-validator-aws-kubeconfig | ||
namespace: "{{ .Release.Namespace }}" | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: "{{ .Release.Name }}" | ||
heritage: "{{ .Release.Service }}" | ||
type: Opaque | ||
data: | ||
kubeconfig: {{ .Values.global.kubeconfig | b64enc }} | ||
{{- end }} |
15 changes: 15 additions & 0 deletions
15
controllers/provider-aws/charts/validator-aws/charts/runtime/templates/service.yaml
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,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "name" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{ include "labels" . | indent 4 }} | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
{{ include "labels" . | indent 4 }} | ||
ports: | ||
- port: 443 | ||
protocol: TCP | ||
targetPort: {{ .Values.global.webhookConfig.serverPort }} |
20 changes: 20 additions & 0 deletions
20
controllers/provider-aws/charts/validator-aws/charts/runtime/values.yaml
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,20 @@ | ||
global: | ||
image: | ||
repository: eu.gcr.io/gardener-project/gardener/gardener-extension-hyper | ||
tag: latest | ||
pullPolicy: IfNotPresent | ||
replicaCount: 1 | ||
resources: {} | ||
webhookConfig: | ||
serverPort: 443 | ||
tls: | ||
crt: | | ||
-----BEGIN CERTIFICATE----- | ||
... | ||
-----END CERTIFICATE----- | ||
key: | | ||
-----BEGIN RSA PRIVATE KEY----- | ||
... | ||
-----END RSA PRIVATE KEY----- | ||
# Kubeconfig to the target cluster. In-cluster configuration will be used if not specified. | ||
kubeconfig: |
27 changes: 27 additions & 0 deletions
27
controllers/provider-aws/charts/validator-aws/templates/_helpers.tpl
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,27 @@ | ||
{{- define "name" -}} | ||
gardener-extensions-validator-aws | ||
{{- end -}} | ||
|
||
{{- define "labels.app.key" -}} | ||
app.kubernetes.io/name | ||
{{- end -}} | ||
{{- define "labels.app.value" -}} | ||
{{ include "name" . }} | ||
{{- end -}} | ||
|
||
{{- define "labels" -}} | ||
{{ include "labels.app.key" . }}: {{ include "labels.app.value" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} | ||
|
||
{{- define "image" -}} | ||
{{- if hasPrefix "sha256:" .tag }} | ||
{{- printf "%s@%s" .repository .tag }} | ||
{{- else }} | ||
{{- printf "%s:%s" .repository .tag }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "deploymentversion" -}} | ||
apps/v1 | ||
{{- end -}} |
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,26 @@ | ||
global: | ||
virtualGarden: | ||
enabled: false | ||
image: | ||
repository: eu.gcr.io/gardener-project/gardener/gardener-extension-hyper | ||
tag: latest | ||
pullPolicy: IfNotPresent | ||
replicaCount: 1 | ||
resources: {} | ||
webhookConfig: | ||
caBundle: | | ||
-----BEGIN CERTIFICATE----- | ||
... | ||
-----END CERTIFICATE----- | ||
serverPort: 443 | ||
tls: | ||
crt: | | ||
-----BEGIN CERTIFICATE----- | ||
... | ||
-----END CERTIFICATE----- | ||
key: | | ||
-----BEGIN RSA PRIVATE KEY----- | ||
... | ||
-----END RSA PRIVATE KEY----- | ||
# Kubeconfig to the target cluster. In-cluster configuration will be used if not specified. | ||
kubeconfig: |
Oops, something went wrong.