https://pulumi.com logo
#general
Title
# general
d

damp-pillow-67781

06/28/2019, 11:07 PM
Question: I'm trying to deploy a
Servicemonitor
to my EKS cluster into a specific namespace, but however I tried, it still installs into default namespace. Any idea on how to deploy not in default namespace? Here is the code I have:
Copy code
export const postgresServiceMonitorCRD = new k8s.apiextensions.CustomResource("postgres-servicemonitor", {
    apiVersion: "<http://monitoring.coreos.com/v1|monitoring.coreos.com/v1>",
    kind: "ServiceMonitor",
    namespace: namespaceName,
    transformations: [addMonitoringNamespace],
    metadata: {
        labels: {
            app: "prometheus-postgres-exporter-servicemonitor",
            release: "prometheus-operator",
        },
        name: "postgres-servicemonitor",
    },
    spec: {
        namespaceSelector: {
            any: true,
        },
        endpoints: [{
            port: "http",
            interval: "30s",
        },],
        selector: {
            matchLabels: {
                app: "prometheus-postgres-exporter",
                release: "postgres-exporter",
            },
        },
    },
});
m

millions-judge-24978

06/28/2019, 11:19 PM
Try setting
metadata.namespace
.
d

damp-pillow-67781

06/28/2019, 11:26 PM
that worked!
thanks!
👍 1
4 Views