func()

in pkg/resources/statefulset/mgmd_statefulset.go [110:157]


func (mss *mgmdStatefulSet) getContainers(nc *v1.NdbCluster) []corev1.Container {

	// Command and args to run the management server
	cmdAndArgs := []string{
		"/usr/sbin/ndb_mgmd",
		"-f", mgmdConfigIniMountPath + "/config.ini",
		"--initial",
		"--nodaemon",
		"--config-cache=0",
		"--ndb-nodeid=$(cat " + NodeIdFilePath + ")",
	}

	if debug.Enabled {
		// Increase verbosity in debug mode
		cmdAndArgs = append(cmdAndArgs, "-v")
	}

	mgmdContainer := mss.createContainer(nc,
		mss.getContainerName(false),
		cmdAndArgs, mss.getVolumeMounts(), mgmdPorts)

	// Startup probe for the mgmd container
	mgmdContainer.StartupProbe = &corev1.Probe{
		ProbeHandler: corev1.ProbeHandler{
			Exec: &corev1.ExecAction{
				Command: []string{
					"/bin/bash",
					helperScriptsMountPath + "/" + constants.MgmdStartupProbeScript,
				},
			},
		},
		// Startup probe - expects mgmd to get ready within a minute
		PeriodSeconds:    1,
		TimeoutSeconds:   20,
		FailureThreshold: 60,
	}

	// Readiness probe checks if the port 1186 is open
	mgmdContainer.ReadinessProbe = &corev1.Probe{
		ProbeHandler: corev1.ProbeHandler{
			TCPSocket: &corev1.TCPSocketAction{
				Port: intstr.FromInt(1186),
			},
		},
	}

	return []corev1.Container{mgmdContainer}
}