Skip to content

Commit

Permalink
Update quickstart to support arm hardware(ex: M1) (#4457)
Browse files Browse the repository at this point in the history
* Add: arch selection for mysql image
Update chart values and templates for mysql deployment

Signed-off-by: gitbluf <[email protected]>

* Update: MySql image selector function to be more descriptive

Signed-off-by: gitbluf <[email protected]>

* Remove: mysql image set on piped installation

Signed-off-by: gitbluf <[email protected]>

* Update method name

Signed-off-by: gitbluf <[email protected]>

---------

Signed-off-by: gitbluf <[email protected]>
  • Loading branch information
gitbluf authored and kentakozuka committed Jul 12, 2023
1 parent c75c717 commit d7c52a8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifests/pipecd/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ spec:
{{- end }}
containers:
- name: mysql
image: mysql:{{ .Values.mysql.imageTag }}
image: {{ .Values.mysql.image }}:{{ .Values.mysql.imageTag }}
imagePullPolicy: IfNotPresent
env:
- name: MYSQL_ROOT_PASSWORD
Expand Down
3 changes: 2 additions & 1 deletion manifests/pipecd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ cloudSQLProxy:
resources: {}

mysql:
imageTag: "8.0.23"
image: mysql
imageTag: 8.0.33
resources: {}
port: 3306

Expand Down
21 changes: 18 additions & 3 deletions pkg/app/pipectl/cmd/quickstart/quickstart.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ func (c *command) installControlPlane(ctx context.Context, helm string, input cl
"--create-namespace",
"--values",
fmt.Sprintf(helmQuickstartValueRemotePath, c.version),
"--set",
fmt.Sprintf("mysql.image=%s", selectMySQLImage()),
}

var stderr, stdout bytes.Buffer
Expand Down Expand Up @@ -312,6 +314,19 @@ func openbrowser(url string) error {
return err
}

func selectMySQLImage() string {
var mysqlImage string
switch runtime.GOARCH {
case "amd64":
mysqlImage = "mysql"
case "arm64":
mysqlImage = "arm64v8/mysql"
default:
mysqlImage = "mysql"
}
return mysqlImage
}

func (c *command) uninstallAll(ctx context.Context, helm string, input cli.Input) error {
input.Logger.Info("Uninstalling PipeCD components...")

Expand Down Expand Up @@ -380,9 +395,9 @@ func (c *command) getKubectl() (string, error) {
}

// getHelm finds and returns helm executable binary in the following priority:
// 1. pre-installed in command specified toolsDir (default is $HOME/.pipectl/tools)
// 2. $PATH
// 3. install new helm to command specified toolsDir
// 1. pre-installed in command specified toolsDir (default is $HOME/.pipectl/tools)
// 2. $PATH
// 3. install new helm to command specified toolsDir
func (c *command) getHelm(ctx context.Context) (string, error) {
binName := "helm"

Expand Down

0 comments on commit d7c52a8

Please sign in to comment.