Skip to content

ConfigMap #5

@javajon

Description

@javajon

Ack!, no do not do it this way. Way too hard and violates many design patterns.

config.load_incluster_config()
v1 = client.CoreV1Api()
config_map_name = "app-config"
namespace = "default"  # Replace with your namespace if different
config_map = v1.read_namespaced_config_map(config_map_name, namespace)
# Retrieve the IP address from the ConfigMap data
ip_address = config_map.data.get("max_ip")
app.config['API_IP'] = ip_address

Read documentation on mapping env vars into a Deployment!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions