-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[stable/field-exporter] add validating webhook configuration
- Loading branch information
Showing
15 changed files
with
334 additions
and
25 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
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,14 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "field-exporter.fullname" . }}-metrics-reader | ||
labels: | ||
app.kubernetes.io/component: kube-rbac-proxy | ||
app.kubernetes.io/created-by: field-exporter | ||
app.kubernetes.io/part-of: field-exporter | ||
{{- include "field-exporter.labels" . | nindent 4 }} | ||
rules: | ||
- nonResourceURLs: | ||
- /metrics | ||
verbs: | ||
- get |
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,17 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "field-exporter.fullname" . }}-controller-manager-metrics-service | ||
labels: | ||
app.kubernetes.io/component: kube-rbac-proxy | ||
app.kubernetes.io/created-by: field-exporter | ||
app.kubernetes.io/part-of: field-exporter | ||
control-plane: controller-manager | ||
{{- include "field-exporter.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.metricsService.type }} | ||
selector: | ||
control-plane: controller-manager | ||
{{- include "field-exporter.selectorLabels" . | nindent 4 }} | ||
ports: | ||
{{- .Values.metricsService.ports | toYaml | nindent 2 -}} |
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,40 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "field-exporter.fullname" . }}-proxy-role | ||
labels: | ||
app.kubernetes.io/component: kube-rbac-proxy | ||
app.kubernetes.io/created-by: field-exporter | ||
app.kubernetes.io/part-of: field-exporter | ||
{{- include "field-exporter.labels" . | nindent 4 }} | ||
rules: | ||
- apiGroups: | ||
- authentication.k8s.io | ||
resources: | ||
- tokenreviews | ||
verbs: | ||
- create | ||
- apiGroups: | ||
- authorization.k8s.io | ||
resources: | ||
- subjectaccessreviews | ||
verbs: | ||
- create | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "field-exporter.fullname" . }}-proxy-rolebinding | ||
labels: | ||
app.kubernetes.io/component: kube-rbac-proxy | ||
app.kubernetes.io/created-by: field-exporter | ||
app.kubernetes.io/part-of: field-exporter | ||
{{- include "field-exporter.labels" . | nindent 4 }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: '{{ include "field-exporter.fullname" . }}-proxy-role' | ||
subjects: | ||
- kind: ServiceAccount | ||
name: '{{ include "field-exporter.fullname" . }}-controller-manager' | ||
namespace: '{{ .Release.Namespace }}' |
152 changes: 152 additions & 0 deletions
152
stable/field-exporter/templates/resourcefieldexport-crd.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,152 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: resourcefieldexports.gdp.deliveryhero.io | ||
annotations: | ||
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "field-exporter.fullname" | ||
. }}-serving-cert' | ||
controller-gen.kubebuilder.io/version: v0.13.0 | ||
labels: | ||
{{- include "field-exporter.labels" . | nindent 4 }} | ||
spec: | ||
conversion: | ||
strategy: Webhook | ||
webhook: | ||
clientConfig: | ||
service: | ||
name: '{{ include "field-exporter.fullname" . }}-webhook-service' | ||
namespace: '{{ .Release.Namespace }}' | ||
path: /convert | ||
conversionReviewVersions: | ||
- v1 | ||
group: gdp.deliveryhero.io | ||
names: | ||
kind: ResourceFieldExport | ||
listKind: ResourceFieldExportList | ||
plural: resourcefieldexports | ||
singular: resourcefieldexport | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: ResourceFieldExport is the Schema for the resourcefieldexports | ||
API | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: ResourceFieldExportSpec defines the desired state of ResourceFieldExport | ||
properties: | ||
from: | ||
properties: | ||
apiVersion: | ||
description: APIVersion is the group version of the resource | ||
pattern: ^([a-zA-Z0-9.-]+[a-zA-Z0-9-]\/[a-zA-Z0-9]+|[a-zA-Z0-9]+)$ | ||
type: string | ||
kind: | ||
type: string | ||
name: | ||
type: string | ||
required: | ||
- apiVersion | ||
- kind | ||
- name | ||
type: object | ||
outputs: | ||
items: | ||
properties: | ||
key: | ||
type: string | ||
path: | ||
type: string | ||
required: | ||
- key | ||
- path | ||
type: object | ||
type: array | ||
requiredFields: | ||
properties: | ||
statusConditions: | ||
items: | ||
properties: | ||
status: | ||
type: string | ||
type: | ||
type: string | ||
required: | ||
- status | ||
- type | ||
type: object | ||
type: array | ||
type: object | ||
to: | ||
description: DestinationRef is where the fields should be written. | ||
properties: | ||
name: | ||
type: string | ||
type: | ||
description: DestinationType is a ConfigMap or a Secret | ||
enum: | ||
- ConfigMap | ||
- Secret | ||
type: string | ||
required: | ||
- name | ||
- type | ||
type: object | ||
required: | ||
- from | ||
- outputs | ||
- to | ||
type: object | ||
status: | ||
description: ResourceFieldExportStatus defines the observed state of ResourceFieldExport | ||
properties: | ||
conditions: | ||
items: | ||
properties: | ||
lastTransitionTime: | ||
description: The last time the condition transitioned from one | ||
status to another. | ||
format: date-time | ||
type: string | ||
message: | ||
description: A human-readable message indicating details about | ||
the transition. | ||
type: string | ||
status: | ||
description: Status of the condition, one of True, False, Unknown. | ||
type: string | ||
type: | ||
description: Type is the type of the Condition | ||
type: string | ||
required: | ||
- status | ||
- type | ||
type: object | ||
type: array | ||
required: | ||
- conditions | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
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: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: {{ include "field-exporter.fullname" . }}-selfsigned-issuer | ||
labels: | ||
{{- include "field-exporter.labels" . | nindent 4 }} | ||
spec: | ||
selfSigned: {} |
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
Oops, something went wrong.