Skip to content

MTCTL - Middletier Controller

Middletier controller (MTCTL) is a command line interface (CLI) tool for easy administration of common tasks in IFS cloud middle tier instance. It can help you do the following tasks.

  • list status of the deployments
  • start deployments
  • stop deployments
  • wait for deployments to fully start or stop
  • switch namespace maintenance mode
  • dump descriptions and logs to disk - use this for all support issues on Middle tier

Prerequisites

Your computer should have the following third party software installed and the path to the executable set in the PATH environment variable.

  • OpenJDK runtime
  • KUBECTL client

Usage

mtctl CLI is called with sub command and options to the sub command. Sub command and options are case sensitive. The script mtctl.cmd/sh is located in the ifsinstaller folder. The Java application is in ifsinstaller/lib/mtctl.jar.

mtctl sub-command [options]

example:

mtctl start --namespace custA_prod

Sub commands

Sub command Syntax Description
status mtctl status [--namespace NAMESPACE] Lists status of all the deployments.
start mtctl start [--namespace NAMESPACE] [--timeout TIMEOUT] Starts all the deployments to their original scale setting. Scale is set when IFS Cloud Applications is installed.
stop mtctl stop [--namespace NAMESPACE] [--timeout TIMEOUT] Stops all the deployments by scaling them down to zero (0). Original scale setting is preserved.
wait mtctl wait [--namespace NAMESPACE] --timeout TIMEOUT Wait until all deployments are fully started (scaled up to required number of pods),
fully stopped (scaled down to zero) or timeout.
TIMEOUT is a mandatory argument (in seconds).
maintenance mtctl maintenance --mode MODE [--namespace NAMESPACE] Switch the namespace maintenance mode on or off.
When the maintenance mode is on (set) all the requests to the namespace are
responded with a "maintenance mode" splash.
However the maintenance mode will be reset (off) if the ingress controller in the namespace was redeployed.
MODE is a mandatory argument (valid values: on|set|off|reset).
dump mtctl dump [--namespace NAMESPACE] [--dumpPath <path>] Writes the description for deployments, description and log for pods to disk in a folder named <NAMESPACE>_dump with a subfolder named yyyyMMdd_HHmmss. Default location for the dumpPath is where you start the mtctl tool.
clean mtctl clean [--namespace NAMESPACE] Will delete all pods in status "Evicted" in the namespace

NOTES:

  • NAMESPACE: Optional namespace in Kubernetes cluster to connect to. If not provided the default namespace set in the kube config is used.
  • MODE: Mode is required and valid options are on, set, off and reset
  • TIMEOUT: Wait time in seconds before all deployments are started or stopped. If not provided the mtctl will start/stop all deployments and exit before the operation is completed.
    When timeout option is passed with start or stop commands start or stop will automatically execute a wait command with the given timeout value.
  • Status output format: Each deployment status is listed in two lines. First line is the status of the deployment and the second line is the status of the pods associated with the deployment. Each pod had status of the containers.
  • Status, start, stop and wait sub commands print the status of the namespace when the operation completed.

Status example

IFS Cloud Applications - Middletier Controller
List deployment status
Thu Sep 16 09:35:20 IST 2021 L5 - 6 deployments not started
Deployments/Pods status
Namespace: ifs-test
Deployments/Pods status
Namespace: ifs-test

DEPLOYMENT STATUS
  POD NAME                                     READY  AGE     CONTAINER STATUS
ifs-file-storage DISABLED

ifs-forecast DISABLED

ifsapp-busmod DISABLED

ifsapp-amm NOT READY
  ifsapp-amm-866fb6c788-btxw5                  1/2    12d23h  ifsapp-amm NOT STARTED (580 restarts)                  linkerd-proxy READY

ifsapp-client READY
  ifsapp-client-5dc6f7ff7c-v2ldd               2/2    12d23h  ifsapp-client READY                                    linkerd-proxy READY
  • DEPLOYMENT STATE: Status of the deployment
    • DISABLED - scale is 0
    • NOT READY - one or more pods not started
    • READY - fully started
  • READY: Count of running containers in a pod against the count of all containers
  • AGE: Age of the pod (time since the last start).
  • CONTAINER STATE: Status of the container
    • NOT STARTED - container is not running
    • READY - container is running
  • Exit Codes mtctl will always return 0 when the operation was successful. The following lists possible exit codes.
Exit Code Note
0 Operation was successful
1 Failed - unknown reason
2 No arguments passed
3 java exception
11 Operation timeout
12 Operation partially failed
  • Other options to KUBECTL: Addition to the listed options, any option valid to KUBECTL client is also accepted.

example:

passing non default config file and context

mtctl start --kubeconfig c:\ifs\kubeconfig.conf --context ifs-cluster --namespace ifs-test