-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add validatedpatterns/patterns-operator
Signed-off-by: Sebastian Hoß <[email protected]>
- Loading branch information
Showing
7 changed files
with
374 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
198 changes: 198 additions & 0 deletions
198
...alidatedpatterns/patterns-operator/gitops.hybrid-cloud-patterns.io/v1alpha1/patterns.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.11.4 | ||
name: patterns.gitops.hybrid-cloud-patterns.io | ||
spec: | ||
group: gitops.hybrid-cloud-patterns.io | ||
names: | ||
kind: Pattern | ||
listKind: PatternList | ||
plural: patterns | ||
shortNames: | ||
- patt | ||
singular: pattern | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- jsonPath: .status.lastStep | ||
name: Step | ||
priority: 1 | ||
type: string | ||
- jsonPath: .status.lastError | ||
name: Error | ||
priority: 2 | ||
type: string | ||
name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: Pattern is the Schema for the patterns 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: PatternSpec defines the desired state of Pattern | ||
properties: | ||
analyticsUUID: | ||
description: Analytics UUID. Leave empty to autogenerate a random one. Not PII information | ||
type: string | ||
clusterGroupName: | ||
type: string | ||
extraParameters: | ||
description: '.Name is dot separated per the helm --set syntax, such as: global.something.field' | ||
items: | ||
properties: | ||
name: | ||
type: string | ||
value: | ||
type: string | ||
required: | ||
- name | ||
- value | ||
type: object | ||
type: array | ||
extraValueFiles: | ||
description: URLs to additional Helm parameter files | ||
items: | ||
type: string | ||
type: array | ||
gitOpsSpec: | ||
properties: | ||
manualSync: | ||
description: 'Require manual intervention before Argo will sync new content. Default: False' | ||
type: boolean | ||
type: object | ||
gitSpec: | ||
properties: | ||
hostname: | ||
description: Optional. FQDN of the git server if automatic parsing from TargetRepo is broken | ||
type: string | ||
originRepo: | ||
description: Upstream git repo containing the pattern to deploy. Used when in-cluster fork to point to the upstream pattern repository | ||
type: string | ||
originRevision: | ||
description: Branch, tag or commit in the upstream git repository. Does not support short-sha's. Default to HEAD | ||
type: string | ||
pollInterval: | ||
default: 180 | ||
description: 'Interval in seconds to poll for drifts between origin and target repositories. Default: 180 seconds' | ||
type: integer | ||
targetRepo: | ||
description: Git repo containing the pattern to deploy. Must use https/http | ||
type: string | ||
targetRevision: | ||
description: 'Branch, tag, or commit to deploy. Does not support short-sha''s. Default: HEAD' | ||
type: string | ||
required: | ||
- targetRepo | ||
type: object | ||
multiSourceConfig: | ||
properties: | ||
clusterGroupChartGitRevision: | ||
default: main | ||
description: The git reference when deploying the clustergroup helm chart directly from a git repo Defaults to 'main'. (Only used when developing the clustergroup helm chart) | ||
type: string | ||
clusterGroupChartVersion: | ||
default: 0.0.* | ||
description: Which chart version for the clustergroup helm chart Defaults to "0.0.*" | ||
type: string | ||
clusterGroupGitRepoUrl: | ||
description: The url when deploying the clustergroup helm chart directly from a git repo Defaults to '' which means not used (Only used when developing the clustergroup helm chart) | ||
type: string | ||
enabled: | ||
default: true | ||
description: (EXPERIMENTAL) Enable multi-source support when deploying the clustergroup argo application | ||
type: boolean | ||
helmRepoUrl: | ||
default: https://charts.validatedpatterns.io/ | ||
description: The helm chart url to fetch the helm charts from in order to deploy the pattern Defaults to https://charts.validatedpatterns.io/ | ||
type: string | ||
type: object | ||
required: | ||
- clusterGroupName | ||
- gitSpec | ||
type: object | ||
status: | ||
description: PatternStatus defines the observed state of Pattern | ||
properties: | ||
analyticsSent: | ||
default: 0 | ||
type: integer | ||
analyticsUUID: | ||
type: string | ||
appClusterDomain: | ||
type: string | ||
applications: | ||
items: | ||
description: PatternApplicationInfo defines the Applications Status for the Pattern. This structure is part of the PatternStatus as an array The Application Status will be included as part of the Observed state of Pattern | ||
properties: | ||
healthMessage: | ||
type: string | ||
healthStatus: | ||
type: string | ||
name: | ||
type: string | ||
namespace: | ||
type: string | ||
syncStatus: | ||
type: string | ||
type: object | ||
type: array | ||
clusterDomain: | ||
type: string | ||
clusterID: | ||
type: string | ||
clusterName: | ||
type: string | ||
clusterPlatform: | ||
type: string | ||
clusterVersion: | ||
type: string | ||
conditions: | ||
items: | ||
properties: | ||
lastTransitionTime: | ||
description: Last time the condition transitioned from one status to another. | ||
format: date-time | ||
type: string | ||
lastUpdateTime: | ||
description: The last time this condition was updated. | ||
format: date-time | ||
type: string | ||
message: | ||
description: A human readable message indicating details about the transition. | ||
type: string | ||
status: | ||
description: Status of the condition, one of True, False, Unknown. | ||
type: string | ||
type: | ||
description: Type of deployment condition. | ||
type: string | ||
required: | ||
- lastUpdateTime | ||
- status | ||
- type | ||
type: object | ||
type: array | ||
lastError: | ||
description: Last error encountered by the pattern | ||
type: string | ||
lastStep: | ||
description: Last action related to the pattern | ||
type: string | ||
version: | ||
description: Number of updates to the pattern | ||
type: integer | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
kube-custom-resources-rs/src/gitops_hybrid_cloud_patterns_io_v1alpha1/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod patterns; |
154 changes: 154 additions & 0 deletions
154
kube-custom-resources-rs/src/gitops_hybrid_cloud_patterns_io_v1alpha1/patterns.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
// WARNING: generated by kopium - manual changes will be overwritten | ||
// kopium command: kopium --docs --filename=./crd-catalog/validatedpatterns/patterns-operator/gitops.hybrid-cloud-patterns.io/v1alpha1/patterns.yaml --derive=Default --derive=PartialEq | ||
// kopium version: 0.16.2 | ||
|
||
use kube::CustomResource; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
/// PatternSpec defines the desired state of Pattern | ||
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] | ||
#[kube(group = "gitops.hybrid-cloud-patterns.io", version = "v1alpha1", kind = "Pattern", plural = "patterns")] | ||
#[kube(namespaced)] | ||
#[kube(status = "PatternStatus")] | ||
#[kube(schema = "disabled")] | ||
pub struct PatternSpec { | ||
/// Analytics UUID. Leave empty to autogenerate a random one. Not PII information | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "analyticsUUID")] | ||
pub analytics_uuid: Option<String>, | ||
#[serde(rename = "clusterGroupName")] | ||
pub cluster_group_name: String, | ||
/// .Name is dot separated per the helm --set syntax, such as: global.something.field | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "extraParameters")] | ||
pub extra_parameters: Option<Vec<PatternExtraParameters>>, | ||
/// URLs to additional Helm parameter files | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "extraValueFiles")] | ||
pub extra_value_files: Option<Vec<String>>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "gitOpsSpec")] | ||
pub git_ops_spec: Option<PatternGitOpsSpec>, | ||
#[serde(rename = "gitSpec")] | ||
pub git_spec: PatternGitSpec, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "multiSourceConfig")] | ||
pub multi_source_config: Option<PatternMultiSourceConfig>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] | ||
pub struct PatternExtraParameters { | ||
pub name: String, | ||
pub value: String, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] | ||
pub struct PatternGitOpsSpec { | ||
/// Require manual intervention before Argo will sync new content. Default: False | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "manualSync")] | ||
pub manual_sync: Option<bool>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] | ||
pub struct PatternGitSpec { | ||
/// Optional. FQDN of the git server if automatic parsing from TargetRepo is broken | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub hostname: Option<String>, | ||
/// Upstream git repo containing the pattern to deploy. Used when in-cluster fork to point to the upstream pattern repository | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "originRepo")] | ||
pub origin_repo: Option<String>, | ||
/// Branch, tag or commit in the upstream git repository. Does not support short-sha's. Default to HEAD | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "originRevision")] | ||
pub origin_revision: Option<String>, | ||
/// Interval in seconds to poll for drifts between origin and target repositories. Default: 180 seconds | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "pollInterval")] | ||
pub poll_interval: Option<i64>, | ||
/// Git repo containing the pattern to deploy. Must use https/http | ||
#[serde(rename = "targetRepo")] | ||
pub target_repo: String, | ||
/// Branch, tag, or commit to deploy. Does not support short-sha's. Default: HEAD | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "targetRevision")] | ||
pub target_revision: Option<String>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] | ||
pub struct PatternMultiSourceConfig { | ||
/// The git reference when deploying the clustergroup helm chart directly from a git repo Defaults to 'main'. (Only used when developing the clustergroup helm chart) | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterGroupChartGitRevision")] | ||
pub cluster_group_chart_git_revision: Option<String>, | ||
/// Which chart version for the clustergroup helm chart Defaults to "0.0.*" | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterGroupChartVersion")] | ||
pub cluster_group_chart_version: Option<String>, | ||
/// The url when deploying the clustergroup helm chart directly from a git repo Defaults to '' which means not used (Only used when developing the clustergroup helm chart) | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterGroupGitRepoUrl")] | ||
pub cluster_group_git_repo_url: Option<String>, | ||
/// (EXPERIMENTAL) Enable multi-source support when deploying the clustergroup argo application | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub enabled: Option<bool>, | ||
/// The helm chart url to fetch the helm charts from in order to deploy the pattern Defaults to https://charts.validatedpatterns.io/ | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "helmRepoUrl")] | ||
pub helm_repo_url: Option<String>, | ||
} | ||
|
||
/// PatternStatus defines the observed state of Pattern | ||
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] | ||
pub struct PatternStatus { | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "analyticsSent")] | ||
pub analytics_sent: Option<i64>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "analyticsUUID")] | ||
pub analytics_uuid: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "appClusterDomain")] | ||
pub app_cluster_domain: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub applications: Option<Vec<PatternStatusApplications>>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterDomain")] | ||
pub cluster_domain: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterID")] | ||
pub cluster_id: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterName")] | ||
pub cluster_name: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterPlatform")] | ||
pub cluster_platform: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterVersion")] | ||
pub cluster_version: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub conditions: Option<Vec<PatternStatusConditions>>, | ||
/// Last error encountered by the pattern | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "lastError")] | ||
pub last_error: Option<String>, | ||
/// Last action related to the pattern | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "lastStep")] | ||
pub last_step: Option<String>, | ||
/// Number of updates to the pattern | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub version: Option<i64>, | ||
} | ||
|
||
/// PatternApplicationInfo defines the Applications Status for the Pattern. This structure is part of the PatternStatus as an array The Application Status will be included as part of the Observed state of Pattern | ||
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] | ||
pub struct PatternStatusApplications { | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "healthMessage")] | ||
pub health_message: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "healthStatus")] | ||
pub health_status: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub name: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub namespace: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "syncStatus")] | ||
pub sync_status: Option<String>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] | ||
pub struct PatternStatusConditions { | ||
/// Last time the condition transitioned from one status to another. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "lastTransitionTime")] | ||
pub last_transition_time: Option<String>, | ||
/// The last time this condition was updated. | ||
#[serde(rename = "lastUpdateTime")] | ||
pub last_update_time: String, | ||
/// A human readable message indicating details about the transition. | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub message: Option<String>, | ||
/// Status of the condition, one of True, False, Unknown. | ||
pub status: String, | ||
/// Type of deployment condition. | ||
#[serde(rename = "type")] | ||
pub r#type: String, | ||
} | ||
|
Oops, something went wrong.