Relationship between a deployment and a secrets

How do I find the relationship between a deployment and a secret?

Answers

  • jdowdy
    jdowdy ✭✭✭✭✭
    The relationship between a deployment and a secret is through the namespace. Can you try the following query?
    find kube_deployment with displayName~='example' as deployment
        that contains kube_namespace as namespace
        that contains kube_secret as secret
        return 
            deployment.displayName, deployment.strategy.type, deployment.generation, 
            namespace.displayName, namespace.status.phase, namespace.resourceVersion, 
            secret.displayName, secret.encrypted, secret.type
    I’d also recommend returning this as a graph so you can view the relationships.
    find kube_deployment with displayName~='example' as deployment
        that contains kube_namespace as namespace
        that contains kube_secret as secret
        return tree

This Month's Leaders