def convert_to_milli(val):
    """
    Converts a string to milli value in int.
    Useful to convert milli values from k8s.
    Examples:
        convert_to_milli('10m') -> 10
        convert_to_milli('10000m') -> 10000
        convert_to_milli('1') -> 1000
        convert_to_milli('100') -> 100000
    """
    if val[-1] == 'm':
        return int(val.rstrip('m'))
    else:
        return 1000 * int(val)