Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update(CRD): Fixing wrong CRD doc + adding more information #2327

Merged
merged 5 commits into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

| 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.

Check failure on line 36 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L36

[Google.Spacing] 's. P' should have one space.
Raw output
{"message": "[Google.Spacing] 's. P' should have one space.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 36, "column": 118}}}, "severity": "ERROR"}

Check failure on line 36 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L36

[Google.Spacing] 'n. P' should have one space.
Raw output
{"message": "[Google.Spacing] 'n. P' should have one space.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 36, "column": 184}}}, "severity": "ERROR"}

## Previous Configuration (before upgrade)

Check warning on line 38 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L38

[Google.Headings] 'Previous Configuration (before upgrade)' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Previous Configuration (before upgrade)' should use sentence-style capitalization.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 38, "column": 4}}}, "severity": "WARNING"}

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)

Check warning on line 49 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L49

[Google.Headings] 'New Configuration (after upgrade)' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'New Configuration (after upgrade)' should use sentence-style capitalization.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 49, "column": 4}}}, "severity": "WARNING"}

In version higher than 2.0.4 the configuration for custom resources has changed. You will need to update your configuration as shown below:

Check warning on line 51 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L51

[Google.Will] Avoid using ' will '.
Raw output
{"message": "[Google.Will] Avoid using ' will '.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 51, "column": 85}}}, "severity": "WARNING"}
```yaml
kind:
- name: Foo.example.com
status:
stable:
conditions:
```

### Action Required:

Check warning on line 60 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L60

[Google.Headings] 'Action Required:' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Action Required:' should use sentence-style capitalization.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 60, "column": 5}}}, "severity": "WARNING"}
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 @@
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 @@
- 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 @@

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

Check warning on line 317 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L317

[Google.Headings] 'Example 1.2: Global config for all Custom Resources' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Example 1.2: Global config for all Custom Resources' should use sentence-style capitalization.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 317, "column": 6}}}, "severity": "WARNING"}

```yaml
spinnaker:
Expand All @@ -294,9 +323,6 @@
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 @@
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.

Check warning on line 355 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L355

[Google.Will] Avoid using ' will '.
Raw output
{"message": "[Google.Will] Avoid using ' will '.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 355, "column": 205}}}, "severity": "WARNING"}

Check warning on line 355 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L355

[Google.Will] Avoid using ' will '.
Raw output
{"message": "[Google.Will] Avoid using ' will '.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 355, "column": 346}}}, "severity": "WARNING"}

### Example 2: Custom Resource with Non-Standard status fields

Expand Down Expand Up @@ -381,7 +407,7 @@

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

Check warning on line 410 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L410

[Google.Headings] 'Example 2.2: Global config for all Custom Resources' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Example 2.2: Global config for all Custom Resources' should use sentence-style capitalization.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 410, "column": 6}}}, "severity": "WARNING"}

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

Check warning on line 439 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L439

[Google.Will] Avoid using ' will '.
Raw output
{"message": "[Google.Will] Avoid using ' will '.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 439, "column": 205}}}, "severity": "WARNING"}

Check warning on line 439 in content/en/plugins/plugin-k8s-custom-resource-status.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/plugins/plugin-k8s-custom-resource-status.md#L439

[Google.Will] Avoid using ' will '.
Raw output
{"message": "[Google.Will] Avoid using ' will '.", "location": {"path": "content/en/plugins/plugin-k8s-custom-resource-status.md", "range": {"start": {"line": 439, "column": 346}}}, "severity": "WARNING"}

## Release Notes

Expand All @@ -423,8 +445,13 @@
* 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
Loading