forked from kubevela/catalog
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Addon kubevela#579] Add Apache Kyuubi as a experimental addon
Signed-off-by: yanghua <[email protected]>
- Loading branch information
Showing
8 changed files
with
173 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# kyuubi | ||
|
||
This is an addon template. Check how to build your own addon: https://kubevela.net/docs/platform-engineers/addon/intro |
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,25 @@ | ||
// We put Definitions in definitions directory. | ||
// References: | ||
// - https://kubevela.net/docs/platform-engineers/cue/definition-edit | ||
// - https://kubevela.net/docs/platform-engineers/addon/intro#definitions-directoryoptional | ||
"mytrait": { | ||
alias: "mt" | ||
annotations: {} | ||
attributes: { | ||
appliesToWorkloads: [ | ||
"deployments.apps", | ||
"replicasets.apps", | ||
"statefulsets.apps", | ||
] | ||
conflictsWith: [] | ||
podDisruptive: false | ||
workloadRefPath: "" | ||
} | ||
description: "My trait description." | ||
labels: {} | ||
type: "trait" | ||
} | ||
template: { | ||
parameter: {param: ""} | ||
outputs: {sample: {}} | ||
} |
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,7 @@ | ||
description: An addon for KubeVela. | ||
icon: "" | ||
invisible: false | ||
name: kyuubi | ||
tags: | ||
- my-tag | ||
version: 1.0.0 |
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,10 @@ | ||
// parameter.cue is used to store addon parameters. | ||
// | ||
// You can use these parameters in template.cue or in resources/ by 'parameter.myparam' | ||
// | ||
// For example, you can use parameters to allow the user to customize | ||
// container images, ports, and etc. | ||
parameter: { | ||
// +usage=Custom parameter description | ||
myparam: *"myns" | string | ||
} |
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,18 @@ | ||
// We put Components in resources directory. | ||
// References: | ||
// - https://kubevela.net/docs/end-user/components/references | ||
// - https://kubevela.net/docs/platform-engineers/addon/intro#resources-directoryoptional | ||
output: { | ||
type: "k8s-objects" | ||
properties: { | ||
objects: [ | ||
{ | ||
// This creates a plain old Kubernetes namespace | ||
apiVersion: "v1" | ||
kind: "Namespace" | ||
// We can use the parameter defined in parameter.cue like this. | ||
metadata: name: parameter.myparam | ||
}, | ||
] | ||
} | ||
} |
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,8 @@ | ||
# We put UI Schemas that correspond to Definitions in schemas directory. | ||
# References: | ||
# - https://kubevela.net/docs/platform-engineers/addon/intro#schemas-directoryoptional | ||
# - https://kubevela.net/docs/reference/ui-schema | ||
- jsonKey: myparam | ||
label: MyParam | ||
validate: | ||
required: true |
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,71 @@ | ||
package main | ||
output: { | ||
apiVersion: "core.oam.dev/v1beta1" | ||
kind: "Application" | ||
spec: { | ||
components: [ | ||
{ | ||
type: "k8s-objects" | ||
name: "kyuubi-ns" | ||
properties: objects: [{ | ||
apiVersion: "v1" | ||
kind: "Namespace" | ||
metadata: name: parameter.namespace | ||
}] | ||
}, | ||
{ | ||
name: "flink-operator-helm" | ||
type: "helm" | ||
dependsOn: ["kyuubi-ns"] | ||
type: "helm" | ||
properties: { | ||
repoType: "helm" | ||
url: "https://github.com/apache/kyuubi/tree/master/charts/kyuubi" | ||
chart: "kyuubi" | ||
targetNamespace: parameter["namespace"] | ||
version: "1.6.0" | ||
values: { | ||
webhook: { | ||
create: parameter["createWebhook"] | ||
} | ||
|
||
image: { | ||
repository: parameter["imageRepository"] | ||
tag: parameter["imageTag"] | ||
} | ||
|
||
jobServiceAccount: { | ||
create: parameter["createJobServiceAccount"] | ||
} | ||
|
||
operatorServiceAccount: { | ||
name: "flink-kubernetes-operator" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
policies: [ | ||
{ | ||
type: "shared-resource" | ||
name: "namespace" | ||
properties: rules: [{ | ||
selector: resourceTypes: ["Namespace"] | ||
}] | ||
}, | ||
{ | ||
type: "topology" | ||
name: "deploy-cert-manager-ns" | ||
properties: { | ||
namespace: parameter.namespace | ||
if parameter.clusters != _|_ { | ||
clusters: parameter.clusters | ||
} | ||
if parameter.clusters == _|_ { | ||
clusterLabelSelector: {} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
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,31 @@ | ||
// We put VelaQL views in views directory. | ||
// | ||
// VelaQL(Vela Query Language) is a resource query language for KubeVela, | ||
// used to query status of any extended resources in application-level. | ||
// Reference: https://kubevela.net/docs/platform-engineers/system-operation/velaql | ||
// | ||
// This VelaQL View querys the status of this addon. | ||
// Use this view to query by: | ||
// vela ql --query 'my-view{addonName:kyuubi}.status' | ||
// You should see 'running'. | ||
|
||
import ( | ||
"vela/ql" | ||
) | ||
|
||
app: ql.#Read & { | ||
value: { | ||
kind: "Application" | ||
apiVersion: "core.oam.dev/v1beta1" | ||
metadata: { | ||
name: "addon-" + parameter.addonName | ||
namespace: "vela-system" | ||
} | ||
} | ||
} | ||
|
||
parameter: { | ||
addonName: *"kyuubi" | string | ||
} | ||
|
||
status: app.value.status.status |