kubernetes-sigs / external-dns

Configure external DNS servers (AWS Route53, Google CloudDNS and others) for Kubernetes Ingresses and Services
Apache License 2.0
7.68k stars 2.56k forks source link

--version command not working? #1904

Closed james-callahan closed 2 years ago

james-callahan commented 3 years ago

What happened:

Passing --version results in nothing printed

$ docker pull eu.gcr.io/k8s-artifacts-prod/external-dns/external-dns:v0.7.5
v0.7.5: Pulling from k8s-artifacts-prod/external-dns/external-dns
Digest: sha256:ec0b0f8fe353f827511e3e74493e2b77f5ba5def83baf403f9e36ef7dfd7f5f6
Status: Image is up to date for eu.gcr.io/k8s-artifacts-prod/external-dns/external-dns:v0.7.5
eu.gcr.io/k8s-artifacts-prod/external-dns/external-dns:v0.7.5
$ docker run -it  eu.gcr.io/k8s-artifacts-prod/external-dns/external-dns:v0.7.5 --version

$ 
other options (such as `--help` work fine): ``` $ docker run -it eu.gcr.io/k8s-artifacts-prod/external-dns/external-dns:v0.7.5 --help usage: external-dns --source=source --provider=provider [] ExternalDNS synchronizes exposed Kubernetes Services and Ingresses with DNS providers. Note that all flags may be replaced with env vars - `--flag` -> `EXTERNAL_DNS_FLAG=1` or `--flag value` -> `EXTERNAL_DNS_FLAG=value` Flags: --help Show context-sensitive help (also try --help-long and --help-man). --version Show application version. --server="" The Kubernetes API server to connect to (default: auto-detect) --kubeconfig="" Retrieve target cluster configuration from a Kubernetes configuration file (default: auto-detect) --request-timeout=30s Request timeout when calling Kubernetes APIs. 0s means no timeout --cf-api-endpoint="" The fully-qualified domain name of the cloud foundry instance you are targeting --cf-username="" The username to log into the cloud foundry API --cf-password="" The password to log into the cloud foundry API --contour-load-balancer="heptio-contour/contour" The fully-qualified name of the Contour load balancer service. (default: heptio-contour/contour) --skipper-routegroup-groupversion="zalando.org/v1" The resource version for skipper routegroup --source=source ... The resource types that are queried for endpoints; specify multiple times for multiple sources (required, options: service, ingress, node, fake, connector, istio-gateway, istio-virtualservice, cloudfoundry, contour-ingressroute, contour-httpproxy, crd, empty, skipper-routegroup,openshift-route) --namespace="" Limit sources of endpoints to a specific namespace (default: all namespaces) --annotation-filter="" Filter sources managed by external-dns via annotation using label selector semantics (default: all sources) --label-filter="" Filter sources managed by external-dns via label selector when listing all resources; currently only supported by source CRD --fqdn-template="" A templated string that's used to generate DNS names from sources that don't define a hostname themselves, or to add a hostname suffix when paired with the fake source (optional). Accepts comma separated list for multiple global FQDN. --combine-fqdn-annotation Combine FQDN template and Annotations instead of overwriting --ignore-hostname-annotation Ignore hostname annotation when generating DNS names, valid only when using fqdn-template is set (optional, default: false) --ignore-ingress-tls-spec Ignore tls spec section in ingresses resources, applicable only for ingress sources (optional, default: false) --compatibility= Process annotation semantics from legacy implementations (optional, options: mate, molecule) --publish-internal-services Allow external-dns to publish DNS records for ClusterIP services (optional) --publish-host-ip Allow external-dns to publish host-ip for headless services (optional) --always-publish-not-ready-addresses Always publish also not ready addresses for headless services (optional) --connector-source-server="localhost:8080" The server to connect for connector source, valid only when using connector source --crd-source-apiversion="externaldns.k8s.io/v1alpha1" API version of the CRD for crd source, e.g. `externaldns.k8s.io/v1alpha1`, valid only when using crd source --crd-source-kind="DNSEndpoint" Kind of the CRD for the crd source in API group and version specified by crd-source-apiversion --service-type-filter=SERVICE-TYPE-FILTER ... The service types to take care about (default: all, expected: ClusterIP, NodePort, LoadBalancer or ExternalName) --provider=provider The DNS provider where the DNS records will be created (required, options: aws, aws-sd, google, azure, azure-dns, azure-private-dns, cloudflare, rcodezero, digitalocean, hetzner, dnsimple, akamai, infoblox, dyn, designate, coredns, skydns, inmemory, ovh, pdns, oci, exoscale, linode, rfc2136, ns1, transip, vinyldns, rdns, scaleway, vultr, ultradns) --domain-filter= ... Limit possible target zones by a domain suffix; specify multiple times for multiple domains (optional) --exclude-domains= ... Exclude subdomains (optional) --zone-name-filter= ... Filter target zones by zone domain (For now, only AzureDNS provider is using this flag); specify multiple times for multiple zones (optional) --zone-id-filter= ... Filter target zones by hosted zone id; specify multiple times for multiple zones (optional) --google-project="" When using the Google provider, current project is auto-detected, when running on GCP. Specify other project with this. Must be specified when running outside GCP. --google-batch-change-size=1000 When using the Google provider, set the maximum number of changes that will be applied in each batch. --google-batch-change-interval=1s When using the Google provider, set the interval between batch changes. --alibaba-cloud-config-file="/etc/kubernetes/alibaba-cloud.json" When using the Alibaba Cloud provider, specify the Alibaba Cloud configuration file (required when --provider=alibabacloud --alibaba-cloud-zone-type= When using the Alibaba Cloud provider, filter for zones of this type (optional, options: public, private) --aws-zone-type= When using the AWS provider, filter for zones of this type (optional, options: public, private) --aws-zone-tags= ... When using the AWS provider, filter for zones with these tags --aws-assume-role="" When using the AWS provider, assume this IAM role. Useful for hosted zones in another AWS account. Specify the full ARN, e.g. `arn:aws:iam::123455567:role/external-dns` (optional) --aws-batch-change-size=1000 When using the AWS provider, set the maximum number of changes that will be applied in each batch. --aws-batch-change-interval=1s When using the AWS provider, set the interval between batch changes. --aws-evaluate-target-health When using the AWS provider, set whether to evaluate the health of a DNS target (default: enabled, disable with --no-aws-evaluate-target-health) --aws-api-retries=3 When using the AWS provider, set the maximum number of retries for API calls before giving up. --aws-prefer-cname When using the AWS provider, prefer using CNAME instead of ALIAS (default: disabled) --aws-zones-cache-duration=0s When using the AWS provider, set the zones list cache TTL (0s to disable). --azure-config-file="/etc/kubernetes/azure.json" When using the Azure provider, specify the Azure configuration file (required when --provider=azure --azure-resource-group="" When using the Azure provider, override the Azure resource group to use (required when --provider=azure-private-dns) --azure-subscription-id="" When using the Azure provider, specify the Azure configuration file (required when --provider=azure-private-dns) --azure-user-assigned-identity-client-id="" When using the Azure provider, override the client id of user assigned identity in config file (optional) --cloudflare-proxied When using the Cloudflare provider, specify if the proxy mode must be enabled (default: disabled) --cloudflare-zones-per-page=50 When using the Cloudflare provider, specify how many zones per page listed, max. possible 50 (default: 50) --coredns-prefix="/skydns/" When using the CoreDNS provider, specify the prefix name --akamai-serviceconsumerdomain="" When using the Akamai provider, specify the base URL (required when --provider=akamai) --akamai-client-token="" When using the Akamai provider, specify the client token (required when --provider=akamai) --akamai-client-secret="" When using the Akamai provider, specify the client secret (required when --provider=akamai) --akamai-access-token="" When using the Akamai provider, specify the access token (required when --provider=akamai) --infoblox-grid-host="" When using the Infoblox provider, specify the Grid Manager host (required when --provider=infoblox) --infoblox-wapi-port=443 When using the Infoblox provider, specify the WAPI port (default: 443) --infoblox-wapi-username="admin" When using the Infoblox provider, specify the WAPI username (default: admin) --infoblox-wapi-password="" When using the Infoblox provider, specify the WAPI password (required when --provider=infoblox) --infoblox-wapi-version="2.3.1" When using the Infoblox provider, specify the WAPI version (default: 2.3.1) --infoblox-ssl-verify When using the Infoblox provider, specify whether to verify the SSL certificate (default: true, disable with --no-infoblox-ssl-verify) --infoblox-view="" DNS view (default: "") --infoblox-max-results=0 Add _max_results as query parameter to the URL on all API requests. The default is 0 which means _max_results is not set and the default of the server is used. --dyn-customer-name="" When using the Dyn provider, specify the Customer Name --dyn-username="" When using the Dyn provider, specify the Username --dyn-password="" When using the Dyn provider, specify the pasword --dyn-min-ttl=DYN-MIN-TTL Minimal TTL (in seconds) for records. This value will be used if the provided TTL for a service/ingress is lower than this. --oci-config-file="/etc/kubernetes/oci.yaml" When using the OCI provider, specify the OCI configuration file (required when --provider=oci --rcodezero-txt-encrypt When using the Rcodezero provider with txt registry option, set if TXT rrs are encrypted (default: false) --inmemory-zone= ... Provide a list of pre-configured zones for the inmemory provider; specify multiple times for multiple zones (optional) --ovh-endpoint="ovh-eu" When using the OVH provider, specify the endpoint (default: ovh-eu) --ovh-api-rate-limit=20 When using the OVH provider, specify the API request rate limit, X operations by seconds (default: 20) --pdns-server="http://localhost:8081" When using the PowerDNS/PDNS provider, specify the URL to the pdns server (required when --provider=pdns) --pdns-api-key="" When using the PowerDNS/PDNS provider, specify the API key to use to authorize requests (required when --provider=pdns) --pdns-tls-enabled When using the PowerDNS/PDNS provider, specify whether to use TLS (default: false, requires --tls-ca, optionally specify --tls-client-cert and --tls-client-cert-key) --ns1-endpoint="" When using the NS1 provider, specify the URL of the API endpoint to target (default: https://api.nsone.net/v1/) --ns1-ignoressl When using the NS1 provider, specify whether to verify the SSL certificate (default: false) --ns1-min-ttl=NS1-MIN-TTL Minimal TTL (in seconds) for records. This value will be used if the provided TTL for a service/ingress is lower than this. --digitalocean-api-page-size=50 Configure the page size used when querying the DigitalOcean API. --tls-ca="" When using TLS communication, the path to the certificate authority to verify server communications (optionally specify --tls-client-cert for two-way TLS) --tls-client-cert="" When using TLS communication, the path to the certificate to present as a client (not required for TLS) --tls-client-cert-key="" When using TLS communication, the path to the certificate key to use with the client certificate (not required for TLS) --exoscale-endpoint="https://api.exoscale.ch/dns" Provide the endpoint for the Exoscale provider --exoscale-apikey="" Provide your API Key for the Exoscale provider --exoscale-apisecret="" Provide your API Secret for the Exoscale provider --rfc2136-host="" When using the RFC2136 provider, specify the host of the DNS server --rfc2136-port=0 When using the RFC2136 provider, specify the port of the DNS server --rfc2136-zone="" When using the RFC2136 provider, specify the zone entry of the DNS server to use --rfc2136-insecure When using the RFC2136 provider, specify whether to attach TSIG or not (default: false, requires --rfc2136-tsig-keyname and rfc2136-tsig-secret) --rfc2136-tsig-keyname="" When using the RFC2136 provider, specify the TSIG key to attached to DNS messages (required when --rfc2136-insecure=false) --rfc2136-tsig-secret="" When using the RFC2136 provider, specify the TSIG (base64) value to attached to DNS messages (required when --rfc2136-insecure=false) --rfc2136-tsig-secret-alg="" When using the RFC2136 provider, specify the TSIG (base64) value to attached to DNS messages (required when --rfc2136-insecure=false) --rfc2136-tsig-axfr When using the RFC2136 provider, specify the TSIG (base64) value to attached to DNS messages (required when --rfc2136-insecure=false) --rfc2136-min-ttl=0s When using the RFC2136 provider, specify minimal TTL (in duration format) for records. This value will be used if the provided TTL for a service/ingress is lower than this --transip-account="" When using the TransIP provider, specify the account name (required when --provider=transip) --transip-keyfile="" When using the TransIP provider, specify the path to the private key file (required when --provider=transip) --policy=sync Modify how DNS records are synchronized between sources and providers (default: sync, options: sync, upsert-only, create-only) --registry=txt The registry implementation to use to keep track of DNS record ownership (default: txt, options: txt, noop, aws-sd) --txt-owner-id="default" When using the TXT registry, a name that identifies this instance of ExternalDNS (default: default) --txt-prefix="" When using the TXT registry, a custom string that's prefixed to each ownership DNS record (optional). Mutual exclusive with txt-suffix! --txt-suffix="" When using the TXT registry, a custom string that's suffixed to the host portion of each ownership DNS record (optional). Mutual exclusive with txt-prefix! --txt-wildcard-replacement="" When using the TXT registry, a custom string that's used instead of an asterisk for TXT records corresponding to wildcard DNS records (optional) --txt-cache-interval=0s The interval between cache synchronizations in duration format (default: disabled) --interval=1m0s The interval between two consecutive synchronizations in duration format (default: 1m) --once When enabled, exits the synchronization loop after the first iteration (default: disabled) --dry-run When enabled, prints DNS record changes rather than actually performing them (default: disabled) --events When enabled, in addition to running every interval, the reconciliation loop will get triggered when supported sources change (default: disabled) --log-format=text The format in which log messages are printed (default: text, options: text, json) --metrics-address=":7979" Specify where to serve the metrics and health check endpoint (default: :7979) --log-level=info Set the level of logging. (default: info, options: panic, debug, info, warning, error, fatal ```

