如何引用 openshift 部署中提到的环境变量,在同一部署的 pod 中的 python 代码 运行 内

How to refer Environment variables mentioned in openshift deployment, inside python code running in the pod of same deployment

我是 Openshift 容器平台的新手。我正在尝试部署用 python 编写的 ML 模型,该模型根据 py 代码中已经提到的 name/password 的身份验证服务 Json 请求。

    @app.before_request
def validate_request():
    try :
        if(request.authorization.username != auth_user or request.authorization.password != auth_password):
            return "Authentication failed: invalid or missing user/password."
    except:
        return "Authentication failed: invalid or missing user/password"

现在我正在做的是,我在 Openshift name-space 中创建一个秘密 dm 并将其添加到部署中,如下所示

如何在我的 python 代码中使用这个秘密中提到的用户名和密码,我已经尝试过 the openshift doc 但它没有完成我在代码中使用值的要求。

auth_user = os.environ.get('principle')
auth_password = os.environ.get('credential')