openebs-archive / openebs-docs

OpenEBS Documentation
https://docs.openebs.io
Apache License 2.0
37 stars 137 forks source link

Document the environment variables used in maya api service #551

Open AmitKumarDas opened 7 years ago

AmitKumarDas commented 7 years ago

Is this a BUG REPORT or FEATURE REQUEST?

FEATURE REQUEST

Details

maya api server defines the environment variables (referred as ENV) with an appropriate context.

e.g. the replica count of OpenEBS volume in default context one has to set the ENV variable

DEFAULT_REPLICA_COUNT=1 # or some non-negative value

e.g. similarly to fetch the replica count of OpenEBS volume in a context named XYZ one has to set the ENV variable

XYZ_REPLICA_COUNT=1

The ENV context can be set by passing XYZ as the value against the request option

env.mapi.openebs.io/env-var-ctx=XYZ

NOTE: Environment variables can sometimes be tricky if the user running the process (e.g. here maya api service) should have access to these variables.

Refer to below snippet for other ENV variables understood by maya api service

// EnvironmentVariableDefaults is a typed label that defines the environment variable
// defaults
type EnvironmentVariableDefaults string

const (
    // Default value for environment variable context
    EnvVariableContextDef EnvironmentVariableDefaults = "DEFAULT"
)

// EnvironmentVariableKey is a typed label that define the environment variables
type EnvironmentVariableKey string

const (
    // PVPProfileNameEnvVarKey is the environment variable key for persistent
    // volume provisioner's profile name
    //
    // Usage:
    // <CTX>_PVP_PROFILE_NAME = <some value>
    PVPProfileNameEnvVarKey EnvironmentVariableKey = "_PVP_PROFILE_NAME"
    // PVPNameEnvVarKey is the environment variable key for persistent volume
    // provisioner's name
    //
    // Usage:
    // <CTX>_PVP_NAME = <some value>
    PVPNameEnvVarKey EnvironmentVariableKey = "_PVP_NAME"
    // PVPControllerImageEnvVarKey is the environment variable key for persistent
    // volume provisioner's controller image
    //
    // Usage:
    // <CTX>_CONTROLLER_IMAGE = <some value>
    PVPControllerImageEnvVarKey EnvironmentVariableKey = "_CONTROLLER_IMAGE"
    // PVPPersistentPathEnvVarKey is the environment variable key for persistent
    // volume provisioner's replica persistent path
    //
    // Usage:
    // <CTX>_PERSISTENT_PATH = <some value>
    PVPPersistentPathEnvVarKey EnvironmentVariableKey = "_PERSISTENT_PATH"
    // PVPStorageSizeEnvVarKey is the environment variable key for persistent
    // volume provisioner's replica size
    //
    // Usage:
    // <CTX>_STORAGE_SIZE = <some value>
    PVPStorageSizeEnvVarKey EnvironmentVariableKey = "_STORAGE_SIZE"
    // PVPReplicaCountEnvVarKey is the environment variable key for persistent
    // volume provisioner's replica count
    //
    // Usage:
    // <CTX>_REPLICA_COUNT = <some value>
    PVPReplicaCountEnvVarKey EnvironmentVariableKey = "_REPLICA_COUNT"
    // PVPReplicaImageEnvVarKey is the environment variable key for persistent
    // volume provisioner's replica image
    //
    // Usage:
    // <CTX>_REPLICA_IMAGE = <some value>
    PVPReplicaImageEnvVarKey EnvironmentVariableKey = "_REPLICA_IMAGE"
    // PVPControllerCountEnvVarKey is the environment variable key for persistent
    // volume provisioner's controller count
    //
    // Usage:
    // <CTX>_CONTROLLER_COUNT = <some value>
    PVPControllerCountEnvVarKey EnvironmentVariableKey = "_CONTROLLER_COUNT"
    // PVPReplicaTopologyKeyEnvVarKey is the environment variable key for persistent
    // volume provisioner's replica topology key
    //
    // Usage:
    // <CTX>_REPLICA_TOPOLOGY_KEY = <some value>
    PVPReplicaTopologyKeyEnvVarKey EnvironmentVariableKey = "_REPLICA_TOPOLOGY_KEY"
    // OrchestratorNameEnvVarKey is the environment variable key for
    // orchestration provider's name
    //
    // Usage:
    // <CTX>_ORCHESTRATOR_NAME = <some value>
    OrchestratorNameEnvVarKey EnvironmentVariableKey = "_ORCHESTRATOR_NAME"
    // OrchestratorRegionEnvVarKey is the environment variable key for orchestration
    // provider's region
    //
    // Usage:
    // <CTX>_ORCHESTRATOR_REGION = <some value>
    OrchestratorRegionEnvVarKey EnvironmentVariableKey = "_ORCHESTRATOR_REGION"
    // OrchestratorDCEnvVarKey is the environment variable key for orchestration
    // provider's datacenter
    //
    // Usage:
    // <CTX>_ORCHESTRATOR_DC = <some value>
    OrchestratorDCEnvVarKey EnvironmentVariableKey = "_ORCHESTRATOR_DC"
    // OrchestratorAddressEnvVarKey is the environment variable key for orchestration
    // provider's address
    //
    // Usage:
    // <CTX>_<REGION>_<DC>_ORCHESTRATOR_ADDR = 10.20.1.1
    OrchestratorAddressEnvVarKey EnvironmentVariableKey = "_ORCHESTRATOR_ADDR"
    // OrchestratorCNTypeEnvVarKey is the environment variable key for orchestration
    // provider's network type
    //
    // Usage:
    // <CTX>_ORCHESTRATOR_CN_TYPE = <some value>
    OrchestratorCNTypeEnvVarKey EnvironmentVariableKey = "_ORCHESTRATOR_CN_TYPE"
    // OrchestratorCNInterfaceEnvVarKey is the environment variable key for orchestration
    // provider's network interface
    //
    // Usage:
    // <CTX>_ORCHESTRATOR_CN_INTERFACE = <some value>
    OrchestratorCNInterfaceEnvVarKey EnvironmentVariableKey = "_ORCHESTRATOR_CN_INTERFACE"
    // OrchestratorCNAddrEnvVarKey is the environment variable key for orchestration
    // provider's network address
    //
    // Usage:
    // <CTX>_ORCHESTRATOR_CN_ADDRESS = <some value>
    OrchestratorCNAddrEnvVarKey EnvironmentVariableKey = "_ORCHESTRATOR_CN_ADDRESS"
    // OrchestratorNSEnvVarKey is the environment variable key for orchestration
    // provider's namespace
    //
    // Usage:
    // <CTX>_ORCHESTRATOR_NS = <some value>
    OrchestratorNSEnvVarKey EnvironmentVariableKey = "_ORCHESTRATOR_NS"
    // OrchestratorInClusterEnvVarKey is the environment variable key for orchestration
    // provider's in-cluster flag
    //
    // Usage:
    // <CTX>_ORCHESTRATOR_IN_CLUSTER = <some value>
    OrchestratorInClusterEnvVarKey EnvironmentVariableKey = "_ORCHESTRATOR_IN_CLUSTER"
)
kmova commented 5 years ago

With 0.8.1, most of the values are pushed into the storage classes and storage policies. Still a few remain as ENV. The CAS templates could be looked into to update the documentation.