What you expected to happen:

A version number would be printed

Raffo commented 3 years ago

I might have broken it with the multi-arch support change, see this line https://github.com/kubernetes-sigs/external-dns/blob/master/Makefile#L99. I will take care of taking a look at this for the 0.7.6 release.

Raffo commented 3 years ago

I took a look and from what I can see, this log contains info on the most probably cause:https://storage.googleapis.com/kubernetes-jenkins/logs/post-external-dns-push-images/1341146041256251392/artifacts/build.log

#10 452.0 fatal: not a git repository (or any of the parent directories): .git
#10 452.0 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/external-dns -v -ldflags "-X sigs.k8s.io/external-dns/pkg/apis/externaldns.Version= -w -s" .

we basically fail to determine the git tag and thus don't pass it to the version build tag. I'm going to take a deeper look at why this is happening.

ajayk commented 3 years ago

@Raffo I can take a stab at this, if you can point me which step packages the code and places it in the google storage bucket?

I downloaded the code from the logs pointed above: gs://k8s-staging-external-dns-gcb/source/1608589119.09-90b62ea375634a908b26462bc6585029.tgz# i couldn't find the .git directory

i was able to run the cloud build on my fork , the version is being set up correctly

#10 668.4 google.golang.org/protobuf/internal/detrand
#10 668.3 github.com/cespare/xxhash/v2
#10 668.2 github.com/beorn7/perks/quantile
#10 668.1 net
#10 665.6 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/external-dns -v -ldflags "-X sigs.k8s.io/external-dns/pkg/apis/externaldns.Version=3aed4c0 -w -s" 
fejta-bot commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale

james-callahan commented 3 years ago

confirmed to still be an issue in 0.8.0.

fejta-bot commented 3 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten

james-callahan commented 3 years ago

/remove-lifecycle rotten

k8s-triage-robot commented 3 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 3 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

james-callahan commented 3 years ago

/lifecycle rotten

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-ci-robot commented 2 years ago

@k8s-triage-robot: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/external-dns/issues/1904#issuecomment-968247799): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues and PRs according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue or PR with `/reopen` >- Mark this issue or PR as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.