@classmethod
def get_k8s_secrets(cls, secret_name, secrets):
    """ Given an array of Docker secrets return a set of secrets and a set of volumeMounts """
    volume_mounts = []
    volumes = []
    environment_variables = []
    for secret_config in secrets:
        if 'mount_path' in secret_config:
            mount_path = secret_config['mount_path']
            read_only = True
            volume_name = secret_name
            if 'read_only' in secret_config:
                read_only = secret_config['read_only']
            if 'name' in secret_config:
                volume_name = secret_config['name']
            secret_volume = dict(secretName=secret_name)
            if 'items' in secret_config:
                secret_volume['items'] = secret_config['items']
            volume_mounts.append(dict(mountPath=mount_path, name=
                volume_name, readOnly=read_only))
            volumes.append(dict(name=volume_name, secret=secret_volume))
        elif 'env_variable' in secret_config:
            secret_key_ref = dict(secretKeyRef=dict(name=secret_name, key=
                secret_config['key']))
            environment_variables.append(dict(name=secret_config[
                'env_variable'], valueFrom=secret_key_ref))
    return volumes, volume_mounts, environment_variables
