Skip to content

Commit

Permalink
Update(CRD): Fixing wrong CRD doc + adding more information (#2327)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
shlomodaari authored Jan 16, 2025
1 parent c2c4f44 commit 1692cfc
Showing 1 changed file with 46 additions and 19 deletions.
65 changes: 46 additions & 19 deletions content/en/plugins/plugin-k8s-custom-resource-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <br/> 3.0.x |
| 2.28.0 - 2.28.6 (1.28.x) | 2.1.x <br/> 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:
Expand All @@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -294,9 +323,6 @@ spinnaker:
Armory.K8sCustomResourceStatus:
enabled: true
config:
kind:
- name: Foo.example.com
- name: Bar.example.com
status:
stable:
conditions:
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -390,9 +416,6 @@ spinnaker:
Armory.K8sCustomResourceStatus:
enabled: true
config:
kind:
- name: Foo.example.com
- name: Bar.example.com
status:
stable:
fields:
Expand All @@ -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

Expand All @@ -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

0 comments on commit 1692cfc

Please sign in to comment.