From 22c143b72912da3861f9f10c5e294314f4290ee2 Mon Sep 17 00:00:00 2001 From: PulkitDadwal <150671733+PulkitDadwal@users.noreply.github.com> Date: Tue, 29 Jul 2025 19:58:26 +0530 Subject: [PATCH] feat: add Bookinfo demo deployment to enterprise demo flow Signed-off-by: PulkitDadwal <150671733+PulkitDadwal@users.noreply.github.com> --- pkg/internal/enterprise.go | 57 ++++++++++++++++++++++++++++++++++++++ pkg/slicectl.go | 2 ++ 2 files changed, 59 insertions(+) diff --git a/pkg/internal/enterprise.go b/pkg/internal/enterprise.go index ac7ec15..3897548 100644 --- a/pkg/internal/enterprise.go +++ b/pkg/internal/enterprise.go @@ -216,3 +216,60 @@ func getNodeIP(cc *Cluster) (string, error) { } return "", err } + +// Bookinfo demo manifest (minimal, for demo purposes) +const bookinfoManifest = ` +--- +apiVersion: v1 +kind: Namespace +metadata: + name: bookinfo +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: productpage-v1 + namespace: bookinfo + labels: + app: productpage + version: v1 +spec: + replicas: 1 + selector: + matchLabels: + app: productpage + version: v1 + template: + metadata: + labels: + app: productpage + version: v1 + spec: + containers: + - name: productpage + image: docker.io/istio/examples-bookinfo-productpage-v1:1.16.2 + ports: + - containerPort: 9080 +--- +apiVersion: v1 +kind: Service +metadata: + name: productpage + namespace: bookinfo +spec: + ports: + - port: 9080 + name: http + selector: + app: productpage +` + +func DeployBookinfoDemo(ApplicationConfiguration *ConfigurationSpecs) { + util.Printf("\nDeploying Bookinfo demo application to first worker cluster...") + cc := ApplicationConfiguration.Configuration.ClusterConfiguration + wc := cc.WorkerClusters + manifestFile := kubesliceDirectory + "/bookinfo-demo.yaml" + util.DumpFile(bookinfoManifest, manifestFile) + ApplyKubectlManifest(manifestFile, "bookinfo", &wc[0]) + util.Printf("%s Bookinfo demo deployed to cluster %s in namespace 'bookinfo'. Access productpage service on port 9080.", util.Tick, wc[0].Name) +} diff --git a/pkg/slicectl.go b/pkg/slicectl.go index 92a2240..823202a 100644 --- a/pkg/slicectl.go +++ b/pkg/slicectl.go @@ -57,6 +57,8 @@ func entDemo() { util.Printf("%s Waiting for configuration propagation", util.Wait) time.Sleep(20 * time.Second) internal.RolloutRestartIPerf(ApplicationConfiguration) + // Deploy Bookinfo demo as part of enterprise demo + internal.DeployBookinfoDemo(ApplicationConfiguration) internal.PrintNextSteps(true, ApplicationConfiguration) }