Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert Policy: region does not have a default #70

Open
sanderblue opened this issue May 22, 2020 · 0 comments
Open

Alert Policy: region does not have a default #70

sanderblue opened this issue May 22, 2020 · 0 comments

Comments

@sanderblue
Copy link
Contributor

sanderblue commented May 22, 2020

Description

Currently a user is required to supply the region field as part of the spec for the Policy configuration. This should be not required.

If the user does not explicitly set a region, the default value of US should be used.

Current behavior

When executing kubectl apply -f ./my-alert-policy.yaml, the operation appears to have succeeded, however the policy is not created and an error occurs under the hood.

Note: The command should also fail to execute which has been reported as a bug in issue #45.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Ensure the operator is installed and ready
  2. Use the following yaml to configure a minimal Alert Policy (my-alert-policy.yaml)
    apiVersion: nr.k8s.newrelic.com/v1
    kind: Policy
    metadata:
      name: my-policy
    spec:
      api_key: <your API key>
      name: "alert policy created with k8s"

    Note: Adding region: "US" to the spec will allow a successful apply.

  3. Tail the logs of your controller node - first get the node's full name, then tail those logs
    kubectl describe nodes -n newrelic-kubernetes-operator-system | grep controller-manager
    kubectl logs -f -n newrelic-kubernetes-operator-system -c manager newrelic-kubernetes-operator-controller-manager-<hash goes here>
  4. Open a new terminal in the current working directory and run the follow command.
    kubectl apply -f ./my-alert-policy.yaml
    The command "succeeds" with an output of policy.nr.k8s.newrelic.com/my-policy created, however an error occurred and the policy does not exist in New Relic.
  5. See error - kubernetes will continue to attempt to provision the resource over and over due to the error: "error":"unknown region"

Debug Output (if applicable)

{"level":"error", ... ... "msg":"Reconciler error","controller":"policy","request":"default/my-policy","error":"unknown region","stacktrace": ... etc etc
@sanderblue sanderblue added the bug Something isn't working label May 22, 2020
@sanderblue sanderblue added this to the Initial k8s support milestone May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kubernetes
Projects
No open projects
Development

No branches or pull requests

2 participants