Skip to content

Commit

Permalink
Add yurt app example
Browse files Browse the repository at this point in the history
Signed-off-by: Jianbo Sun <[email protected]>
  • Loading branch information
wonderflow committed Jul 11, 2022
1 parent fbfe95a commit 9ebb6aa
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
44 changes: 44 additions & 0 deletions openyurt/app.yaml
Original file line number Diff line number Diff line change
@@ -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"]
8 changes: 4 additions & 4 deletions openyurt/definition/helm-edge.cue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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"] != _|_ {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9ebb6aa

Please sign in to comment.