Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

flag provided but not defined: -log-json #1020

Closed
TJM opened this issue Jun 30, 2021 · 6 comments
Closed

flag provided but not defined: -log-json #1020

TJM opened this issue Jun 30, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@TJM
Copy link
Contributor

TJM commented Jun 30, 2021

Overview of the Issue

Getting an error testing the latest helm chart code from this repo, plus a PR we need #1012

Reproduction Steps

Steps to reproduce this issue, eg:

Testing my PR (1012) which has the latest Helm Chart code plus my fix for ingress pathType... however this error has nothing to do with ingress pathType.

  1. When running helm install with the following values.yml:
global:
  image: "hashicorp/consul-enterprise:1.10.0-ent"
  datacenter: "us-central1"
  acls:
    manageSystemACLs: true
  tls:
    enabled: true
    enableAutoEncrypt: true
    verify: true
    httpsOnly: true
client:
  snapshotAgent:
    enabled: true
    replicas: 2
    configSecret:
      # The name of the Kubernetes secret.
      secretName: ${kubernetes_secret.consul_snapshot_agent.metadata.0.name}
      # The key of the Kubernetes secret.
      secretKey: agent_config
    serviceAccount:
      annotations: |
        "iam.gke.io/gcp-service-account": "${google_service_account.gke_nodes_services_cluster.email}"
    resources:
      requests:
        memory: "50Mi"
        cpu: "50m"
      limits:
        memory: "50Mi"
        cpu: "50m"
ui:
  ingress:
    annotations: | # https://cloud.google.com/kubernetes-engine/docs/how-to/load-balance-ingress#ingress_annotations
      kubernetes.io/ingress.class: gce
      kubernetes.io/ingress.global-static-ip-name: ${google_compute_global_address.consul.name}
      networking.gke.io/v1beta1.FrontendConfig: ${helm_release.consul_gcp_ingress_configs.name}
    enabled: true
    pathType: ImplementationSpecific
    hosts:
      - host: ${trimsuffix(google_dns_record_set.consul.name, ".")}
        paths:
          - /* # Google wants /* instead of /
    tls:
      - hosts:
        - consul.domain.com
        secretName: ${kubernetes_secret.consul_pki.metadata.0.name}
  service:
    type: NodePort
    annotations: | # https://cloud.google.com/kubernetes-engine/docs/how-to/load-balance-ingress#service_annotations_related_to_ingress
      cloud.google.com/app-protocols: '{"https":"HTTPS","http":"HTTP"}'
      cloud.google.com/backend-config: '{"default": "${helm_release.consul_gcp_ingress_configs.name}"}'
server:
  enterpriseLicense:
    secretName: ${kubernetes_secret.consul_enterprise_license.metadata.0.name}
    secretKey: license-key
  extraConfig: |
    {
      "audit": {
        "enabled": true,
        "sink": {
          "stdout": {
              "type": "file",
              "format": "json",
              "path": "/dev/stdout",
              "delivery_guarantee": "best-effort"
          }
        }
      }
    }
  1. View error

Logs

[tmcneely@local ~]$ k get po
NAME                           READY   STATUS   RESTARTS   AGE
consul-consul-tls-init-27k5q   0/1     Error    0          2m53s
consul-consul-tls-init-2m85t   0/1     Error    0          2m43s
consul-consul-tls-init-qvzgv   0/1     Error    0          2m33s
consul-consul-tls-init-xbqqv   0/1     Error    0          2m13s
consul-consul-tls-init-z9m6s   0/1     Error    0          93s
[tmcneely@local ~]$ k logs consul-consul-tls-init-z9m6s
flag provided but not defined: -log-json
Usage:
  -additional-dnsname value
    	Additional DNS name to add to the Consul server certificate as Subject Alternative Name. localhost is always included. This flag may be provided multiple times.
  -additional-ipaddress value
    	Additional IP address to add to the Consul server certificate as the Subject Alternative Name. 127.0.0.1 is always included. This flag may be provided multiple times.
  -ca string
    	Path to the CA certificate file.
  -days int
    	The number of days the Consul server certificate is valid for from now on. Defaults to 5 years. (default 1825)
  -dc string
    	Datacenter of the Consul cluster. Defaults to dc1. (default "dc1")
  -domain string
    	Domain of consul cluster. Only used in combination with -name-constraint. Defaults to consul. (default "consul")
  -k8s-namespace string
    	Name of Kubernetes namespace where secrets should be created and read from. (default "default")
  -key string
    	Path to the CA key file.
  -kubeconfig value
    	The path to a kubeconfig file to use for authentication. If this is blank, the default kubeconfig path (~/.kube/config) will be checked. If no kubeconfig is found, in-cluster auth will be used.
  -log-level string
    	Log verbosity level. Supported values (in order of detail) are "trace", "debug", "info", "warn", and "error". (default "info")
  -name-prefix string
    	Name prefix for secrets containing the CA, server certificate and private key
Failed to parse args: flag provided but not defined: -log-json

Expected behavior

What was the expected result? working deployment?

Environment details

If not already included, please provide the following:

  • consul-k8s version: 1.19.10-gke.1600
  • consul-helm version: 0.32.1+PR1012
  • values.yaml used to deploy the helm chart: (See above)

Additionally, please provide details regarding the Kubernetes Infrastructure, if known:

  • Cloud Provider (If self-hosted, the Kubernetes provider utilized): Google
  • Networking CNI plugin in use: calico?

Additional Context

I think it may be related to a recent PR #980

@TJM TJM added the bug Something isn't working label Jun 30, 2021
@david-yu
Copy link
Contributor

david-yu commented Jun 30, 2021

Hi @TJM I would suggest pinning your imagek8s image to 0.26.0 since the code that was merged in our our main branch is dependent on a new build of consul-k8s.

@TJM
Copy link
Contributor Author

TJM commented Jun 30, 2021

Shouldn't the values.yaml file be updated if the code depends on a new version? :-/

I do confirm that after removing PR 980, it worked as expected.

EDIT: Actually from what I can tell, the values.yaml does set imageK8s to that version, as per:

imageK8S: "hashicorp/consul-k8s:0.26.0"

I pasted my entire values file, but did not interpolate the tf variables (sorry). I am not setting global.imageK8s, so it should be the default (hashicorp/consul-k8s:0.26.0)

@david-yu
Copy link
Contributor

david-yu commented Jun 30, 2021

We don't have a new version built yet for consul-k8s which is why it is not set as the default for imagek8s. When we release our next version of Consul K8s which we build and push the image (i.e. 0.27.0) and provide a new Helm release in our repo.

@TJM
Copy link
Contributor Author

TJM commented Jun 30, 2021

OK, for now I have pulled that PR from my "testing" to get my environment up and running. I know I am on thin ice using unreleased code, but we needed the fix from PR1012 for GKE stupidity :) ..

@kschoche
Copy link
Contributor

kschoche commented Jun 30, 2021

Sorry about this @TJM ! These changes went into helm last night, alongside a PR to consul-k8s, so if you're using unreleased versions of either its occassionally possible that you'd need to use a source checkout of both consul-k8s and consul-helm. In the current state of things our CI will run against docker.mirror.hashicorp.services/hashicorpdev/consul-k8s:latest which is a known working image between helm/consul-k8s, you could use this instead of checking out and building your own consul-k8s image. Unfortunately this will be a necessity until we release 0.27 :( Sorry for the inconvenience!

@TJM
Copy link
Contributor Author

TJM commented Jun 30, 2021

no worries! Like I said, I am just testing out my PR and ran into this... all good. we can close this.

@TJM TJM closed this as completed Jun 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants