I'm trying to deploy <kube-prometheus> using 2 `Co...
# kubernetes
k
I'm trying to deploy kube-prometheus using 2 `ConfigGroup`s per below
Copy code
const promSetup = new k8s.yaml.ConfigGroup(
    "promSetup",
    {
      files: [path.join("manifests/setup/", "*.yaml")],
    },
    { provider: conf.k8sClusterConfig.provider }
  );

  const promMain = new k8s.yaml.ConfigGroup(
    "promMain",
    {
      files: [path.join("manifests/", "*.yaml")],
    },
    { provider: conf.k8sClusterConfig.provider, dependsOn: [promSetup] }
  );
I get an error for 2 of the CustomResourceDefinitions
Copy code
<http://alertmanagers.monitoring.coreos.com|alertmanagers.monitoring.coreos.com> (kubernetes:yaml:ConfigGroup$kubernetes:yaml:ConfigFile$kubernetes:<http://apiextensions.k8s.io/v1beta1:CustomResourceDefinition|apiextensions.k8s.io/v1beta1:CustomResourceDefinition>)
error: resource <http://alertmanagers.monitoring.coreos.com|alertmanagers.monitoring.coreos.com> was not successfully created by the Kubernetes API server : <http://customresourcedefinitions.apiextensions.k8s.io|customresourcedefinitions.apiextensions.k8s.io> "<http://alertmanagers.monitoring.coreos.com|alertmanagers.monitoring.coreos.com>" already exists
&&
<http://prometheuses.monitoring.coreos.com|prometheuses.monitoring.coreos.com>
and
Copy code
<http://v1beta1.metrics.k8s.io|v1beta1.metrics.k8s.io> (kubernetes:yaml:ConfigGroup$kubernetes:yaml:ConfigFile$kubernetes:<http://apiregistration.k8s.io/v1:APIService|apiregistration.k8s.io/v1:APIService>)
error: resource <http://v1beta1.metrics.k8s.io|v1beta1.metrics.k8s.io> was not successfully created by the Kubernetes API server : <http://apiservices.apiregistration.k8s.io|apiservices.apiregistration.k8s.io> "<http://v1beta1.metrics.k8s.io|v1beta1.metrics.k8s.io>" already exists
Checking the cluster, they do exist, and they were created by the initial deployment. Running up --refresh does not fix it either Questions 1. Is this a bug? 2. How can I recover from this? Normally I would import the resource but there is no import option for
ConfigGroup
Ok, a bit more I split it up into 3 resources now as there are 0 yaml files and non 0 yaml files in setup
Copy code
const promSetup0 = new k8s.yaml.ConfigGroup(
    "promSetup0",
    {
      files: [path.join("manifests/setup/", "prometheus-operator-0*.yaml")],
    },
    { provider: conf.k8sClusterConfig.provider }
  );

  const promSetup1 = new k8s.yaml.ConfigGroup(
    "promSetup1",
    {
      files: [path.join("manifests/setup/", "prometheus-operator-[^0]*.yaml")],
    },
    { provider: conf.k8sClusterConfig.provider, dependsOn: [promSetup0] }
  );

  const promMain = new k8s.yaml.ConfigGroup(
    "promMain",
    {
      files: [path.join("manifests/", "*.yaml")],
    },
    {
      provider: conf.k8sClusterConfig.provider,
      dependsOn: [promSetup0, promSetup1],
    }
  );
I still get the errors, even with the
dependsOn
attribute I can get it to successfully deploy by commenting out promMain and promSetup1, then just promMain and doing up in between each step Shouldn't
dependsOn
wait for the dependent resource to fully create before starting? Or is this a case of a delayed finish after reporting ok?