From 1692cfc2e63d6e5b6f6ea88fd06ec582985ba85b Mon Sep 17 00:00:00 2001 From: Shlomo Daari <104773977+shlomodaari@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:55:02 -0800 Subject: [PATCH] Update(CRD): Fixing wrong CRD doc + adding more information (#2327) * Update plugin-k8s-custom-resource-status.md * Update plugin-k8s-custom-resource-status.md * Update plugin-k8s-custom-resource-status.md * Update plugin-k8s-custom-resource-status.md * Update plugin-k8s-custom-resource-status.md --- .../plugin-k8s-custom-resource-status.md | 65 +++++++++++++------ 1 file changed, 46 insertions(+), 19 deletions(-) diff --git a/content/en/plugins/plugin-k8s-custom-resource-status.md b/content/en/plugins/plugin-k8s-custom-resource-status.md index 0a179d6bba..287cce4d64 100644 --- a/content/en/plugins/plugin-k8s-custom-resource-status.md +++ b/content/en/plugins/plugin-k8s-custom-resource-status.md @@ -28,16 +28,46 @@ These replica checks are enabled by default and do not require additional config | Armory CD (Spinnaker) Version | Plugin Version | |:------------------------------|:--------------------------| -| 2.30.x (1.30.x) | 3.1.x
3.0.x | -| 2.28.0 - 2.28.6 (1.28.x) | 2.1.x
2.0.0 - 2.0.2 | -| 2.27.x (1.27.x) | 1.0.0 | +| 2.34.x (1.30.x) | 3.1.4 | +| 2.30 - 2.32 (1.28.x) | 2.0.5. | + +## Breaking change in versions higher than 2.0.4 + +**Important**: A config change was introduced to support api groups on Kubernetes kind types to handle duplicate names. Please update your config to match the documented configuration. Previous configurations and versions are no longer supported. + +## Previous Configuration (before upgrade) + +In versions prior to 2.0.5, your configuration for custom resources would look like this: + +```yaml +kind: + Foo: + stable: + conditions: +``` + +## New Configuration (after upgrade) + +In version higher than 2.0.4 the configuration for custom resources has changed. You will need to update your configuration as shown below: +```yaml +kind: + - name: Foo.example.com + status: + stable: + conditions: +``` + +### Action Required: +To avoid issues with your deployment, you must update your configuration to reflect these changes: + +For each custom resource in your configuration, update the kind and status sections according to the new format shown above. +Ensure that the kind corresponds to the correct APIGROUP based on your manifest. ## Configuration Put the plugin configuration in the `spec.spinnakerConfig.profiles.clouddriver` section of your Operator `spinnakerservice.yml`: -{{< highlight yaml "linenos=table,hl_lines=5-14">}} -... (omitted for brevity) +```yaml spec: spinnakerConfig: profiles: @@ -51,7 +81,7 @@ spec: repositories: pluginRepository: url: https://raw.githubusercontent.com/armory-plugins/pluginRepository/master/repositories.json -{{< /highlight >}} +``` * `version`: The plugin version that corresponds to your Armory CD version. @@ -103,8 +133,7 @@ spinnaker: - field1: value1 field2: value2 - item2: valueX - - name: Bar.example.com # The name of your Custom Resource including API group - status: + status: # Global config stable: markAsUnavailableUntilStable: false # optional failIfNoMatch: false # optional @@ -285,7 +314,7 @@ spinnaker: These properties are only for `Foo` kind. Every time you deploy `Foo`, the plugin compares the resource status values against these properties. In this case, the plugin marks the deployment as unavailable since it matches your custom resource. -#### Example 1.2: Config for all Custom Resources +#### Example 1.2: Global config for all Custom Resources ```yaml spinnaker: @@ -294,9 +323,6 @@ spinnaker: Armory.K8sCustomResourceStatus: enabled: true config: - kind: - - name: Foo.example.com - - name: Bar.example.com status: stable: conditions: @@ -326,7 +352,7 @@ spinnaker: type: Reconciling ``` -These properties apply to all custom resource kinds you deploy, `Foo` and `Bar` in this case. If you deploy different kinds with different statuses, you should declare per kind like in `Example 1.1`. In this case, the plugin marks the deployment as unavailable since that matches your custom resource. +These properties apply to all custom resource kinds deployed through Spinnaker. If you deploy different kinds with various statuses and haven't configured properties specifically for each kind, the plugin will compare the resource status values against the global properties. In such cases, if the status matches your custom resource, the plugin will mark the deployment accordingly. To ensure specific handling, you should declare properties per kind, as shown in Example 1.1. ### Example 2: Custom Resource with Non-Standard status fields @@ -381,7 +407,7 @@ spinnaker: These properties are only for `Foo` kind. Every time you deploy `Foo`, it compares the resource status values against these properties. In this case, the plugin marks the deployment as ready since that matches your custom resource. -#### Example 2.2: Config for all Custom Resources +#### Example 2.2: Global config for all Custom Resources ```yaml spinnaker: @@ -390,9 +416,6 @@ spinnaker: Armory.K8sCustomResourceStatus: enabled: true config: - kind: - - name: Foo.example.com - - name: Bar.example.com status: stable: fields: @@ -413,8 +436,7 @@ spinnaker: status.collisionCount: 0 ``` -These properties apply to all custom resource kinds you deploy, `Foo` and `Bar` in this case. If you deploy different kinds with different statuses, you should declare per kind like in `Example 2.1`. In this case, the plugin marks the deployment as ready since that -matches your custom resource. +These properties apply to all custom resource kinds deployed through Spinnaker. If you deploy different kinds with various statuses and haven't configured properties specifically for each kind, the plugin will compare the resource status values against the global properties. In such cases, if the status matches your custom resource, the plugin will mark the deployment accordingly. To ensure specific handling, you should declare properties per kind, as shown in Example 2.1. ## Release Notes @@ -423,8 +445,13 @@ matches your custom resource. * v2.0.1 Bug fixes - 10/14/2022 * v2.0.2 Bug fixes - 05/20/2023 * v2.0.3 Adds support with Armory Scale Agent - 06/15/2023 +* v2.0.4 Fixing Dockerfile with proper permissions +* v2.0.5 support api groups on Kubernetes kind types * v2.1.0 Fixes a bug when using partial conditions - 11/07/2023 * v2.2.0 Fixes a bug when the service account has permissions to fetch CRD metadata. Changes configuration format to prevent potential conflicts arising from similar kind names offered by various providers - 10/10/2023 * v3.0.0 Bug fixes: returning stable if fields values match. Compatibility to Spinnaker 1.30.x (Armory 2.30.x) - 08/31/2023 * v3.0.1 Fixes a bug when using partial conditions - 09/07/2023 * v3.1.0 Fixes a bug when the service account has permissions to fetch CRD metadata. Changes configuration format to prevent potential conflicts arising from similar kind names offered by various providers - 10/10/2023 +* v3.1.1 fix a bug - default checking condition +* v3.1.3 Fixing Dockerfile with proper permissions +* v3.1.4 Fixing test - add parameter name explicitly