Skip to content

Commit

Permalink
add: install spark-operator (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroniscode authored Sep 3, 2024
1 parent 06b4f0c commit a55367b
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ The application catalog includes:
* `secrets` — Secrets Management Solutions for Kubernetes
* `store-csi-driver` — Integrates secrets stores with K8s via a CSI volume
* `store-csi-driver-provider-aws` — AWS Secrets Manager and Config Provider for Secret Store CSI Driver
* `spark-operator` — Kubeflow Spark Operator
* `storage` — Kubernetes Storage Solutions
* `ebs-csi` — Amazon EBS CSI driver
* `efs-csi` — Amazon EFS CSI driver
Expand Down
2 changes: 2 additions & 0 deletions cmd/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/awslabs/eksdemo/pkg/application/kube_state_metrics"
"github.com/awslabs/eksdemo/pkg/application/metrics_server"
"github.com/awslabs/eksdemo/pkg/application/prometheus_node_exporter"
sparkoperator "github.com/awslabs/eksdemo/pkg/application/spark"
"github.com/awslabs/eksdemo/pkg/application/storage/ebs_csi"
"github.com/awslabs/eksdemo/pkg/application/vault"
"github.com/awslabs/eksdemo/pkg/application/velero"
Expand Down Expand Up @@ -95,6 +96,7 @@ func NewInstallCmd() *cobra.Command {
cmd.AddCommand(NewInstallSecretsCmd())
cmd.AddCommand(NewInstallAliasCmds(secrets, "secret-")...)
cmd.AddCommand(NewInstallAliasCmds(secrets, "secrets-")...)
cmd.AddCommand(sparkoperator.NewApp().NewInstallCmd())
cmd.AddCommand(NewInstallStorageCmd())
cmd.AddCommand(NewInstallAliasCmds(storageApps, "storage-")...)
cmd.AddCommand(vault.NewApp().NewInstallCmd())
Expand Down
2 changes: 2 additions & 0 deletions cmd/install/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/awslabs/eksdemo/pkg/application/kube_state_metrics"
"github.com/awslabs/eksdemo/pkg/application/metrics_server"
"github.com/awslabs/eksdemo/pkg/application/prometheus_node_exporter"
sparkoperator "github.com/awslabs/eksdemo/pkg/application/spark"
"github.com/awslabs/eksdemo/pkg/application/storage/ebs_csi"
"github.com/awslabs/eksdemo/pkg/application/vault"
"github.com/awslabs/eksdemo/pkg/application/velero"
Expand Down Expand Up @@ -95,6 +96,7 @@ func NewUninstallCmd() *cobra.Command {
cmd.AddCommand(NewUninstallSecretsCmd())
cmd.AddCommand(NewUninstallAliasCmds(secrets, "secret-")...)
cmd.AddCommand(NewUninstallAliasCmds(secrets, "secrets-")...)
cmd.AddCommand(sparkoperator.NewApp().NewUninstallCmd())
cmd.AddCommand(NewUninstallStorageCmd())
cmd.AddCommand(NewUninstallAliasCmds(storageApps, "storage-")...)
cmd.AddCommand(vault.NewApp().NewUninstallCmd())
Expand Down
29 changes: 29 additions & 0 deletions pkg/application/spark/options.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package spark

import (
"github.com/awslabs/eksdemo/pkg/application"
"github.com/awslabs/eksdemo/pkg/cmd"
)

type Options struct {
application.ApplicationOptions
}

func newOptions() (options *Options, flags cmd.Flags) {
options = &Options{
ApplicationOptions: application.ApplicationOptions{
DefaultVersion: &application.LatestPrevious{
LatestChart: "2.0.0-rc.0",
Latest: "2.0.0-rc.0",
PreviousChart: "2.0.0-rc.0",
Previous: "2.0.0-rc.0",
},
Namespace: "spark-operator",
ServiceAccount: "spark-operator-controller",
},
}

flags = cmd.Flags{}

return
}
48 changes: 48 additions & 0 deletions pkg/application/spark/spark_operator.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package spark

import (
"github.com/awslabs/eksdemo/pkg/application"
"github.com/awslabs/eksdemo/pkg/cmd"
"github.com/awslabs/eksdemo/pkg/installer"
"github.com/awslabs/eksdemo/pkg/template"
)

// Docs: https://www.kubeflow.org/docs/components/spark-operator/
// GitHub: https://github.com/kubeflow/spark-operator
// Helm: https://github.com/kubeflow/spark-operator/tree/master/charts/spark-operator-chart
// Repo: https://hub.docker.com/r/kubeflow/spark-operator/
// Version: Latest is v2.0.0-rc.0 (as of 9/2/24)

func NewApp() *application.Application {
options, flags := newOptions()

return &application.Application{
Command: cmd.Command{
Name: "spark-operator",
Description: "Kubeflow Spark Operator",
Aliases: []string{"spark"},
},

Flags: flags,

Installer: &installer.HelmInstaller{
ChartName: "spark-operator",
ReleaseName: "spark-operator",
RepositoryURL: "https://kubeflow.github.io/spark-operator",
ValuesTemplate: &template.TextTemplate{
Template: valuesTemplate,
},
},

Options: options,
}
}

// https://github.com/kubeflow/spark-operator/blob/master/charts/spark-operator-chart/values.yaml
const valuesTemplate = `---
image:
tag: {{ .Version }}
controller:
serviceAccount:
name: {{ .ServiceAccount }}
`

0 comments on commit a55367b

Please sign in to comment.