Skip to content

Commit

Permalink
Increase etcd RAMDisk size to 1g
Browse files Browse the repository at this point in the history
By moving to the MicroShift 4.16, the etcd size increased from 470MB
to 625MB (checked in sf-operator-upgrade).

Change-Id: I96c211929afda4af20f2fc7c5b2ea0730954e60e
  • Loading branch information
danpawlik committed Aug 27, 2024
1 parent 9f6bede commit c7ec1e6
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cli/cmd/dev/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ func createMicroshift(kmd *cobra.Command, cliCtx cliutils.SoftwareFactoryConfigC
ctrl.Log.Info("disk-file-size not set, defaulting to " + defaultDiskSpace)
}
msEtcdOnRamdisk := cliCtx.Dev.Microshift.ETCDOnRAMDisk
msRamdiskSize := cliCtx.Dev.Microshift.RAMDiskSize
msAnsibleMicroshiftRolePath := cliCtx.Dev.AnsibleMicroshiftRolePath
if msAnsibleMicroshiftRolePath == "" {
msAnsibleMicroshiftRolePath = rootDir + "/ansible-microshift-role"
ctrl.Log.Info("No path to ansible-microshift-role provided, the role will be cloned into " + msAnsibleMicroshiftRolePath)
}
options := ms.MkAnsiblePlaybookOptions(msHost, msUser, msOpenshiftPullSecret, rootDir)
varsFile := ms.MkTemporaryVarsFile(
cliCtx.FQDN, msDiskFileSize, msAnsibleMicroshiftRolePath, rootDir, msEtcdOnRamdisk)
cliCtx.FQDN, msDiskFileSize, msAnsibleMicroshiftRolePath, rootDir, msEtcdOnRamdisk, msRamdiskSize)
options.ExtraVarsFile = []string{"@" + varsFile}
// Ensure ansible-microshift-role is available
ms.MkMicroshiftRoleSetupPlaybook(rootDir)
Expand Down
4 changes: 3 additions & 1 deletion cli/cmd/dev/microshift/microshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type GroupVarsData struct {
DiskFileSize string
MicroshiftRolePath string
ETCDOnRAMDisk bool
RAMDiskSize string
}

type PlayBook struct {
Expand Down Expand Up @@ -116,12 +117,13 @@ func MkAnsiblePlaybookOptions(host string, user string, pullSecret string, rootD
}

func MkTemporaryVarsFile(
fqdn string, diskFileSize string, microshiftRolePath string, rootDir string, etcdOnRamdisk bool) string {
fqdn string, diskFileSize string, microshiftRolePath string, rootDir string, etcdOnRamdisk bool, ramdiskSize string) string {
varsData := GroupVarsData{
fqdn,
diskFileSize,
microshiftRolePath,
etcdOnRamdisk,
ramdiskSize,
}
filePath := rootDir + "/all.yaml"
template, err := cutils.ParseString(groupvars, varsData)
Expand Down
1 change: 1 addition & 0 deletions cli/cmd/dev/microshift/static/all.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ microshift_role_version: ee9a80a3338837e6f7ed58f424ddcb96b976984f
disk_file_sparsed: true
disk_file_size: {{ .DiskFileSize }}
etcd_on_ramdisk: {{ .ETCDOnRAMDisk }}
ramdisk_size: {{ .RAMDiskSize }}
setup_olm: true
microshift_additional_addresses:
- {{ "\"{{ microshift_fqdn }}\"" }}
Expand Down
1 change: 1 addition & 0 deletions cli/cmd/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func initializeCLIConfig(isDevEnv bool) {
defaultContextConfig.Dev.Microshift.User = "cloud-user"
defaultContextConfig.Dev.Microshift.OpenshiftPullSecret = "PULL SECRET"
defaultContextConfig.Dev.Microshift.DiskFileSize = "30G"
defaultContextConfig.Dev.Microshift.RAMDiskSize = "1g"
defaultContextConfig.Dev.Tests.ExtraVars = map[string]string{"foo": "bar"}
}

Expand Down
1 change: 1 addition & 0 deletions cli/cmd/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ type SoftwareFactoryConfigContext struct {
OpenshiftPullSecret string `json:"openshift-pull-secret" mapstructure:"openshift-pull-secret"`
DiskFileSize string `json:"disk-file-size" mapstructure:"disk-file-size"`
ETCDOnRAMDisk bool `json:"etcd-on-ramdisk" mapstructure:"etcd-on-ramdisk"`
RAMDiskSize string `json:"ramdisk-size" mapstructure:"ramdisk-size"`
} `json:"microshift" mapstructure:"microshift"`
Tests struct {
DemoReposPath string `json:"demo-repos-path" mapstructure:"demo-repos-path"`
Expand Down
3 changes: 2 additions & 1 deletion sfcli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ contexts:
host: microshift.dev
openshift-pull-secret: <PULL SECRET>
user: cloud-user
ramdisk_size: 1g
sf-operator-repository-path: /path/to/sf-operator
tests:
demo-repos-path: ""
Expand All @@ -22,4 +23,4 @@ contexts:
manifest-file: /path/to/manifest
namespace: sf
standalone: false
default-context: my-context
default-context: my-context
1 change: 1 addition & 0 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- "sfop.me"
- "microshift.dev"
etcd_on_ramdisk: true
ramdisk_size: 1g
cloudprovider_dns:
- 199.204.44.24
- 199.204.47.54
Expand Down

0 comments on commit c7ec1e6

Please sign in to comment.