From 08236585753228ccde783280eef4c400f1ae4cdc Mon Sep 17 00:00:00 2001 From: Kalvis Kuskis <44435644+kalvkusk@users.noreply.github.com> Date: Fri, 8 Sep 2023 13:00:30 +0300 Subject: [PATCH 1/2] migrate CRDs to use latest cert-manager.io and v1 api extensions --- config/certmanager/certificate.yaml | 4 +- ....k8s.newrelic.com_alertsapmconditions.yaml | 434 +++++----- .../nr.k8s.newrelic.com_alertschannels.yaml | 27 +- ...k8s.newrelic.com_alertsnrqlconditions.yaml | 538 ++++++------ .../nr.k8s.newrelic.com_alertspolicies.yaml | 765 +++++++++--------- ...r.k8s.newrelic.com_apmalertconditions.yaml | 226 +++--- ....k8s.newrelic.com_nrqlalertconditions.yaml | 210 +++-- .../bases/nr.k8s.newrelic.com_policies.yaml | 341 ++++---- .../cainjection_in_alertsapmconditions.yaml | 2 +- .../cainjection_in_alertschannels.yaml | 2 +- .../cainjection_in_alertsnrqlconditions.yaml | 2 +- .../cainjection_in_alertspolicies.yaml | 2 +- .../cainjection_in_apmalertconditions.yaml | 2 +- .../cainjection_in_newrelicpolicies.yaml | 2 +- .../cainjection_in_nrqlalertconditions.yaml | 2 +- .../webhook_in_alertsapmconditions.yaml | 2 +- .../patches/webhook_in_alertschannels.yaml | 2 +- .../webhook_in_alertsnrqlconditions.yaml | 2 +- .../patches/webhook_in_alertspolicies.yaml | 2 +- .../webhook_in_apmalertconditions.yaml | 2 +- .../patches/webhook_in_newrelicpolicies.yaml | 2 +- .../webhook_in_nrqlalertconditions.yaml | 2 +- config/default/kustomization.yaml | 4 +- config/default/webhookcainjection_patch.yaml | 4 +- config/webhook/manifests.yaml | 32 +- 25 files changed, 1315 insertions(+), 1298 deletions(-) diff --git a/config/certmanager/certificate.yaml b/config/certmanager/certificate.yaml index 237c937..fac5aa1 100644 --- a/config/certmanager/certificate.yaml +++ b/config/certmanager/certificate.yaml @@ -1,7 +1,7 @@ # The following manifests contain a self-signed issuer CR and a certificate CR. # More document can be found at https://docs.cert-manager.io # WARNING: Targets CertManager 0.11 check https://docs.cert-manager.io/en/latest/tasks/upgrading/index.html for breaking changes -apiVersion: cert-manager.io/v1alpha2 +apiVersion: cert-manager.io/v1 kind: Issuer metadata: name: selfsigned-issuer @@ -9,7 +9,7 @@ metadata: spec: selfSigned: {} --- -apiVersion: cert-manager.io/v1alpha2 +apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml diff --git a/config/crd/bases/nr.k8s.newrelic.com_alertsapmconditions.yaml b/config/crd/bases/nr.k8s.newrelic.com_alertsapmconditions.yaml index 7159324..8639c51 100644 --- a/config/crd/bases/nr.k8s.newrelic.com_alertsapmconditions.yaml +++ b/config/crd/bases/nr.k8s.newrelic.com_alertsapmconditions.yaml @@ -1,6 +1,6 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: @@ -8,10 +8,6 @@ metadata: creationTimestamp: null name: alertsapmconditions.nr.k8s.newrelic.com spec: - additionalPrinterColumns: - - JSONPath: .status.created - name: Created - type: boolean group: nr.k8s.newrelic.com names: kind: AlertsAPMCondition @@ -19,241 +15,243 @@ spec: plural: alertsapmconditions singular: alertsapmcondition scope: Namespaced - subresources: {} - validation: - openAPIV3Schema: - description: AlertsAPMCondition is the Schema for the alertsapmconditions 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: AlertsAPMConditionSpec defines the desired state of AlertsAPMCondition - properties: - account_id: - type: integer - api_key: - type: string - api_key_secret: - properties: - key_name: - type: string - name: - type: string - namespace: - type: string - type: object - apm_terms: - items: - description: AlertConditionTerm represents the terms of a New Relic - alert condition. - properties: - duration: - type: string - operator: - type: string - priority: - type: string - threshold: - type: string - time_function: - type: string - violation_close_timer: - type: integer - required: - - threshold - type: object - type: array - condition_scope: - type: string - enabled: - type: boolean - entities: - items: + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: + description: AlertsAPMCondition is the Schema for the alertsapmconditions 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: AlertsAPMConditionSpec defines the desired state of AlertsAPMCondition + properties: + account_id: + type: integer + api_key: type: string - type: array - existing_policy_id: - type: string - gc_metric: - type: string - id: - type: integer - metric: - type: string - name: - type: string - region: - type: string - runbook_url: - type: string - terms: - items: - description: AlertsNrqlConditionTerm represents the terms of a New - Relic alert condition. + api_key_secret: properties: - operator: - description: AlertsNRQLConditionTermsOperator - Operator used - to compare against the threshold for NrqlConditions. + key_name: type: string - priority: - description: NrqlConditionPriority specifies the priority for - alert condition terms. + name: type: string - threshold: - type: string - threshold_duration: - type: integer - threshold_occurrences: - description: ThresholdOccurrence specifies the threshold occurrence - for NRQL alert condition terms. + namespace: type: string type: object - type: array - type: - description: NrqlConditionType specifies the type of NRQL alert condition. - type: string - user_defined: - description: ConditionUserDefined represents user defined metrics for - the New Relic alert condition. - properties: - metric: - type: string - value_function: - description: ValueFunctionType specifies the value function to be - used for returning custom metric data. - type: string - type: object - violation_close_timer: - type: integer - required: - - enabled - type: object - status: - description: AlertsAPMConditionStatus defines the observed state of AlertsAPMCondition - properties: - applied_spec: - description: AlertsAPMConditionSpec defines the desired state of AlertsAPMCondition - properties: - account_id: - type: integer - api_key: + apm_terms: + items: + description: AlertConditionTerm represents the terms of a New Relic + alert condition. + properties: + duration: + type: string + operator: + type: string + priority: + type: string + threshold: + type: string + time_function: + type: string + violation_close_timer: + type: integer + required: + - threshold + type: object + type: array + condition_scope: + type: string + enabled: + type: boolean + entities: + items: type: string - api_key_secret: + type: array + existing_policy_id: + type: string + gc_metric: + type: string + id: + type: integer + metric: + type: string + name: + type: string + region: + type: string + runbook_url: + type: string + terms: + items: + description: AlertsNrqlConditionTerm represents the terms of a New + Relic alert condition. properties: - key_name: + operator: + description: AlertsNRQLConditionTermsOperator - Operator used + to compare against the threshold for NrqlConditions. type: string - name: + priority: + description: NrqlConditionPriority specifies the priority for + alert condition terms. type: string - namespace: + threshold: + type: string + threshold_duration: + type: integer + threshold_occurrences: + description: ThresholdOccurrence specifies the threshold occurrence + for NRQL alert condition terms. type: string type: object - apm_terms: - items: - description: AlertConditionTerm represents the terms of a New - Relic alert condition. + type: array + type: + description: NrqlConditionType specifies the type of NRQL alert condition. + type: string + user_defined: + description: ConditionUserDefined represents user defined metrics for + the New Relic alert condition. + properties: + metric: + type: string + value_function: + description: ValueFunctionType specifies the value function to be + used for returning custom metric data. + type: string + type: object + violation_close_timer: + type: integer + required: + - enabled + type: object + status: + description: AlertsAPMConditionStatus defines the observed state of AlertsAPMCondition + properties: + applied_spec: + description: AlertsAPMConditionSpec defines the desired state of AlertsAPMCondition + properties: + account_id: + type: integer + api_key: + type: string + api_key_secret: properties: - duration: + key_name: type: string - operator: + name: type: string - priority: + namespace: type: string - threshold: - type: string - time_function: - type: string - violation_close_timer: - type: integer - required: - - threshold type: object - type: array - condition_scope: - type: string - enabled: - type: boolean - entities: - items: + apm_terms: + items: + description: AlertConditionTerm represents the terms of a New + Relic alert condition. + properties: + duration: + type: string + operator: + type: string + priority: + type: string + threshold: + type: string + time_function: + type: string + violation_close_timer: + type: integer + required: + - threshold + type: object + type: array + condition_scope: type: string - type: array - existing_policy_id: - type: string - gc_metric: - type: string - id: - type: integer - metric: - type: string - name: - type: string - region: - type: string - runbook_url: - type: string - terms: - items: - description: AlertsNrqlConditionTerm represents the terms of a - New Relic alert condition. + enabled: + type: boolean + entities: + items: + type: string + type: array + existing_policy_id: + type: string + gc_metric: + type: string + id: + type: integer + metric: + type: string + name: + type: string + region: + type: string + runbook_url: + type: string + terms: + items: + description: AlertsNrqlConditionTerm represents the terms of a + New Relic alert condition. + properties: + operator: + description: AlertsNRQLConditionTermsOperator - Operator used + to compare against the threshold for NrqlConditions. + type: string + priority: + description: NrqlConditionPriority specifies the priority + for alert condition terms. + type: string + threshold: + type: string + threshold_duration: + type: integer + threshold_occurrences: + description: ThresholdOccurrence specifies the threshold occurrence + for NRQL alert condition terms. + type: string + type: object + type: array + type: + description: NrqlConditionType specifies the type of NRQL alert + condition. + type: string + user_defined: + description: ConditionUserDefined represents user defined metrics + for the New Relic alert condition. properties: - operator: - description: AlertsNRQLConditionTermsOperator - Operator used - to compare against the threshold for NrqlConditions. - type: string - priority: - description: NrqlConditionPriority specifies the priority - for alert condition terms. + metric: type: string - threshold: - type: string - threshold_duration: - type: integer - threshold_occurrences: - description: ThresholdOccurrence specifies the threshold occurrence - for NRQL alert condition terms. + value_function: + description: ValueFunctionType specifies the value function + to be used for returning custom metric data. type: string type: object - type: array - type: - description: NrqlConditionType specifies the type of NRQL alert - condition. - type: string - user_defined: - description: ConditionUserDefined represents user defined metrics - for the New Relic alert condition. - properties: - metric: - type: string - value_function: - description: ValueFunctionType specifies the value function - to be used for returning custom metric data. - type: string - type: object - violation_close_timer: - type: integer - required: - - enabled - type: object - condition_id: - type: integer - required: - - applied_spec - - condition_id - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true + violation_close_timer: + type: integer + required: + - enabled + type: object + condition_id: + type: integer + required: + - applied_spec + - condition_id + type: object + type: object + additionalPrinterColumns: + - name: Created + type: boolean + jsonPath: .status.created status: acceptedNames: kind: "" diff --git a/config/crd/bases/nr.k8s.newrelic.com_alertschannels.yaml b/config/crd/bases/nr.k8s.newrelic.com_alertschannels.yaml index 608200b..c45d060 100644 --- a/config/crd/bases/nr.k8s.newrelic.com_alertschannels.yaml +++ b/config/crd/bases/nr.k8s.newrelic.com_alertschannels.yaml @@ -1,6 +1,6 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: @@ -8,20 +8,19 @@ metadata: creationTimestamp: null name: alertschannels.nr.k8s.newrelic.com spec: - additionalPrinterColumns: - - JSONPath: .status.created - name: Created - type: boolean group: nr.k8s.newrelic.com names: kind: AlertsChannel listKind: AlertsChannelList plural: alertschannels singular: alertschannel - scope: Namespaced - subresources: {} - validation: - openAPIV3Schema: + scope: Namespaced + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: description: AlertsChannel is the Schema for the AlertsChannel API properties: apiVersion: @@ -247,11 +246,11 @@ spec: - channel_id type: object type: object - version: v1 - versions: - - name: v1 - served: true - storage: true + additionalPrinterColumns: + - name: Created + type: boolean + jsonPath: .status.created + status: acceptedNames: kind: "" diff --git a/config/crd/bases/nr.k8s.newrelic.com_alertsnrqlconditions.yaml b/config/crd/bases/nr.k8s.newrelic.com_alertsnrqlconditions.yaml index d029ded..9944423 100644 --- a/config/crd/bases/nr.k8s.newrelic.com_alertsnrqlconditions.yaml +++ b/config/crd/bases/nr.k8s.newrelic.com_alertsnrqlconditions.yaml @@ -1,6 +1,6 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: @@ -8,10 +8,6 @@ metadata: creationTimestamp: null name: alertsnrqlconditions.nr.k8s.newrelic.com spec: - additionalPrinterColumns: - - JSONPath: .status.created - name: Created - type: boolean group: nr.k8s.newrelic.com names: kind: AlertsNrqlCondition @@ -19,298 +15,300 @@ spec: plural: alertsnrqlconditions singular: alertsnrqlcondition scope: Namespaced - subresources: {} - validation: - openAPIV3Schema: - description: AlertsNrqlCondition is the Schema for the alertsnrqlconditions - 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: AlertsNrqlConditionSpec defines the desired state of AlertsNrqlCondition - properties: - account_id: - type: integer - api_key: - type: string - api_key_secret: - properties: - key_name: - type: string - name: - type: string - namespace: - type: string - type: object - apm_terms: - items: - description: AlertConditionTerm represents the terms of a New Relic - alert condition. + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: + description: AlertsNrqlCondition is the Schema for the alertsnrqlconditions + 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: AlertsNrqlConditionSpec defines the desired state of AlertsNrqlCondition + properties: + account_id: + type: integer + api_key: + type: string + api_key_secret: properties: - duration: - type: string - operator: + key_name: type: string - priority: + name: type: string - threshold: + namespace: type: string - time_function: - type: string - violation_close_timer: + type: object + apm_terms: + items: + description: AlertConditionTerm represents the terms of a New Relic + alert condition. + properties: + duration: + type: string + operator: + type: string + priority: + type: string + threshold: + type: string + time_function: + type: string + violation_close_timer: + type: integer + required: + - threshold + type: object + type: array + baseline_direction: + description: NrqlBaselineDirection + type: string + description: + type: string + enabled: + type: boolean + existing_policy_id: + type: string + expected_groups: + type: integer + expiration: + description: AlertsNrqlConditionExpiration Settings for how violations + are opened or closed when a signal expires. + properties: + closeViolationsOnExpiration: + type: boolean + expirationDuration: type: integer - required: - - threshold + openViolationOnExpiration: + type: boolean type: object - type: array - baseline_direction: - description: NrqlBaselineDirection - type: string - description: - type: string - enabled: - type: boolean - existing_policy_id: - type: string - expected_groups: - type: integer - expiration: - description: AlertsNrqlConditionExpiration Settings for how violations - are opened or closed when a signal expires. - properties: - closeViolationsOnExpiration: - type: boolean - expirationDuration: - type: integer - openViolationOnExpiration: - type: boolean - type: object - id: - type: integer - ignore_overlap: - type: boolean - name: - type: string - nrql: - description: NrqlConditionQuery represents the NRQL query object returned - in a NerdGraph response object. - properties: - evaluationOffset: - type: integer - query: - type: string - type: object - region: - type: string - runbook_url: - type: string - signal: - description: AlertsNrqlConditionSignal - Configuration that defines - the signal that the NRQL condition will use to evaluate. - properties: - aggregation_window: - type: integer - evaluation_offset: - type: integer - fill_option: - description: AlertsFillOption - The available fill options. - type: string - fill_value: - type: string - type: object - terms: - items: - description: AlertsNrqlConditionTerm represents the terms of a New - Relic alert condition. + id: + type: integer + ignore_overlap: + type: boolean + name: + type: string + nrql: + description: NrqlConditionQuery represents the NRQL query object returned + in a NerdGraph response object. properties: - operator: - description: AlertsNRQLConditionTermsOperator - Operator used - to compare against the threshold for NrqlConditions. - type: string - priority: - description: NrqlConditionPriority specifies the priority for - alert condition terms. - type: string - threshold: + evaluationOffset: + type: integer + query: type: string - threshold_duration: + type: object + region: + type: string + runbook_url: + type: string + signal: + description: AlertsNrqlConditionSignal - Configuration that defines + the signal that the NRQL condition will use to evaluate. + properties: + aggregation_window: + type: integer + evaluation_offset: type: integer - threshold_occurrences: - description: ThresholdOccurrence specifies the threshold occurrence - for NRQL alert condition terms. + fill_option: + description: AlertsFillOption - The available fill options. + type: string + fill_value: type: string type: object - type: array - type: - description: NrqlConditionType specifies the type of NRQL alert condition. - type: string - valueFunction: - description: NrqlConditionValueFunction specifies the value function - of NRQL alert condition. - type: string - violationTimeLimit: - description: NrqlConditionViolationTimeLimit specifies the value function - of NRQL alert condition. - type: string - required: - - enabled - type: object - status: - description: AlertsNrqlConditionStatus defines the observed state of AlertsNrqlCondition - properties: - applied_spec: - description: AlertsNrqlConditionSpec defines the desired state of AlertsNrqlCondition - properties: - account_id: - type: integer - api_key: - type: string - api_key_secret: + terms: + items: + description: AlertsNrqlConditionTerm represents the terms of a New + Relic alert condition. properties: - key_name: + operator: + description: AlertsNRQLConditionTermsOperator - Operator used + to compare against the threshold for NrqlConditions. + type: string + priority: + description: NrqlConditionPriority specifies the priority for + alert condition terms. type: string - name: + threshold: type: string - namespace: + threshold_duration: + type: integer + threshold_occurrences: + description: ThresholdOccurrence specifies the threshold occurrence + for NRQL alert condition terms. type: string type: object - apm_terms: - items: - description: AlertConditionTerm represents the terms of a New - Relic alert condition. + type: array + type: + description: NrqlConditionType specifies the type of NRQL alert condition. + type: string + valueFunction: + description: NrqlConditionValueFunction specifies the value function + of NRQL alert condition. + type: string + violationTimeLimit: + description: NrqlConditionViolationTimeLimit specifies the value function + of NRQL alert condition. + type: string + required: + - enabled + type: object + status: + description: AlertsNrqlConditionStatus defines the observed state of AlertsNrqlCondition + properties: + applied_spec: + description: AlertsNrqlConditionSpec defines the desired state of AlertsNrqlCondition + properties: + account_id: + type: integer + api_key: + type: string + api_key_secret: properties: - duration: - type: string - operator: - type: string - priority: + key_name: type: string - threshold: + name: type: string - time_function: + namespace: type: string - violation_close_timer: + type: object + apm_terms: + items: + description: AlertConditionTerm represents the terms of a New + Relic alert condition. + properties: + duration: + type: string + operator: + type: string + priority: + type: string + threshold: + type: string + time_function: + type: string + violation_close_timer: + type: integer + required: + - threshold + type: object + type: array + baseline_direction: + description: NrqlBaselineDirection + type: string + description: + type: string + enabled: + type: boolean + existing_policy_id: + type: string + expected_groups: + type: integer + expiration: + description: AlertsNrqlConditionExpiration Settings for how violations + are opened or closed when a signal expires. + properties: + closeViolationsOnExpiration: + type: boolean + expirationDuration: type: integer - required: - - threshold + openViolationOnExpiration: + type: boolean type: object - type: array - baseline_direction: - description: NrqlBaselineDirection - type: string - description: - type: string - enabled: - type: boolean - existing_policy_id: - type: string - expected_groups: - type: integer - expiration: - description: AlertsNrqlConditionExpiration Settings for how violations - are opened or closed when a signal expires. - properties: - closeViolationsOnExpiration: - type: boolean - expirationDuration: - type: integer - openViolationOnExpiration: - type: boolean - type: object - id: - type: integer - ignore_overlap: - type: boolean - name: - type: string - nrql: - description: NrqlConditionQuery represents the NRQL query object - returned in a NerdGraph response object. - properties: - evaluationOffset: - type: integer - query: - type: string - type: object - region: - type: string - runbook_url: - type: string - signal: - description: AlertsNrqlConditionSignal - Configuration that defines - the signal that the NRQL condition will use to evaluate. - properties: - aggregation_window: - type: integer - evaluation_offset: - type: integer - fill_option: - description: AlertsFillOption - The available fill options. - type: string - fill_value: - type: string - type: object - terms: - items: - description: AlertsNrqlConditionTerm represents the terms of a - New Relic alert condition. + id: + type: integer + ignore_overlap: + type: boolean + name: + type: string + nrql: + description: NrqlConditionQuery represents the NRQL query object + returned in a NerdGraph response object. properties: - operator: - description: AlertsNRQLConditionTermsOperator - Operator used - to compare against the threshold for NrqlConditions. - type: string - priority: - description: NrqlConditionPriority specifies the priority - for alert condition terms. - type: string - threshold: + evaluationOffset: + type: integer + query: type: string - threshold_duration: + type: object + region: + type: string + runbook_url: + type: string + signal: + description: AlertsNrqlConditionSignal - Configuration that defines + the signal that the NRQL condition will use to evaluate. + properties: + aggregation_window: + type: integer + evaluation_offset: type: integer - threshold_occurrences: - description: ThresholdOccurrence specifies the threshold occurrence - for NRQL alert condition terms. + fill_option: + description: AlertsFillOption - The available fill options. + type: string + fill_value: type: string type: object - type: array - type: - description: NrqlConditionType specifies the type of NRQL alert - condition. - type: string - valueFunction: - description: NrqlConditionValueFunction specifies the value function - of NRQL alert condition. - type: string - violationTimeLimit: - description: NrqlConditionViolationTimeLimit specifies the value - function of NRQL alert condition. - type: string - required: - - enabled - type: object - condition_id: - type: string - required: - - applied_spec - - condition_id - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true + terms: + items: + description: AlertsNrqlConditionTerm represents the terms of a + New Relic alert condition. + properties: + operator: + description: AlertsNRQLConditionTermsOperator - Operator used + to compare against the threshold for NrqlConditions. + type: string + priority: + description: NrqlConditionPriority specifies the priority + for alert condition terms. + type: string + threshold: + type: string + threshold_duration: + type: integer + threshold_occurrences: + description: ThresholdOccurrence specifies the threshold occurrence + for NRQL alert condition terms. + type: string + type: object + type: array + type: + description: NrqlConditionType specifies the type of NRQL alert + condition. + type: string + valueFunction: + description: NrqlConditionValueFunction specifies the value function + of NRQL alert condition. + type: string + violationTimeLimit: + description: NrqlConditionViolationTimeLimit specifies the value + function of NRQL alert condition. + type: string + required: + - enabled + type: object + condition_id: + type: string + required: + - applied_spec + - condition_id + type: object + type: object + additionalPrinterColumns: + - name: Created + type: boolean + jsonPath: .status.created status: acceptedNames: kind: "" diff --git a/config/crd/bases/nr.k8s.newrelic.com_alertspolicies.yaml b/config/crd/bases/nr.k8s.newrelic.com_alertspolicies.yaml index f16c9b6..a85d452 100644 --- a/config/crd/bases/nr.k8s.newrelic.com_alertspolicies.yaml +++ b/config/crd/bases/nr.k8s.newrelic.com_alertspolicies.yaml @@ -1,6 +1,6 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: @@ -15,427 +15,426 @@ spec: plural: alertspolicies singular: alertspolicy scope: Namespaced - validation: - openAPIV3Schema: - description: AlertsPolicy is the Schema for the policies 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: AlertsPolicySpec defines the desired state of AlertsPolicy - properties: - account_id: - type: integer - api_key: - type: string - api_key_secret: - properties: - key_name: - type: string - name: - type: string - namespace: - type: string - type: object - channel_ids: - items: + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: + description: AlertsPolicy is the Schema for the policies 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: AlertsPolicySpec defines the desired state of AlertsPolicy + properties: + account_id: type: integer - type: array - conditions: - items: - description: AlertsPolicyCondition defined the conditions contained - within an AlertsPolicy + api_key: + type: string + api_key_secret: properties: + key_name: + type: string name: type: string namespace: type: string - spec: - properties: - account_id: - type: integer - api_key: - type: string - api_key_secret: - properties: - key_name: - type: string - name: - type: string - namespace: - type: string - type: object - apm_terms: - items: - description: AlertConditionTerm represents the terms of - a New Relic alert condition. + type: object + channel_ids: + items: + type: integer + type: array + conditions: + items: + description: AlertsPolicyCondition defined the conditions contained + within an AlertsPolicy + properties: + name: + type: string + namespace: + type: string + spec: + properties: + account_id: + type: integer + api_key: + type: string + api_key_secret: properties: - duration: - type: string - operator: - type: string - priority: + key_name: type: string - threshold: + name: type: string - time_function: + namespace: type: string - violation_close_timer: - type: integer - required: - - threshold type: object - type: array - baseline_direction: - description: NrqlBaselineDirection - type: string - condition_scope: - type: string - description: - type: string - enabled: - type: boolean - entities: - items: + apm_terms: + items: + description: AlertConditionTerm represents the terms of + a New Relic alert condition. + properties: + duration: + type: string + operator: + type: string + priority: + type: string + threshold: + type: string + time_function: + type: string + violation_close_timer: + type: integer + required: + - threshold + type: object + type: array + baseline_direction: + description: NrqlBaselineDirection type: string - type: array - existing_policy_id: - type: string - expected_groups: - type: integer - expiration: - description: AlertsNrqlConditionExpiration Settings for how - violations are opened or closed when a signal expires. - properties: - closeViolationsOnExpiration: - type: boolean - expirationDuration: - type: integer - openViolationOnExpiration: - type: boolean - type: object - gc_metric: - type: string - id: - type: integer - ignore_overlap: - type: boolean - metric: - type: string - name: - type: string - nrql: - description: NrqlConditionQuery represents the NRQL query - object returned in a NerdGraph response object. - properties: - evaluationOffset: - type: integer - query: - type: string - type: object - region: - type: string - runbook_url: - type: string - signal: - description: AlertsNrqlConditionSignal - Configuration that - defines the signal that the NRQL condition will use to evaluate. - properties: - aggregation_window: - type: integer - evaluation_offset: - type: integer - fill_option: - description: AlertsFillOption - The available fill options. - type: string - fill_value: + condition_scope: + type: string + description: + type: string + enabled: + type: boolean + entities: + items: type: string - type: object - terms: - items: - description: AlertsNrqlConditionTerm represents the terms - of a New Relic alert condition. + type: array + existing_policy_id: + type: string + expected_groups: + type: integer + expiration: + description: AlertsNrqlConditionExpiration Settings for how + violations are opened or closed when a signal expires. properties: - operator: - description: AlertsNRQLConditionTermsOperator - Operator - used to compare against the threshold for NrqlConditions. + closeViolationsOnExpiration: + type: boolean + expirationDuration: + type: integer + openViolationOnExpiration: + type: boolean + type: object + gc_metric: + type: string + id: + type: integer + ignore_overlap: + type: boolean + metric: + type: string + name: + type: string + nrql: + description: NrqlConditionQuery represents the NRQL query + object returned in a NerdGraph response object. + properties: + evaluationOffset: + type: integer + query: type: string - priority: - description: NrqlConditionPriority specifies the priority - for alert condition terms. + type: object + region: + type: string + runbook_url: + type: string + signal: + description: AlertsNrqlConditionSignal - Configuration that + defines the signal that the NRQL condition will use to evaluate. + properties: + aggregation_window: + type: integer + evaluation_offset: + type: integer + fill_option: + description: AlertsFillOption - The available fill options. type: string - threshold: + fill_value: type: string - threshold_duration: - type: integer - threshold_occurrences: - description: ThresholdOccurrence specifies the threshold - occurrence for NRQL alert condition terms. + type: object + terms: + items: + description: AlertsNrqlConditionTerm represents the terms + of a New Relic alert condition. + properties: + operator: + description: AlertsNRQLConditionTermsOperator - Operator + used to compare against the threshold for NrqlConditions. + type: string + priority: + description: NrqlConditionPriority specifies the priority + for alert condition terms. + type: string + threshold: + type: string + threshold_duration: + type: integer + threshold_occurrences: + description: ThresholdOccurrence specifies the threshold + occurrence for NRQL alert condition terms. + type: string + type: object + type: array + type: + description: NrqlConditionType specifies the type of NRQL + alert condition. + type: string + user_defined: + description: ConditionUserDefined represents user defined + metrics for the New Relic alert condition. + properties: + metric: + type: string + value_function: + description: ValueFunctionType specifies the value function + to be used for returning custom metric data. type: string type: object - type: array - type: - description: NrqlConditionType specifies the type of NRQL - alert condition. - type: string - user_defined: - description: ConditionUserDefined represents user defined - metrics for the New Relic alert condition. - properties: - metric: - type: string - value_function: - description: ValueFunctionType specifies the value function - to be used for returning custom metric data. - type: string - type: object - valueFunction: - description: NrqlConditionValueFunction specifies the value - function of NRQL alert condition. - type: string - violation_close_timer: - type: integer - violationTimeLimit: - description: NrqlConditionViolationTimeLimit specifies the - value function of NRQL alert condition. - type: string - required: - - enabled - type: object - type: object - type: array - incidentPreference: - type: string - name: - type: string - region: - type: string - required: - - name - - region - type: object - status: - description: AlertsPolicyStatus defines the observed state of AlertsPolicy - properties: - applied_spec: - description: AlertsPolicySpec defines the desired state of AlertsPolicy - properties: - account_id: - type: integer - api_key: - type: string - api_key_secret: - properties: - key_name: - type: string - name: - type: string - namespace: - type: string + valueFunction: + description: NrqlConditionValueFunction specifies the value + function of NRQL alert condition. + type: string + violation_close_timer: + type: integer + violationTimeLimit: + description: NrqlConditionViolationTimeLimit specifies the + value function of NRQL alert condition. + type: string + required: + - enabled + type: object type: object - channel_ids: - items: + type: array + incidentPreference: + type: string + name: + type: string + region: + type: string + required: + - name + - region + type: object + status: + description: AlertsPolicyStatus defines the observed state of AlertsPolicy + properties: + applied_spec: + description: AlertsPolicySpec defines the desired state of AlertsPolicy + properties: + account_id: type: integer - type: array - conditions: - items: - description: AlertsPolicyCondition defined the conditions contained - within an AlertsPolicy + api_key: + type: string + api_key_secret: properties: + key_name: + type: string name: type: string namespace: type: string - spec: - properties: - account_id: - type: integer - api_key: - type: string - api_key_secret: - properties: - key_name: - type: string - name: - type: string - namespace: - type: string - type: object - apm_terms: - items: - description: AlertConditionTerm represents the terms - of a New Relic alert condition. + type: object + channel_ids: + items: + type: integer + type: array + conditions: + items: + description: AlertsPolicyCondition defined the conditions contained + within an AlertsPolicy + properties: + name: + type: string + namespace: + type: string + spec: + properties: + account_id: + type: integer + api_key: + type: string + api_key_secret: properties: - duration: - type: string - operator: + key_name: type: string - priority: + name: type: string - threshold: + namespace: type: string - time_function: - type: string - violation_close_timer: - type: integer - required: - - threshold type: object - type: array - baseline_direction: - description: NrqlBaselineDirection - type: string - condition_scope: - type: string - description: - type: string - enabled: - type: boolean - entities: - items: + apm_terms: + items: + description: AlertConditionTerm represents the terms + of a New Relic alert condition. + properties: + duration: + type: string + operator: + type: string + priority: + type: string + threshold: + type: string + time_function: + type: string + violation_close_timer: + type: integer + required: + - threshold + type: object + type: array + baseline_direction: + description: NrqlBaselineDirection type: string - type: array - existing_policy_id: - type: string - expected_groups: - type: integer - expiration: - description: AlertsNrqlConditionExpiration Settings for - how violations are opened or closed when a signal expires. - properties: - closeViolationsOnExpiration: - type: boolean - expirationDuration: - type: integer - openViolationOnExpiration: - type: boolean - type: object - gc_metric: - type: string - id: - type: integer - ignore_overlap: - type: boolean - metric: - type: string - name: - type: string - nrql: - description: NrqlConditionQuery represents the NRQL query - object returned in a NerdGraph response object. - properties: - evaluationOffset: - type: integer - query: - type: string - type: object - region: - type: string - runbook_url: - type: string - signal: - description: AlertsNrqlConditionSignal - Configuration - that defines the signal that the NRQL condition will - use to evaluate. - properties: - aggregation_window: - type: integer - evaluation_offset: - type: integer - fill_option: - description: AlertsFillOption - The available fill - options. - type: string - fill_value: + condition_scope: + type: string + description: + type: string + enabled: + type: boolean + entities: + items: type: string - type: object - terms: - items: - description: AlertsNrqlConditionTerm represents the - terms of a New Relic alert condition. + type: array + existing_policy_id: + type: string + expected_groups: + type: integer + expiration: + description: AlertsNrqlConditionExpiration Settings for + how violations are opened or closed when a signal expires. + properties: + closeViolationsOnExpiration: + type: boolean + expirationDuration: + type: integer + openViolationOnExpiration: + type: boolean + type: object + gc_metric: + type: string + id: + type: integer + ignore_overlap: + type: boolean + metric: + type: string + name: + type: string + nrql: + description: NrqlConditionQuery represents the NRQL query + object returned in a NerdGraph response object. + properties: + evaluationOffset: + type: integer + query: + type: string + type: object + region: + type: string + runbook_url: + type: string + signal: + description: AlertsNrqlConditionSignal - Configuration + that defines the signal that the NRQL condition will + use to evaluate. properties: - operator: - description: AlertsNRQLConditionTermsOperator - - Operator used to compare against the threshold - for NrqlConditions. + aggregation_window: + type: integer + evaluation_offset: + type: integer + fill_option: + description: AlertsFillOption - The available fill + options. type: string - priority: - description: NrqlConditionPriority specifies the - priority for alert condition terms. + fill_value: type: string - threshold: + type: object + terms: + items: + description: AlertsNrqlConditionTerm represents the + terms of a New Relic alert condition. + properties: + operator: + description: AlertsNRQLConditionTermsOperator - + Operator used to compare against the threshold + for NrqlConditions. + type: string + priority: + description: NrqlConditionPriority specifies the + priority for alert condition terms. + type: string + threshold: + type: string + threshold_duration: + type: integer + threshold_occurrences: + description: ThresholdOccurrence specifies the threshold + occurrence for NRQL alert condition terms. + type: string + type: object + type: array + type: + description: NrqlConditionType specifies the type of NRQL + alert condition. + type: string + user_defined: + description: ConditionUserDefined represents user defined + metrics for the New Relic alert condition. + properties: + metric: type: string - threshold_duration: - type: integer - threshold_occurrences: - description: ThresholdOccurrence specifies the threshold - occurrence for NRQL alert condition terms. + value_function: + description: ValueFunctionType specifies the value + function to be used for returning custom metric + data. type: string type: object - type: array - type: - description: NrqlConditionType specifies the type of NRQL - alert condition. - type: string - user_defined: - description: ConditionUserDefined represents user defined - metrics for the New Relic alert condition. - properties: - metric: - type: string - value_function: - description: ValueFunctionType specifies the value - function to be used for returning custom metric - data. - type: string - type: object - valueFunction: - description: NrqlConditionValueFunction specifies the - value function of NRQL alert condition. - type: string - violation_close_timer: - type: integer - violationTimeLimit: - description: NrqlConditionViolationTimeLimit specifies - the value function of NRQL alert condition. - type: string - required: - - enabled - type: object - type: object - type: array - incidentPreference: - type: string - name: - type: string - region: - type: string - required: - - name - - region - type: object - policy_id: - type: string - required: - - applied_spec - - policy_id - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true + valueFunction: + description: NrqlConditionValueFunction specifies the + value function of NRQL alert condition. + type: string + violation_close_timer: + type: integer + violationTimeLimit: + description: NrqlConditionViolationTimeLimit specifies + the value function of NRQL alert condition. + type: string + required: + - enabled + type: object + type: object + type: array + incidentPreference: + type: string + name: + type: string + region: + type: string + required: + - name + - region + type: object + policy_id: + type: string + required: + - applied_spec + - policy_id + type: object + type: object status: acceptedNames: kind: "" diff --git a/config/crd/bases/nr.k8s.newrelic.com_apmalertconditions.yaml b/config/crd/bases/nr.k8s.newrelic.com_apmalertconditions.yaml index 337c8d8..a34fe40 100644 --- a/config/crd/bases/nr.k8s.newrelic.com_apmalertconditions.yaml +++ b/config/crd/bases/nr.k8s.newrelic.com_apmalertconditions.yaml @@ -1,6 +1,6 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: @@ -8,10 +8,6 @@ metadata: creationTimestamp: null name: apmalertconditions.nr.k8s.newrelic.com spec: - additionalPrinterColumns: - - JSONPath: .status.created - name: Created - type: boolean group: nr.k8s.newrelic.com names: kind: ApmAlertCondition @@ -19,102 +15,27 @@ spec: plural: apmalertconditions singular: apmalertcondition scope: Namespaced - subresources: {} - validation: - openAPIV3Schema: - description: ApmAlertCondition is the Schema for the apmalertconditions 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: ApmAlertConditionSpec defines the desired state of ApmAlertCondition + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: + description: ApmAlertCondition is the Schema for the apmalertconditions API properties: - api_key: - type: string - api_key_secret: - properties: - key_name: - type: string - name: - type: string - namespace: - type: string - type: object - condition_scope: - type: string - enabled: - type: boolean - entities: - items: - type: string - type: array - existing_policy_id: - type: integer - gc_metric: + 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 - id: - type: integer - metric: + 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 - name: - type: string - region: - type: string - runbook_url: - type: string - terms: - items: - description: AlertConditionTerm represents the terms of a New Relic - alert condition. - properties: - duration: - type: string - operator: - type: string - priority: - type: string - threshold: - type: string - time_function: - type: string - violation_close_timer: - type: integer - required: - - threshold - type: object - type: array - type: - type: string - user_defined: - description: ConditionUserDefined represents user defined metrics for - the New Relic alert condition. - properties: - metric: - type: string - value_function: - description: ValueFunctionType specifies the value function to be - used for returning custom metric data. - type: string + metadata: type: object - violation_close_timer: - type: integer - required: - - enabled - type: object - status: - description: ApmAlertConditionStatus defines the observed state of ApmAlertCondition - properties: - applied_spec: + spec: description: ApmAlertConditionSpec defines the desired state of ApmAlertCondition properties: api_key: @@ -152,8 +73,8 @@ spec: type: string terms: items: - description: AlertConditionTerm represents the terms of a New - Relic alert condition. + description: AlertConditionTerm represents the terms of a New Relic + alert condition. properties: duration: type: string @@ -174,14 +95,14 @@ spec: type: type: string user_defined: - description: ConditionUserDefined represents user defined metrics - for the New Relic alert condition. + description: ConditionUserDefined represents user defined metrics for + the New Relic alert condition. properties: metric: type: string value_function: - description: ValueFunctionType specifies the value function - to be used for returning custom metric data. + description: ValueFunctionType specifies the value function to be + used for returning custom metric data. type: string type: object violation_close_timer: @@ -189,18 +110,95 @@ spec: required: - enabled type: object - condition_id: - type: integer - required: - - applied_spec - - condition_id + status: + description: ApmAlertConditionStatus defines the observed state of ApmAlertCondition + properties: + applied_spec: + description: ApmAlertConditionSpec defines the desired state of ApmAlertCondition + properties: + api_key: + type: string + api_key_secret: + properties: + key_name: + type: string + name: + type: string + namespace: + type: string + type: object + condition_scope: + type: string + enabled: + type: boolean + entities: + items: + type: string + type: array + existing_policy_id: + type: integer + gc_metric: + type: string + id: + type: integer + metric: + type: string + name: + type: string + region: + type: string + runbook_url: + type: string + terms: + items: + description: AlertConditionTerm represents the terms of a New + Relic alert condition. + properties: + duration: + type: string + operator: + type: string + priority: + type: string + threshold: + type: string + time_function: + type: string + violation_close_timer: + type: integer + required: + - threshold + type: object + type: array + type: + type: string + user_defined: + description: ConditionUserDefined represents user defined metrics + for the New Relic alert condition. + properties: + metric: + type: string + value_function: + description: ValueFunctionType specifies the value function + to be used for returning custom metric data. + type: string + type: object + violation_close_timer: + type: integer + required: + - enabled + type: object + condition_id: + type: integer + required: + - applied_spec + - condition_id + type: object type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true + additionalPrinterColumns: + - name: Created + type: boolean + jsonPath: .status.created status: acceptedNames: kind: "" diff --git a/config/crd/bases/nr.k8s.newrelic.com_nrqlalertconditions.yaml b/config/crd/bases/nr.k8s.newrelic.com_nrqlalertconditions.yaml index 6b04585..dd501b6 100644 --- a/config/crd/bases/nr.k8s.newrelic.com_nrqlalertconditions.yaml +++ b/config/crd/bases/nr.k8s.newrelic.com_nrqlalertconditions.yaml @@ -1,6 +1,6 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: @@ -8,10 +8,6 @@ metadata: creationTimestamp: null name: nrqlalertconditions.nr.k8s.newrelic.com spec: - additionalPrinterColumns: - - JSONPath: .status.created - name: Created - type: boolean group: nr.k8s.newrelic.com names: kind: NrqlAlertCondition @@ -19,96 +15,27 @@ spec: plural: nrqlalertconditions singular: nrqlalertcondition scope: Namespaced - subresources: {} - validation: - openAPIV3Schema: - description: NrqlAlertCondition is the Schema for the nrqlalertconditions 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: NrqlAlertConditionSpec defines the desired state of NrqlAlertCondition + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: + description: NrqlAlertCondition is the Schema for the nrqlalertconditions API properties: - api_key: + 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 - api_key_secret: - properties: - key_name: - type: string - name: - type: string - namespace: - type: string - type: object - enabled: - type: boolean - existing_policy_id: - type: integer - expected_groups: - type: integer - id: - type: integer - ignore_overlap: - type: boolean - name: + 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 - nrql: - description: NrqlQuery represents a NRQL query to use with a NRQL alert - condition - properties: - query: - type: string - since_value: - type: string + metadata: type: object - region: - type: string - runbook_url: - type: string - terms: - items: - description: AlertConditionTerm represents the terms of a New Relic - alert condition. - properties: - duration: - type: string - operator: - type: string - priority: - type: string - threshold: - type: string - time_function: - type: string - violation_close_timer: - type: integer - required: - - threshold - type: object - type: array - type: - type: string - value_function: - type: string - violation_time_limit_seconds: - type: integer - required: - - enabled - type: object - status: - description: NrqlAlertConditionStatus defines the observed state of NrqlAlertCondition - properties: - applied_spec: + spec: description: NrqlAlertConditionSpec defines the desired state of NrqlAlertCondition properties: api_key: @@ -135,8 +62,8 @@ spec: name: type: string nrql: - description: NrqlQuery represents a NRQL query to use with a NRQL - alert condition + description: NrqlQuery represents a NRQL query to use with a NRQL alert + condition properties: query: type: string @@ -149,8 +76,8 @@ spec: type: string terms: items: - description: AlertConditionTerm represents the terms of a New - Relic alert condition. + description: AlertConditionTerm represents the terms of a New Relic + alert condition. properties: duration: type: string @@ -177,18 +104,89 @@ spec: required: - enabled type: object - condition_id: - type: integer - required: - - applied_spec - - condition_id + status: + description: NrqlAlertConditionStatus defines the observed state of NrqlAlertCondition + properties: + applied_spec: + description: NrqlAlertConditionSpec defines the desired state of NrqlAlertCondition + properties: + api_key: + type: string + api_key_secret: + properties: + key_name: + type: string + name: + type: string + namespace: + type: string + type: object + enabled: + type: boolean + existing_policy_id: + type: integer + expected_groups: + type: integer + id: + type: integer + ignore_overlap: + type: boolean + name: + type: string + nrql: + description: NrqlQuery represents a NRQL query to use with a NRQL + alert condition + properties: + query: + type: string + since_value: + type: string + type: object + region: + type: string + runbook_url: + type: string + terms: + items: + description: AlertConditionTerm represents the terms of a New + Relic alert condition. + properties: + duration: + type: string + operator: + type: string + priority: + type: string + threshold: + type: string + time_function: + type: string + violation_close_timer: + type: integer + required: + - threshold + type: object + type: array + type: + type: string + value_function: + type: string + violation_time_limit_seconds: + type: integer + required: + - enabled + type: object + condition_id: + type: integer + required: + - applied_spec + - condition_id + type: object type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true + additionalPrinterColumns: + - name: Created + type: boolean + jsonPath: .status.created status: acceptedNames: kind: "" diff --git a/config/crd/bases/nr.k8s.newrelic.com_policies.yaml b/config/crd/bases/nr.k8s.newrelic.com_policies.yaml index cd8514f..3d201cd 100644 --- a/config/crd/bases/nr.k8s.newrelic.com_policies.yaml +++ b/config/crd/bases/nr.k8s.newrelic.com_policies.yaml @@ -1,6 +1,6 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: @@ -15,156 +15,27 @@ spec: plural: policies singular: policy scope: Namespaced - validation: - openAPIV3Schema: - description: Policy is the Schema for the policies 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: PolicySpec defines the desired state of Policy + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: + description: Policy is the Schema for the policies API properties: - api_key: + 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 - api_key_secret: - properties: - key_name: - type: string - name: - type: string - namespace: - type: string - type: object - conditions: - items: - description: PolicyCondition defined the conditions contained within - a a policy - properties: - name: - type: string - namespace: - type: string - spec: - description: ConditionSpec - Merged superset of Condition types - properties: - api_key: - type: string - api_key_secret: - properties: - key_name: - type: string - name: - type: string - namespace: - type: string - type: object - condition_scope: - type: string - enabled: - type: boolean - entities: - items: - type: string - type: array - existing_policy_id: - type: integer - expected_groups: - type: integer - gc_metric: - type: string - id: - type: integer - ignore_overlap: - type: boolean - metric: - type: string - name: - type: string - nrql: - description: NrqlQuery represents a NRQL query to use with - a NRQL alert condition - properties: - query: - type: string - since_value: - type: string - type: object - region: - type: string - runbook_url: - type: string - terms: - items: - description: AlertConditionTerm represents the terms of - a New Relic alert condition. - properties: - duration: - type: string - operator: - type: string - priority: - type: string - threshold: - type: string - time_function: - type: string - violation_close_timer: - type: integer - required: - - threshold - type: object - type: array - type: - type: string - user_defined: - description: ConditionUserDefined represents user defined - metrics for the New Relic alert condition. - properties: - metric: - type: string - value_function: - description: ValueFunctionType specifies the value function - to be used for returning custom metric data. - type: string - type: object - value_function: - type: string - violation_close_timer: - type: integer - violation_time_limit_seconds: - type: integer - required: - - enabled - type: object - required: - - name - - namespace - type: object - type: array - incident_preference: - type: string - name: - type: string - region: + 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 - required: - - name - - region - type: object - status: - description: PolicyStatus defines the observed state of Policy - properties: - applied_spec: + metadata: + type: object + spec: description: PolicySpec defines the desired state of Policy properties: api_key: @@ -180,16 +51,15 @@ spec: type: object conditions: items: - description: PolicyCondition defined the conditions contained - within a a policy + description: PolicyCondition defined the conditions contained within + a a policy properties: name: type: string namespace: type: string spec: - description: ConditionSpec - Merged superset of Condition - types + description: ConditionSpec - Merged superset of Condition types properties: api_key: type: string @@ -225,8 +95,8 @@ spec: name: type: string nrql: - description: NrqlQuery represents a NRQL query to use - with a NRQL alert condition + description: NrqlQuery represents a NRQL query to use with + a NRQL alert condition properties: query: type: string @@ -239,8 +109,8 @@ spec: type: string terms: items: - description: AlertConditionTerm represents the terms - of a New Relic alert condition. + description: AlertConditionTerm represents the terms of + a New Relic alert condition. properties: duration: type: string @@ -267,9 +137,8 @@ spec: metric: type: string value_function: - description: ValueFunctionType specifies the value - function to be used for returning custom metric - data. + description: ValueFunctionType specifies the value function + to be used for returning custom metric data. type: string type: object value_function: @@ -296,18 +165,148 @@ spec: - name - region type: object - policy_id: - type: integer - required: - - applied_spec - - policy_id - type: object - type: object - version: v1 - versions: - - name: v1 - served: true - storage: true + status: + description: PolicyStatus defines the observed state of Policy + properties: + applied_spec: + description: PolicySpec defines the desired state of Policy + properties: + api_key: + type: string + api_key_secret: + properties: + key_name: + type: string + name: + type: string + namespace: + type: string + type: object + conditions: + items: + description: PolicyCondition defined the conditions contained + within a a policy + properties: + name: + type: string + namespace: + type: string + spec: + description: ConditionSpec - Merged superset of Condition + types + properties: + api_key: + type: string + api_key_secret: + properties: + key_name: + type: string + name: + type: string + namespace: + type: string + type: object + condition_scope: + type: string + enabled: + type: boolean + entities: + items: + type: string + type: array + existing_policy_id: + type: integer + expected_groups: + type: integer + gc_metric: + type: string + id: + type: integer + ignore_overlap: + type: boolean + metric: + type: string + name: + type: string + nrql: + description: NrqlQuery represents a NRQL query to use + with a NRQL alert condition + properties: + query: + type: string + since_value: + type: string + type: object + region: + type: string + runbook_url: + type: string + terms: + items: + description: AlertConditionTerm represents the terms + of a New Relic alert condition. + properties: + duration: + type: string + operator: + type: string + priority: + type: string + threshold: + type: string + time_function: + type: string + violation_close_timer: + type: integer + required: + - threshold + type: object + type: array + type: + type: string + user_defined: + description: ConditionUserDefined represents user defined + metrics for the New Relic alert condition. + properties: + metric: + type: string + value_function: + description: ValueFunctionType specifies the value + function to be used for returning custom metric + data. + type: string + type: object + value_function: + type: string + violation_close_timer: + type: integer + violation_time_limit_seconds: + type: integer + required: + - enabled + type: object + required: + - name + - namespace + type: object + type: array + incident_preference: + type: string + name: + type: string + region: + type: string + required: + - name + - region + type: object + policy_id: + type: integer + required: + - applied_spec + - policy_id + type: object + type: object status: acceptedNames: kind: "" diff --git a/config/crd/patches/cainjection_in_alertsapmconditions.yaml b/config/crd/patches/cainjection_in_alertsapmconditions.yaml index 32ba17e..d8d1d00 100644 --- a/config/crd/patches/cainjection_in_alertsapmconditions.yaml +++ b/config/crd/patches/cainjection_in_alertsapmconditions.yaml @@ -1,6 +1,6 @@ # The following patch adds a directive for certmanager to inject CA into the CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: diff --git a/config/crd/patches/cainjection_in_alertschannels.yaml b/config/crd/patches/cainjection_in_alertschannels.yaml index ccc8ce2..779afd4 100644 --- a/config/crd/patches/cainjection_in_alertschannels.yaml +++ b/config/crd/patches/cainjection_in_alertschannels.yaml @@ -1,6 +1,6 @@ # The following patch adds a directive for certmanager to inject CA into the CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: diff --git a/config/crd/patches/cainjection_in_alertsnrqlconditions.yaml b/config/crd/patches/cainjection_in_alertsnrqlconditions.yaml index 6e122b4..abf18d6 100644 --- a/config/crd/patches/cainjection_in_alertsnrqlconditions.yaml +++ b/config/crd/patches/cainjection_in_alertsnrqlconditions.yaml @@ -1,6 +1,6 @@ # The following patch adds a directive for certmanager to inject CA into the CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: diff --git a/config/crd/patches/cainjection_in_alertspolicies.yaml b/config/crd/patches/cainjection_in_alertspolicies.yaml index cbc5a46..b9fd153 100644 --- a/config/crd/patches/cainjection_in_alertspolicies.yaml +++ b/config/crd/patches/cainjection_in_alertspolicies.yaml @@ -1,6 +1,6 @@ # The following patch adds a directive for certmanager to inject CA into the CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: diff --git a/config/crd/patches/cainjection_in_apmalertconditions.yaml b/config/crd/patches/cainjection_in_apmalertconditions.yaml index 7b0bab2..11a2371 100644 --- a/config/crd/patches/cainjection_in_apmalertconditions.yaml +++ b/config/crd/patches/cainjection_in_apmalertconditions.yaml @@ -1,6 +1,6 @@ # The following patch adds a directive for certmanager to inject CA into the CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: diff --git a/config/crd/patches/cainjection_in_newrelicpolicies.yaml b/config/crd/patches/cainjection_in_newrelicpolicies.yaml index a4896cd..85cde1b 100644 --- a/config/crd/patches/cainjection_in_newrelicpolicies.yaml +++ b/config/crd/patches/cainjection_in_newrelicpolicies.yaml @@ -1,6 +1,6 @@ # The following patch adds a directive for certmanager to inject CA into the CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: diff --git a/config/crd/patches/cainjection_in_nrqlalertconditions.yaml b/config/crd/patches/cainjection_in_nrqlalertconditions.yaml index f6b11ae..03d3256 100644 --- a/config/crd/patches/cainjection_in_nrqlalertconditions.yaml +++ b/config/crd/patches/cainjection_in_nrqlalertconditions.yaml @@ -1,6 +1,6 @@ # The following patch adds a directive for certmanager to inject CA into the CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: diff --git a/config/crd/patches/webhook_in_alertsapmconditions.yaml b/config/crd/patches/webhook_in_alertsapmconditions.yaml index 71beaa8..c2b53c1 100644 --- a/config/crd/patches/webhook_in_alertsapmconditions.yaml +++ b/config/crd/patches/webhook_in_alertsapmconditions.yaml @@ -1,6 +1,6 @@ # The following patch enables conversion webhook for CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: alertsapmconditions.nr.k8s.newrelic.com diff --git a/config/crd/patches/webhook_in_alertschannels.yaml b/config/crd/patches/webhook_in_alertschannels.yaml index 0c45cef..31d767a 100644 --- a/config/crd/patches/webhook_in_alertschannels.yaml +++ b/config/crd/patches/webhook_in_alertschannels.yaml @@ -1,6 +1,6 @@ # The following patch enables conversion webhook for CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: alertschannels.nr.k8s.newrelic.com diff --git a/config/crd/patches/webhook_in_alertsnrqlconditions.yaml b/config/crd/patches/webhook_in_alertsnrqlconditions.yaml index 8bb0eec..8be8606 100644 --- a/config/crd/patches/webhook_in_alertsnrqlconditions.yaml +++ b/config/crd/patches/webhook_in_alertsnrqlconditions.yaml @@ -1,6 +1,6 @@ # The following patch enables conversion webhook for CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: alertsnrqlconditions.nr.k8s.newrelic.com diff --git a/config/crd/patches/webhook_in_alertspolicies.yaml b/config/crd/patches/webhook_in_alertspolicies.yaml index 763bed6..0c9f707 100644 --- a/config/crd/patches/webhook_in_alertspolicies.yaml +++ b/config/crd/patches/webhook_in_alertspolicies.yaml @@ -1,6 +1,6 @@ # The following patch enables conversion webhook for CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: alertspolicies.nr.k8s.newrelic.com diff --git a/config/crd/patches/webhook_in_apmalertconditions.yaml b/config/crd/patches/webhook_in_apmalertconditions.yaml index 521e71d..86c012b 100644 --- a/config/crd/patches/webhook_in_apmalertconditions.yaml +++ b/config/crd/patches/webhook_in_apmalertconditions.yaml @@ -1,6 +1,6 @@ # The following patch enables conversion webhook for CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: apmalertconditions.nr.k8s.newrelic.com diff --git a/config/crd/patches/webhook_in_newrelicpolicies.yaml b/config/crd/patches/webhook_in_newrelicpolicies.yaml index 8f4e304..a0044d2 100644 --- a/config/crd/patches/webhook_in_newrelicpolicies.yaml +++ b/config/crd/patches/webhook_in_newrelicpolicies.yaml @@ -1,6 +1,6 @@ # The following patch enables conversion webhook for CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: policies.nr.k8s.newrelic.com diff --git a/config/crd/patches/webhook_in_nrqlalertconditions.yaml b/config/crd/patches/webhook_in_nrqlalertconditions.yaml index 5f04319..a42fe31 100644 --- a/config/crd/patches/webhook_in_nrqlalertconditions.yaml +++ b/config/crd/patches/webhook_in_nrqlalertconditions.yaml @@ -1,6 +1,6 @@ # The following patch enables conversion webhook for CRD # CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: nrqlalertconditions.nr.k8s.newrelic.com diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 244dfc6..2752b33 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -50,7 +50,7 @@ vars: objref: kind: Certificate group: cert-manager.io - version: v1alpha2 + version: v1 name: serving-cert # this name should match the one in certificate.yaml fieldref: fieldpath: metadata.namespace @@ -58,7 +58,7 @@ vars: objref: kind: Certificate group: cert-manager.io - version: v1alpha2 + version: v1 name: serving-cert # this name should match the one in certificate.yaml - name: SERVICE_NAMESPACE # namespace of the service objref: diff --git a/config/default/webhookcainjection_patch.yaml b/config/default/webhookcainjection_patch.yaml index 7e79bf9..02ab515 100644 --- a/config/default/webhookcainjection_patch.yaml +++ b/config/default/webhookcainjection_patch.yaml @@ -1,13 +1,13 @@ # This patch add annotation to admission webhook config and # the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize. -apiVersion: admissionregistration.k8s.io/v1beta1 +apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration metadata: name: mutating-webhook-configuration annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) --- -apiVersion: admissionregistration.k8s.io/v1beta1 +apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: name: validating-webhook-configuration diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index f04ff75..b73700d 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -1,6 +1,6 @@ --- -apiVersion: admissionregistration.k8s.io/v1beta1 +apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration metadata: creationTimestamp: null @@ -14,6 +14,8 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-alertsapmcondition failurePolicy: Fail name: malertsapmcondition.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -33,6 +35,8 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-alertsnrqlcondition failurePolicy: Fail name: malertsnrqlcondition.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -52,6 +56,8 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-alertspolicy failurePolicy: Fail name: malertspolicy.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -71,6 +77,8 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-alertschannel failurePolicy: Fail name: malertschannel.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -89,6 +97,8 @@ webhooks: namespace: system path: /mutate-nr-k8s-newrelic-com-v1-apmalertcondition failurePolicy: Fail + admissionReviewVersions: + - v1 name: mapmalertcondition.kb.io rules: - apiGroups: @@ -109,6 +119,8 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-nrqlalertcondition failurePolicy: Fail name: mnrqlalertcondition.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -128,6 +140,8 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-policy failurePolicy: Fail name: mpolicy.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -141,7 +155,7 @@ webhooks: sideEffects: None --- -apiVersion: admissionregistration.k8s.io/v1beta1 +apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: creationTimestamp: null @@ -155,6 +169,8 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-alertsapmcondition failurePolicy: Fail name: valertsapmcondition.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -174,6 +190,8 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-alertsnrqlcondition failurePolicy: Fail name: valertsnrqlcondition.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -193,6 +211,8 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-alertspolicy failurePolicy: Fail name: valertspolicy.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -212,6 +232,8 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-alertschannel failurePolicy: Fail name: valertschannel.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -231,6 +253,8 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-apmalertcondition failurePolicy: Fail name: vapmalertcondition.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -250,6 +274,8 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-nrqlalertcondition failurePolicy: Fail name: vnrqlalertcondition.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com @@ -269,6 +295,8 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-policy failurePolicy: Fail name: vpolicy.kb.io + admissionReviewVersions: + - v1 rules: - apiGroups: - nr.k8s.newrelic.com From a058315b3b7c0ccc737799537e61026ceac48f9b Mon Sep 17 00:00:00 2001 From: Kalvis Kuskis <44435644+kalvkusk@users.noreply.github.com> Date: Fri, 8 Sep 2023 21:43:07 +0300 Subject: [PATCH 2/2] fix admission hooks --- config/webhook/manifests.yaml | 42 ++++++++++++----------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index b73700d..65f8675 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -14,8 +14,7 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-alertsapmcondition failurePolicy: Fail name: malertsapmcondition.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -35,8 +34,7 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-alertsnrqlcondition failurePolicy: Fail name: malertsnrqlcondition.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -56,8 +54,7 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-alertspolicy failurePolicy: Fail name: malertspolicy.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -77,8 +74,7 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-alertschannel failurePolicy: Fail name: malertschannel.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -97,8 +93,7 @@ webhooks: namespace: system path: /mutate-nr-k8s-newrelic-com-v1-apmalertcondition failurePolicy: Fail - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] name: mapmalertcondition.kb.io rules: - apiGroups: @@ -119,8 +114,7 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-nrqlalertcondition failurePolicy: Fail name: mnrqlalertcondition.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -140,8 +134,7 @@ webhooks: path: /mutate-nr-k8s-newrelic-com-v1-policy failurePolicy: Fail name: mpolicy.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -169,8 +162,7 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-alertsapmcondition failurePolicy: Fail name: valertsapmcondition.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -190,8 +182,7 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-alertsnrqlcondition failurePolicy: Fail name: valertsnrqlcondition.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -211,8 +202,7 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-alertspolicy failurePolicy: Fail name: valertspolicy.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -232,8 +222,7 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-alertschannel failurePolicy: Fail name: valertschannel.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -253,8 +242,7 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-apmalertcondition failurePolicy: Fail name: vapmalertcondition.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -274,8 +262,7 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-nrqlalertcondition failurePolicy: Fail name: vnrqlalertcondition.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com @@ -295,8 +282,7 @@ webhooks: path: /validate-nr-k8s-newrelic-com-v1-policy failurePolicy: Fail name: vpolicy.kb.io - admissionReviewVersions: - - v1 + admissionReviewVersions: ["v1beta1"] rules: - apiGroups: - nr.k8s.newrelic.com