diff --git a/openyurt/app.yaml b/openyurt/app.yaml new file mode 100644 index 0000000..8838fb8 --- /dev/null +++ b/openyurt/app.yaml @@ -0,0 +1,44 @@ +apiVersion: core.oam.dev/v1beta1 +kind: Application +metadata: + name: yurt-app +spec: + components: + - name: redis + type: yurt-helm + properties: + repoType: "helm" + url: "https://charts.bitnami.com/bitnami" + chart: "redis" + version: "16.8.5" + values: + customNodeSelectorLabel: "apps.openyurt.io/nodepool" + policies: + - name: override-beijing + type: override + properties: + components: + - name: redis + properties: + subset: beijing + values: + customodeSelectorValues: ["beijing"] + - name: override-hangzhou + type: override + properties: + components: + - name: redis + properties: + subset: hangzhou + values: + customodeSelectorValues: ["hangzhou"] + workflow: + steps: + - name: deploy2beijing + type: deploy + properties: + policies: ["override-beijing"] + - name: deploy2hangzhou + type: deploy + properties: + policies: ["override-hangzhou"] diff --git a/openyurt/definition/helm-edge.cue b/openyurt/definition/helm-edge.cue index 99e0ee1..1252ff3 100644 --- a/openyurt/definition/helm-edge.cue +++ b/openyurt/definition/helm-edge.cue @@ -50,7 +50,7 @@ template: { output: { apiVersion: "source.toolkit.fluxcd.io/v1beta2" metadata: { - name: context.name + parameter.subnet + name: context.name + parameter.subset } if parameter.repoType == "git" { kind: "GitRepository" @@ -93,7 +93,7 @@ template: { apiVersion: "helm.toolkit.fluxcd.io/v2beta1" kind: "HelmRelease" metadata: { - name: context.name + parameter.subnet + name: context.name + parameter.subset } spec: { timeout: parameter.installTimeout @@ -112,7 +112,7 @@ template: { if parameter.repoType == "oss" { kind: "Bucket" } - name: context.name + parameter.subnet + name: context.name + parameter.subset } interval: parameter.interval if parameter["valuesFiles"] != _|_ { @@ -161,7 +161,7 @@ template: { parameter: { - subnet: *"" | string + subset: *"" | string repoType: *"helm" | "git" | "oss" | "oci" // +usage=The interval at which to check for repository/bucket and release updates, default to 5m