Skip to content

External-dns and new clusterissuer dns01 Cloudflare - #374

Merged
Andrei Kvapil (kvaps) merged 8 commits into
cozystack:mainfrom
mrkhachaturov:external-dns
Oct 4, 2024
Merged

External-dns and new clusterissuer dns01 Cloudflare#374
Andrei Kvapil (kvaps) merged 8 commits into
cozystack:mainfrom
mrkhachaturov:external-dns

Conversation

@mrkhachaturov

@mrkhachaturov Mr. Khachaturov (mrkhachaturov) commented Sep 27, 2024

Copy link
Copy Markdown
Contributor

Overview

This pull request introduces the integration of External-DNS into the full bundles and adds support for a dns01 ClusterIssuer using Cloudflare. It enhances the DNS management capabilities for our deployments by allowing dynamic DNS record management directly from Kubernetes resources.

Changes Made

  1. External-DNS Integration:
  • Added External-DNS to the full deployment bundles.

  • Configured External-DNS to automatically manage DNS records for services within the Kubernetes cluster ( we must discuss how to configure external-dns via configmap or create an application in tenant external-dns where we can define values).

We must define some additional annotations for ingresses in order to make external-dns work , so we must discuss this also which is best method to configure it ( from configmap or dashboard ).

2. dns01 ClusterIssuer for Cloudflare:

  • Implemented support for a dns01 ClusterIssuer using Cloudflare.
  • This allows for automated certificate issuance via DNS challenge, leveraging Cloudflare as the DNS provider.
  • The configuration can be defined in the Cozystack ConfigMap
  1. Default Ingress Configuration:
  • Updated the default Ingress resources to use Cloudflare for DNS challenges.
  • Ensured that if the Cloudflare issuer is defined in the Cozystack ConfigMap, it will be utilized for all default Ingresses, streamlining the deployment process and improving reliability.

Benefits

  • Automated DNS Management: With External-DNS, DNS entries will be created and updated automatically based on the state of Kubernetes resources, reducing manual overhead.
  • Seamless Certificate Management: The dns01 ClusterIssuer integration allows for automated SSL/TLS certificate issuance, enhancing security for deployed applications.
  • Flexibility in Configuration: Users can easily switch between different issuers by updating the Cozystack ConfigMap, providing flexibility in the choice of DNS and certificate management solutions.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new external-dns release with support for managing DNS records in Kubernetes.
    • Added configuration options for DNS synchronization policies and provider settings.
    • Implemented a new lookup for issuer types in Ingress configurations.
    • Expanded configuration with new entries for external-dns in multiple deployment files, enhancing deployment flexibility.
  • Documentation

    • Comprehensive README and configuration schema for the external-dns Helm chart added, detailing installation and customization options.
  • Improvements

    • Enhanced RBAC configuration for flexible permissions management.
    • Updated annotations and health check configurations for better service monitoring.

@coderabbitai

coderabbitai Bot commented Sep 27, 2024

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

Andrei Kvapil (@kvaps) has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 8 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Files that changed from the base of the PR and between ba8d35a and d4ebcd8.

Walkthrough

The changes introduce a new configuration for the external-dns service across multiple YAML files. New release entries have been added to distro-full.yaml, paas-full.yaml, distro-hosted.yaml, and paas-hosted.yaml. Each entry specifies the external-dns service, utilizing the cozy-external-dns chart and deployed in the cozy-external-dns namespace. Dependencies on cilium and kubeovn are included where applicable, while existing configurations remain unchanged.

Changes

File Path Change Summary
packages/core/platform/bundles/distro-full.yaml Added new release entry for external-dns with dependencies on cilium.
packages/core/platform/bundles/paas-full.yaml Added new release entry for external-dns with dependencies on cilium and kubeovn.
packages/core/platform/bundles/distro-hosted.yaml Added new release entry for external-dns without dependencies.
packages/core/platform/bundles/paas-hosted.yaml Added new release entry for external-dns with dependencies on cilium and kubeovn; corrected indentation for telepresence namespace.

🐰 In the garden where bunnies roam,
New external-dns finds a home.
With charts and roles, it hops with glee,
Managing DNS, as happy as can be!
Configs and templates, all in a row,
A joyful dance, watch it grow! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mrkhachaturov Mr. Khachaturov (mrkhachaturov) changed the title External-dns and new clusterissuer dns01 Clouflare External-dns and new clusterissuer dns01 Cloudflare Sep 27, 2024

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

🧹 Outside diff range and nitpick comments (47)
packages/system/external-dns/.helmignore (1)

1-3: LGTM! Consider adding more common ignore patterns.

The current entries in the .helmignore file are appropriate and will help keep the Helm chart clean. Good job on including images, hack, and .gitkeep.

Consider adding these common ignore patterns to make the .helmignore file more comprehensive:

 images
 hack
 .gitkeep
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/

These additional patterns will help exclude version control system files, backup files, and IDE-specific files, which are typically not needed in a Helm chart.

packages/system/external-dns/charts/external-dns/ci/ci-values.yaml (1)

1-2: LGTM! Consider adding a comment for clarity.

The configuration looks good and is appropriate for CI purposes. The use of the "inmemory" provider is perfect for testing the external-dns chart without affecting real DNS records.

Consider adding a comment at the top of the file to explain its purpose, like this:

# CI configuration for external-dns chart
# Uses in-memory provider for testing without affecting real DNS records
provider:
  name: inmemory

This addition would improve clarity for other developers who might work on this file in the future.

packages/system/external-dns/Chart.yaml (1)

1-3: LGTM! Consider adding more metadata.

The basic structure of the Chart.yaml file is correct and follows Helm 3 conventions. The use of a placeholder version (0.0.0) is a good practice for automated versioning during the build process.

To enhance the chart's documentation and maintainability, consider adding more metadata fields such as description, type, appVersion, and maintainers. Here's an example of how you could expand the file:

apiVersion: v2
name: cozy-external-dns
version: 0.0.0 # Placeholder, the actual version will be automatically set during the build process
description: A Helm chart for deploying ExternalDNS in the Cozystack environment
type: application
appVersion: "0.13.1"  # Replace with the actual ExternalDNS version being used
maintainers:
  - name: Cozystack Team
    email: team@cozystack.io

These additional fields provide more context about the chart and make it easier for other developers to understand its purpose and maintenance status.

packages/system/external-dns/Makefile (2)

6-10: LGTM: Well-structured 'update' target with a minor suggestion.

The 'update' target is well-structured and follows a logical sequence of operations. It correctly manages the external-dns chart using Helm commands.

Consider adding a -p flag to the rm command for safer execution:

 update:
-	rm -rf charts
+	rm -rf -p charts
 	helm repo add external-dns https://kubernetes-sigs.github.io/external-dns/
 	helm repo update external-dns
 	helm pull external-dns/external-dns --untar --untardir charts

This change ensures that rm doesn't throw an error if the 'charts' directory doesn't exist.


1-10: Overall, excellent Makefile for managing external-dns chart.

This Makefile is well-structured and aligns perfectly with the PR objectives. It provides a clear and maintainable way to manage the external-dns chart, which is crucial for the integration of External-DNS into the deployment bundles. The use of variables, inclusion of a parent Makefile, and the well-defined 'update' target all contribute to a robust and flexible configuration.

As the project grows, consider creating a common.mk file for shared variables like NAMESPACE prefix, if not already present. This would enhance consistency across different package Makefiles.

packages/system/external-dns/charts/external-dns/.helmignore (2)

4-4: LGTM: Ignoring system-specific files

Including .DS_Store is a good practice, especially for cross-platform development.

Consider adding Thumbs.db to ignore Windows-specific thumbnail cache files:

 .DS_Store
+Thumbs.db

19-23: LGTM: Good coverage of IDE-specific files

The list covers some of the most popular IDEs, which is good for maintaining a clean package.

Consider adding patterns for a few more IDEs to make it more comprehensive:

 .project
 .idea/
 *.tmproj
 .vscode/
+*.sublime-project
+*.sublime-workspace
+.atom/
+.vs/
+*.code-workspace

These additions would cover Sublime Text, Atom, Visual Studio, and an alternative Visual Studio Code workspace file.

packages/system/external-dns/charts/external-dns/templates/serviceaccount.yaml (1)

1-17: Well-structured ServiceAccount template with good practices.

The template for creating a ServiceAccount is well-designed and follows Kubernetes best practices. Here are some positive aspects:

  1. Conditional creation based on .Values.serviceAccount.create.
  2. Proper use of API version and kind for ServiceAccount.
  3. Utilization of the include function for name and labels, promoting consistency.
  4. Support for custom labels and annotations.
  5. Configurable automountServiceAccountToken for security considerations.

For improved readability, consider adding a blank line before line 16 to separate the automountServiceAccountToken field from the metadata section:

  {{- end }}
+
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/templates/clusterrolebinding.yaml (2)

3-7: LGTM: Dynamic resource kind and metadata, with a suggestion.

The dynamic resource kind and metadata section are well-implemented, allowing for flexible deployment options. The use of templating for name and labels ensures consistency across resources.

Consider adding a comment explaining the purpose of the "-viewer" suffix in the resource name. This will help clarify its intended use for future maintainers.


1-16: Overall: Well-implemented RBAC configuration for external-dns.

This file successfully implements a flexible RBAC configuration for external-dns, aligning with the PR objectives. Key points:

  1. Conditional creation of RoleBinding or ClusterRoleBinding based on the namespaced value.
  2. Dynamic resource naming and labeling using Helm templating.
  3. Proper reference to the associated Role/ClusterRole and ServiceAccount.

The implementation allows for easy configuration changes and supports both namespaced and cluster-wide deployments, which is crucial for the integration of External-DNS into various deployment scenarios.

Consider documenting the expected values for .Values.rbac.create and .Values.namespaced in the chart's README or values.yaml file to guide users in properly configuring these RBAC resources.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/RELEASE.md (1)

1-3: Update the pull request number in the release notes.

The update to ExternalDNS v0.15.0 is good, but the pull request number is missing. Please replace "xxxx" with the actual pull request number for proper documentation and traceability.

packages/system/external-dns/charts/external-dns/templates/service.yaml (2)

1-12: LGTM! Consider adding a comment for clarity.

The metadata section is well-structured and follows Helm chart best practices. The use of template functions and conditional inclusion of annotations is correct.

Consider adding a brief comment before line 1 to explain the purpose of the $providerName variable, as it's used later in the template. For example:

{{- /* Define provider name for conditional logic later in the template */ -}}
{{- $providerName := include "external-dns.providerName" . }}
🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


13-36: LGTM! Consider simplifying the conditional webhook port logic.

The service specification is well-structured and correctly implements the required functionality. The use of conditional logic for IP families and ports is appropriate.

Consider simplifying the conditional logic for the webhook port by moving the with statement inside the if block. This can reduce nesting and improve readability:

  ports:
    - name: http
      port: {{ .Values.service.port }}
      targetPort: http
      protocol: TCP
    {{- if eq $providerName "webhook" }}
    {{- with .Values.provider.webhook.service }}
    - name: http-webhook
      port: {{ .port }}
      targetPort: http-webhook
      protocol: TCP
    {{- end }}
    {{- end }}

This change maintains the same functionality while slightly improving the template's readability.

packages/extra/ingress/templates/dashboard.yaml (3)

1-2: Approve the dynamic configuration lookup with a suggestion.

The addition of the ConfigMap lookup for the cluster issuer type is a good improvement, allowing for dynamic configuration. This change aligns well with the PR objectives of enhancing flexibility in configuration.

Consider adding a comment explaining the purpose of this lookup and the possible values for clusterissuer. This would improve code readability and maintainability. For example:

{{- /* Lookup the cluster issuer type from the cozystack ConfigMap. Possible values: "http01", "cloudflare" */ -}}
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}
🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


13-16: Approve the conditional annotation with a suggestion for clarity.

The addition of the conditional block for setting the acme.cert-manager.io/http01-ingress-class annotation based on the issuer type is correct and aligns with the PR objectives. This allows for proper configuration when using different issuers, such as Cloudflare for DNS challenges.

To improve code clarity and maintainability, consider restructuring the conditional block as follows:

{{- if ne $issuerType "cloudflare" }}
    acme.cert-manager.io/http01-ingress-class: tenant-root
{{- end }}

This change eliminates the empty else block and makes the condition more explicit, improving readability.

🧰 Tools
🪛 yamllint

[error] 13-13: trailing spaces

(trailing-spaces)


[error] 14-14: trailing spaces

(trailing-spaces)


[error] 15-15: trailing spaces

(trailing-spaces)


[error] 16-16: trailing spaces

(trailing-spaces)


1-35: Address trailing spaces throughout the file.

The static analysis tool has reported multiple instances of trailing spaces in the file. While these don't affect functionality, removing them can improve code cleanliness and prevent unnecessary diffs in version control.

Consider running a linter or using an editor feature to remove trailing spaces throughout the file. This will improve code consistency and adhere to common YAML style guidelines.

Note: The syntax error reported on line 1 appears to be a false positive due to the Go templating syntax and can be safely ignored.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


[error] 4-4: trailing spaces

(trailing-spaces)


[error] 5-5: trailing spaces

(trailing-spaces)


[error] 7-7: trailing spaces

(trailing-spaces)


[error] 8-8: trailing spaces

(trailing-spaces)


[error] 9-9: trailing spaces

(trailing-spaces)


[error] 10-10: trailing spaces

(trailing-spaces)


[error] 11-11: trailing spaces

(trailing-spaces)


[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 14-14: trailing spaces

(trailing-spaces)


[error] 15-15: trailing spaces

(trailing-spaces)


[error] 16-16: trailing spaces

(trailing-spaces)


[error] 17-17: trailing spaces

(trailing-spaces)


[error] 18-18: trailing spaces

(trailing-spaces)


[error] 19-19: trailing spaces

(trailing-spaces)


[error] 20-20: trailing spaces

(trailing-spaces)


[error] 21-21: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[error] 24-24: trailing spaces

(trailing-spaces)


[error] 25-25: trailing spaces

(trailing-spaces)


[error] 26-26: trailing spaces

(trailing-spaces)


[error] 27-27: trailing spaces

(trailing-spaces)


[error] 28-28: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)


[error] 30-30: trailing spaces

(trailing-spaces)


[error] 31-31: trailing spaces

(trailing-spaces)


[error] 32-32: trailing spaces

(trailing-spaces)


[error] 33-33: trailing spaces

(trailing-spaces)


[error] 34-34: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)

packages/system/external-dns/charts/external-dns/Chart.yaml (1)

13-33: Comprehensive chart metadata with room for minor improvement.

The chart metadata is well-structured and provides essential information for users. The appVersion and version are consistent with the changes mentioned in the annotations.

Consider adding a brief note in the description or as a separate annotation to highlight the new features related to Cloudflare DNS01 ClusterIssuer support, as mentioned in the PR objectives. This would provide users with immediate visibility into this significant enhancement.

packages/system/cert-manager-issuers/templates/cluster-issuers.yaml (4)

1-2: LGTM! Consider enhancing readability.

The dynamic configuration approach using ConfigMap lookup is well-implemented and aligns with the PR objectives. It provides flexibility in configuration as mentioned in the PR summary.

Consider adding a brief comment explaining the purpose of these variables for better readability:

{{- /* Lookup ConfigMap for dynamic configuration */ -}}
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}  
{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}
🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


4-24: LGTM! Fix indentation for better readability.

The dynamic solver configuration for the letsencrypt-prod ClusterIssuer is well-implemented and aligns with the PR objectives. It correctly supports both dns01 (Cloudflare) and http01 (NGINX ingress) challenge types based on the $issuerType variable.

Please fix the indentation issues to improve readability and consistency:

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-prod
spec:
  acme:
    privateKeySecretRef:
      name: letsencrypt-prod
    server: https://acme-v02.api.letsencrypt.org/directory
    solvers:
    - {{- if eq $issuerType "cloudflare" }}
      dns01:
        cloudflare:
          apiTokenSecretRef:
            name: cloudflare-api-token-secret
            key: api-token
    {{- else }}
      http01:
        ingress:
          class: nginx
    {{- end }}
🧰 Tools
🪛 yamllint

[error] 4-4: trailing spaces

(trailing-spaces)


[error] 5-5: trailing spaces

(trailing-spaces)


[error] 6-6: trailing spaces

(trailing-spaces)


[error] 7-7: trailing spaces

(trailing-spaces)


[error] 8-8: trailing spaces

(trailing-spaces)


[error] 9-9: trailing spaces

(trailing-spaces)


[error] 10-10: trailing spaces

(trailing-spaces)


[error] 11-11: trailing spaces

(trailing-spaces)


[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 14-14: trailing spaces

(trailing-spaces)


[warning] 15-15: wrong indentation: expected 4 but found 8

(indentation)


[error] 15-15: trailing spaces

(trailing-spaces)


[error] 16-16: trailing spaces

(trailing-spaces)


[error] 17-17: trailing spaces

(trailing-spaces)


[error] 18-18: trailing spaces

(trailing-spaces)


[error] 19-19: trailing spaces

(trailing-spaces)


[warning] 20-20: wrong indentation: expected 4 but found 6

(indentation)


[error] 20-20: trailing spaces

(trailing-spaces)


[warning] 21-21: wrong indentation: expected 4 but found 8

(indentation)


[error] 21-21: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[warning] 24-24: wrong indentation: expected 4 but found 6

(indentation)


[error] 24-24: trailing spaces

(trailing-spaces)


51-56: LGTM! Add newline at end of file.

The selfsigned-cluster-issuer configuration is correct and doesn't require any changes.

Add a newline at the end of the file to comply with YAML best practices:

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: selfsigned-cluster-issuer
spec:
  selfSigned: {}
🧰 Tools
🪛 yamllint

[error] 51-51: trailing spaces

(trailing-spaces)


[error] 52-52: trailing spaces

(trailing-spaces)


[error] 53-53: trailing spaces

(trailing-spaces)


[error] 54-54: trailing spaces

(trailing-spaces)


[error] 55-55: trailing spaces

(trailing-spaces)


[error] 56-56: no new line character at the end of file

(new-line-at-end-of-file)


1-56: Overall, great implementation with minor formatting issues.

The changes successfully implement dynamic configuration for ClusterIssuers, supporting both Cloudflare DNS01 and HTTP01 challenge types as outlined in the PR objectives. The implementation allows for easy switching between different issuers by updating the ConfigMap, which enhances flexibility and maintainability.

Consider running a global formatting pass on the file to address the following issues:

  1. Remove trailing spaces at the end of lines.
  2. Ensure consistent indentation throughout the file (2 spaces for YAML is standard).
  3. Add a newline at the end of the file.

These formatting improvements will enhance readability and align with YAML best practices.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


[error] 4-4: trailing spaces

(trailing-spaces)


[error] 5-5: trailing spaces

(trailing-spaces)


[error] 6-6: trailing spaces

(trailing-spaces)


[error] 7-7: trailing spaces

(trailing-spaces)


[error] 8-8: trailing spaces

(trailing-spaces)


[error] 9-9: trailing spaces

(trailing-spaces)


[error] 10-10: trailing spaces

(trailing-spaces)


[error] 11-11: trailing spaces

(trailing-spaces)


[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 14-14: trailing spaces

(trailing-spaces)


[warning] 15-15: wrong indentation: expected 4 but found 8

(indentation)


[error] 15-15: trailing spaces

(trailing-spaces)


[error] 16-16: trailing spaces

(trailing-spaces)


[error] 17-17: trailing spaces

(trailing-spaces)


[error] 18-18: trailing spaces

(trailing-spaces)


[error] 19-19: trailing spaces

(trailing-spaces)


[warning] 20-20: wrong indentation: expected 4 but found 6

(indentation)


[error] 20-20: trailing spaces

(trailing-spaces)


[warning] 21-21: wrong indentation: expected 4 but found 8

(indentation)


[error] 21-21: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[warning] 24-24: wrong indentation: expected 4 but found 6

(indentation)


[error] 24-24: trailing spaces

(trailing-spaces)


[error] 26-26: trailing spaces

(trailing-spaces)


[error] 28-28: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)


[error] 30-30: trailing spaces

(trailing-spaces)


[error] 31-31: trailing spaces

(trailing-spaces)


[error] 32-32: trailing spaces

(trailing-spaces)


[error] 33-33: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)


[error] 36-36: trailing spaces

(trailing-spaces)


[error] 37-37: trailing spaces

(trailing-spaces)


[warning] 38-38: wrong indentation: expected 4 but found 8

(indentation)


[error] 38-38: trailing spaces

(trailing-spaces)


[error] 39-39: trailing spaces

(trailing-spaces)


[error] 40-40: trailing spaces

(trailing-spaces)


[error] 41-41: trailing spaces

(trailing-spaces)


[error] 42-42: trailing spaces

(trailing-spaces)


[warning] 43-43: wrong indentation: expected 4 but found 6

(indentation)


[error] 43-43: trailing spaces

(trailing-spaces)


[warning] 44-44: wrong indentation: expected 4 but found 8

(indentation)


[error] 44-44: trailing spaces

(trailing-spaces)


[error] 45-45: trailing spaces

(trailing-spaces)


[error] 46-46: trailing spaces

(trailing-spaces)


[warning] 47-47: wrong indentation: expected 4 but found 6

(indentation)


[error] 47-47: trailing spaces

(trailing-spaces)


[error] 49-49: trailing spaces

(trailing-spaces)


[error] 51-51: trailing spaces

(trailing-spaces)


[error] 52-52: trailing spaces

(trailing-spaces)


[error] 53-53: trailing spaces

(trailing-spaces)


[error] 54-54: trailing spaces

(trailing-spaces)


[error] 55-55: trailing spaces

(trailing-spaces)


[error] 56-56: no new line character at the end of file

(new-line-at-end-of-file)

packages/system/external-dns/charts/external-dns/values.schema.json (1)

55-91: LGTM: Service property is well-structured. Consider adding descriptions.

The service property is correctly implemented with appropriate sub-properties for annotations, IP families, IP family policy, and port. The use of enums for IP families and IP family policy ensures valid inputs, and the port is correctly defined as an integer.

To improve clarity and ease of use, consider adding description fields to each property. For example:

 "service": {
   "type": "object",
+  "description": "Configuration for the external-dns service",
   "properties": {
     "annotations": {
-      "type": "object"
+      "type": "object",
+      "description": "Annotations to add to the service"
     },
     "ipFamilies": {
+      "description": "List of IP families to use for the service",
       "type": "array",
       // ... rest of the ipFamilies definition
     },
     // ... add descriptions for ipFamilyPolicy and port
   }
 }

This addition would make the schema more self-documenting and easier for users to understand without referring to external documentation.

packages/system/external-dns/charts/external-dns/templates/servicemonitor.yaml (4)

8-16: LGTM: Flexible metadata configuration with a minor suggestion

The metadata section is well-structured:

  • Conditional inclusion of annotations from .Values.serviceMonitor.annotations allows for customization.
  • Labels are consistently applied using the include function.
  • Additional labels can be added, providing extensibility.

These practices offer good flexibility in resource identification and selection.

Consider adding a comment before line 14 to clarify the purpose of the additional labels, e.g.:

  labels:
    {{- include "external-dns.labels" . | nindent 4 }}
    # Additional custom labels
  {{- with .Values.serviceMonitor.additionalLabels }}
    {{- toYaml . | nindent 4 }}
  {{- end }}

This would improve readability and make the purpose of this block more explicit.


17-24: LGTM: Well-configured spec with a suggestion for enhanced flexibility

The spec section is correctly configured:

  • The jobLabel is appropriately set to "app.kubernetes.io/instance".
  • The namespaceSelector correctly targets the release namespace.
  • The selector uses labels from a template function, ensuring consistency.

This configuration ensures that the ServiceMonitor targets the correct resources.

Consider adding an option to allow multi-namespace monitoring. This could be achieved by making the namespaceSelector configurable:

  namespaceSelector:
  {{- if .Values.serviceMonitor.namespaceSelector }}
    {{- toYaml .Values.serviceMonitor.namespaceSelector | nindent 4 }}
  {{- else }}
    matchNames:
      - {{ .Release.Namespace }}
  {{- end }}

This would provide more flexibility for users who might want to monitor external-dns across multiple namespaces.


25-81: LGTM: Comprehensive and flexible endpoint configuration

The endpoints section is well-structured and highly configurable:

  • The main endpoint is thoroughly configurable with various optional parameters.
  • A conditional block for the "webhook" provider adds necessary specificity.
  • Extensive use of .Values for configuration promotes reusability and ease of customization.

This implementation provides great flexibility for different monitoring scenarios.

To improve maintainability, consider extracting the common endpoint configuration into a named template. This would reduce duplication between the main endpoint and the webhook endpoint:

{{- define "external-dns.serviceMonitor.endpoint" -}}
path: /metrics
{{- with .interval }}
interval: {{ . }}
{{- end }}
# ... (other common configurations)
{{- end }}

endpoints:
  - port: http
    {{- include "external-dns.serviceMonitor.endpoint" .Values.serviceMonitor | nindent 4 }}
  {{- if eq $providerName "webhook" }}
  {{- with .Values.provider.webhook.serviceMonitor }}
  - port: http-webhook
    {{- include "external-dns.serviceMonitor.endpoint" . | nindent 4 }}
  {{- end }}
  {{- end }}

This approach would make the template more DRY and easier to maintain.


82-86: LGTM: Flexible targetLabels configuration

The targetLabels section is well-implemented:

  • Conditional inclusion based on .Values.serviceMonitor.targetLabels keeps the configuration clean.
  • Allows for additional label selection flexibility in the ServiceMonitor.

This implementation provides a good balance between functionality and simplicity.

Consider adding a brief comment explaining the purpose and impact of targetLabels:

  {{- with .Values.serviceMonitor.targetLabels }}
  # Additional labels to transfer from targets to metrics
  targetLabels:
    {{- toYaml . | nindent 4 }}
  {{- end }}

This would help users understand the significance of this optional configuration.

packages/core/platform/bundles/distro-full.yaml (2)

144-148: LGTM! Consider adding privileged field for consistency.

The new external-dns release entry is well-structured and aligns with the PR objectives. It follows the naming conventions and uses appropriate dependencies.

For consistency with other entries, consider adding the privileged field, even if set to false. This makes the configuration more explicit:

- name: external-dns
  releaseName: external-dns
  chart: cozy-external-dns
  namespace: cozy-external-dns
  privileged: false
  dependsOn: [cilium,cert-manager]
🧰 Tools
🪛 yamllint

[warning] 148-148: too few spaces after comma

(commas)


[error] 148-148: no new line character at the end of file

(new-line-at-end-of-file)


[error] 148-148: trailing spaces

(trailing-spaces)


148-148: Fix minor YAML formatting issues.

Please address the following minor formatting issues:

  1. Add a space after each comma in the dependsOn list.
  2. Ensure there's a newline at the end of the file.
  3. Remove any trailing spaces.

Apply this diff to fix the formatting:

-  dependsOn: [cilium,cert-manager]  
+  dependsOn: [cilium, cert-manager]
+
🧰 Tools
🪛 yamllint

[warning] 148-148: too few spaces after comma

(commas)


[error] 148-148: no new line character at the end of file

(new-line-at-end-of-file)


[error] 148-148: trailing spaces

(trailing-spaces)

packages/extra/monitoring/templates/grafana/grafana.yaml (2)

1-2: LGTM! Minor formatting suggestion.

The new variables $cozyConfig and $issuerType are correctly implemented to retrieve the ConfigMap data and cluster issuer type. This aligns well with the PR objectives for flexible configuration.

Consider removing the trailing space at the end of line 2 to adhere to YAML best practices:

-{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }} 
+{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}
🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


96-98: LGTM! Indentation needs adjustment.

The conditional logic for setting the HTTP01 challenge annotation based on the issuer type is correctly implemented. This change supports the PR objective of flexible configuration for different issuers.

Please adjust the indentation to maintain consistency with the rest of the file:

 {{- if ne $issuerType "cloudflare" }}
-        acme.cert-manager.io/http01-ingress-class: "{{ $ingress }}"  
+      acme.cert-manager.io/http01-ingress-class: "{{ $ingress }}"
 {{- end }}

Also, remove the trailing spaces at the end of the line.

🧰 Tools
🪛 yamllint

[warning] 97-97: wrong indentation: expected 6 but found 8

(indentation)


[error] 97-97: trailing spaces

(trailing-spaces)

packages/system/external-dns/charts/external-dns/README.md.gotmpl (1)

28-50: Consider expanding the providers table or explaining its current state

The providers section is informative and well-structured. However, the table of providers with specific configuration support only includes 'webhook'. Consider either:

  1. Expanding this table to include other providers that have specific configuration support, or
  2. Explaining why only 'webhook' is listed (e.g., if it's the only provider with special configuration needs).

This addition would provide more clarity to users about provider configuration options.

packages/system/external-dns/charts/external-dns/crds/dnsendpoint.yaml (2)

1-16: LGTM! Consider future versioning strategy.

The CRD structure and metadata are well-defined and follow Kubernetes best practices. The use of v1alpha1 is appropriate for an initial release.

As the API matures, consider planning for future versions (e.g., v1beta1, v1) and how you'll handle API evolution and deprecation.


40-88: LGTM! Consider enhancing recordType definition.

The endpoints structure is well-defined and covers all necessary aspects of DNS record management. The inclusion of providerSpecific properties allows for great flexibility.

Consider enhancing the recordType property by providing an enum of allowed values (e.g., A, AAAA, CNAME, TXT, SRV) to improve validation and user guidance.

packages/system/external-dns/charts/external-dns/templates/clusterrole.yaml (5)

1-7: LGTM! Consider adding a comment for clarity.

The initial structure and metadata of the role are well-defined. The conditional creation and dynamic role type based on .Values.namespaced provide flexibility.

Consider adding a comment at the beginning of the file to briefly explain the purpose of this role and its conditional nature. For example:

{{- if .Values.rbac.create -}}
# This file defines a Role or ClusterRole for External DNS based on configuration.
# The role type and permissions are dynamically generated based on .Values settings.
apiVersion: rbac.authorization.k8s.io/v1
...
🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


9-23: LGTM! Consider standardizing permission blocks.

The permissions for node, pod, and service resources are well-structured and correctly conditioned on the relevant source types.

For consistency, consider standardizing the format of each permission block. For example:

{{- if or (has "pod" .Values.sources) (has "service" .Values.sources) (has "contour-httpproxy" .Values.sources) (has "gloo-proxy" .Values.sources) (has "openshift-route" .Values.sources) (has "skipper-routegroup" .Values.sources) }}
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["get", "watch", "list"]
{{- end }}

Note the consistent spacing and comma placement in the verbs array.


24-64: LGTM! Consider grouping related permissions.

The permissions for various ingress and gateway resources are well-defined and correctly conditioned on the relevant source types. The wide range of supported types demonstrates good compatibility.

To improve maintainability, consider grouping related permissions together and adding comments to separate major sections. For example:

# Ingress permissions
{{- if or (has "ingress" .Values.sources) (has "contour-httpproxy" .Values.sources) (has "openshift-route" .Values.sources) (has "skipper-routegroup" .Values.sources) }}
  - apiGroups: ["extensions", "networking.k8s.io"]
    resources: ["ingresses"]
    verbs: ["get", "watch", "list"]
{{- end }}

# Istio permissions
{{- if or (has "istio-gateway" .Values.sources) (has "istio-virtualservice" .Values.sources) }}
  - apiGroups: ["networking.istio.io"]
    resources: ["gateways"]
    verbs: ["get", "watch", "list"]
{{- end }}

This grouping will make it easier to maintain and update permissions for specific ecosystems in the future.


65-90: LGTM! Consider optimizing permission checks.

The permissions for Gateway API resources are well-defined and correctly conditioned on the relevant source types. The support for various Gateway API resources demonstrates good compatibility with the latest Kubernetes networking features.

To improve efficiency and reduce redundancy, consider combining the checks for Gateway API resources. For example:

{{- $gatewayAPIResources := list "gateway-httproute" "gateway-grpcroute" "gateway-tlsroute" "gateway-tcproute" "gateway-udproute" }}
{{- if or (has "gateway-httproute" .Values.sources) (has "gateway-grpcroute" .Values.sources) (has "gateway-tlsroute" .Values.sources) (has "gateway-tcproute" .Values.sources) (has "gateway-udproute" .Values.sources) }}
  - apiGroups: ["gateway.networking.k8s.io"]
    resources: ["gateways"]
    verbs: ["get", "watch", "list"]
  - apiGroups: [""]
    resources: ["namespaces"]
    verbs: ["get", "watch", "list"]
  {{- range $resource := $gatewayAPIResources }}
  {{- if has $resource $.Values.sources }}
  - apiGroups: ["gateway.networking.k8s.io"]
    resources: ["{{ $resource | trimPrefix "gateway-" }}s"]
    verbs: ["get", "watch", "list"]
  {{- end }}
  {{- end }}
{{- end }}

This approach reduces repetition and makes it easier to add or modify Gateway API resources in the future.


91-127: LGTM! Consider adding documentation for custom permissions.

The permissions for additional resources (Gloo, Kong, Traefik, OpenShift, etc.) are well-defined and correctly conditioned on the relevant source types. The inclusion of custom additional permissions via .Values.rbac.additionalPermissions provides excellent flexibility.

To improve usability, consider adding a comment explaining the usage of .Values.rbac.additionalPermissions. For example:

{{- with .Values.rbac.additionalPermissions }}
  # Additional custom permissions can be added here.
  # Example:
  # additionalPermissions:
  #   - apiGroups: ["custom.example.com"]
  #     resources: ["customresources"]
  #     verbs: ["get", "list", "watch"]
  {{- toYaml . | nindent 2 }}
{{- end }}

This comment will help users understand how to properly use the custom permissions feature.

packages/extra/monitoring/templates/alerta/alerta.yaml (1)

152-154: Approve changes with minor style improvements

The conditional annotation for the HTTP01 challenge is correctly implemented and aligns with the PR objectives. It provides the necessary flexibility to support different ClusterIssuers based on the configuration.

Consider removing the trailing spaces at the end of these lines for better code style:

-    {{- if ne $issuerType "cloudflare" }} 
-    acme.cert-manager.io/http01-ingress-class: {{ $ingress }}  
-    {{- end }} 
+    {{- if ne $issuerType "cloudflare" }}
+    acme.cert-manager.io/http01-ingress-class: {{ $ingress }}
+    {{- end }}
🧰 Tools
🪛 yamllint

[error] 152-152: trailing spaces

(trailing-spaces)


[error] 153-153: trailing spaces

(trailing-spaces)


[error] 154-154: trailing spaces

(trailing-spaces)

packages/core/platform/bundles/paas-full.yaml (1)

220-224: LGTM! Consider minor formatting adjustment.

The new external-dns release configuration is well-structured and aligns with the PR objectives. It's correctly placed in the release list and has appropriate dependencies.

For consistency with other entries, consider removing the extra space before the dependsOn key:

  namespace: cozy-external-dns
- dependsOn: [cilium,kubeovn,cert-manager]  
+ dependsOn: [cilium,kubeovn,cert-manager]
🧰 Tools
🪛 yamllint

[error] 224-224: no new line character at the end of file

(new-line-at-end-of-file)


[error] 224-224: trailing spaces

(trailing-spaces)

packages/system/external-dns/charts/external-dns/templates/deployment.yaml (1)

14-14: Consider using multiple replicas for high availability.

The deployment is currently set to use only one replica. For production environments, it's recommended to use multiple replicas to ensure high availability and fault tolerance of the external-dns service.

Consider updating the replicas count based on your specific requirements:

replicas: {{ .Values.replicaCount | default 2 }}

This change allows you to set the replica count through Helm values, with a default of 2 if not specified.

packages/system/external-dns/charts/external-dns/values.yaml (2)

25-52: Consider adding a security note for RBAC

The service account and RBAC configuration looks good and provides flexibility. However, it might be beneficial to add a comment about the security implications of RBAC, especially when rbac.create is set to true. This could help users understand the permissions being granted to the external-dns service.

Consider adding a comment like:

rbac:
  # -- If `true`, create a `ClusterRole` & `ClusterRoleBinding` with access to the Kubernetes API.
  # Note: Enabling this grants cluster-wide permissions. Ensure this aligns with your security policies.
  create: true

194-195: Consider adding a note about the update interval

The default update interval is set to 1 minute, which might be too frequent for some use cases and could potentially cause unnecessary API calls to the DNS provider.

Consider adding a comment to highlight this:

# -- Interval for DNS updates. Note: Too frequent updates may cause rate limiting with some providers.
interval: 1m

Users can then adjust this value based on their specific needs and provider limitations.

packages/system/external-dns/charts/external-dns/CHANGELOG.md (1)

19-20: Consider utilizing the UNRELEASED section

The "UNRELEASED" section is currently empty. Consider using this section to document changes that are planned for the next release but haven't been released yet. This practice can help users and contributors stay informed about upcoming changes and provide transparency about the project's development direction.

packages/system/external-dns/charts/external-dns/README.md (3)

19-31: Minor grammatical improvement suggested

The installation instructions are clear and helpful. However, there's a small grammatical improvement that can be made to enhance readability.

Consider adding a comma after "chart" in line 21:

-Before you can install the chart you will need to add the `external-dns` repo to [Helm](https://helm.sh/).
+Before you can install the chart, you will need to add the `external-dns` repo to [Helm](https://helm.sh/).

This small change improves the flow of the sentence and makes it easier to read.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~21-~21: Possible missing comma found.
Context: ...g the Chart Before you can install the chart you will need to add the external-dns...

(AI_HYDRA_LEO_MISSING_COMMA)


[typographical] ~27-~27: Consider inserting a comma for improved readability.
Context: ...ns/ After you've installed the repo you can install the chart. shell helm u...

(INITIAL_ADVP_COMMA)


33-54: Excellent provider information with minor typo

The providers section is well-structured and informative, offering users clear guidance on configuring ExternalDNS with various DNS providers. The table of providers with specific configuration support and the links to setup instructions for different providers are particularly helpful.

There's a minor typo in line 35 that should be corrected:

-Configuring the _ExternalDNS_ provider should be done via the `provider.name` value with provider specific configuration being set via the `provider.<name>.<key>` values, where supported, and the `extraArgs` value.
+Configuring the _ExternalDNS_ provider should be done via the `provider.name` value with provider-specific configuration being set via the `provider.<name>.<key>` values, where supported, and the `extraArgs` value.

This change adds a hyphen to "provider-specific" to correct the compound adjective.

The overall structure and content of this section are excellent and will be very useful for users setting up ExternalDNS with different providers.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~35-~35: When ‘provider-specific’ is used as a modifier, it is usually spelled with a hyphen.
Context: ...done via the provider.name value with provider specific configuration being set via the `provid...

(SPECIFIC_HYPHEN)


[uncategorized] ~35-~35: Possible missing comma found.
Context: ..., and the extraArgs value. For legacy support provider can be set to the name of th...

(AI_HYDRA_LEO_MISSING_COMMA)

🪛 Markdownlint

48-48: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


49-49: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


50-50: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


51-51: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


52-52: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


53-53: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


54-54: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


56-88: Informative namespaced scope section with minor grammatical issue

This section provides valuable information about running ExternalDNS in a namespaced scope. The support matrix for different sources is particularly helpful for users to understand which features are available in this configuration.

There's a minor grammatical issue in line 59 that should be corrected:

-If `namespaced=true` is defined, the helm chart will setup `Roles` and `RoleBindings` instead `ClusterRoles` and `ClusterRoleBindings`.
+If `namespaced=true` is defined, the helm chart will set up `Roles` and `RoleBindings` instead of `ClusterRoles` and `ClusterRoleBindings`.

This change corrects the verb "setup" to "set up" and adds "of" before "ClusterRoles" for better readability.

Overall, this section provides crucial information for users considering a namespaced installation of ExternalDNS. The clear explanation of limitations and the support matrix are excellent additions to the documentation.

🧰 Tools
🪛 LanguageTool

[grammar] ~59-~59: The word “setup” is a noun. The verb is spelled with a space.
Context: ...d=trueis defined, the helm chart will setupRolesandRoleBindingsinsteadClu...

(NOUN_VERB_CONFUSION)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 8cb2256 and 2533a6d.

📒 Files selected for processing (29)
  • packages/core/platform/bundles/distro-full.yaml (1 hunks)
  • packages/core/platform/bundles/paas-full.yaml (1 hunks)
  • packages/extra/ingress/templates/dashboard.yaml (1 hunks)
  • packages/extra/monitoring/templates/alerta/alerta.yaml (2 hunks)
  • packages/extra/monitoring/templates/grafana/grafana.yaml (2 hunks)
  • packages/system/cert-manager-issuers/templates/cluster-issuers.yaml (1 hunks)
  • packages/system/external-dns/.helmignore (1 hunks)
  • packages/system/external-dns/Chart.yaml (1 hunks)
  • packages/system/external-dns/Makefile (1 hunks)
  • packages/system/external-dns/charts/external-dns/.helmignore (1 hunks)
  • packages/system/external-dns/charts/external-dns/CHANGELOG.md (1 hunks)
  • packages/system/external-dns/charts/external-dns/Chart.yaml (1 hunks)
  • packages/system/external-dns/charts/external-dns/README.md (1 hunks)
  • packages/system/external-dns/charts/external-dns/README.md.gotmpl (1 hunks)
  • packages/system/external-dns/charts/external-dns/RELEASE.md (1 hunks)
  • packages/system/external-dns/charts/external-dns/ci/ci-values.yaml (1 hunks)
  • packages/system/external-dns/charts/external-dns/crds/dnsendpoint.yaml (1 hunks)
  • packages/system/external-dns/charts/external-dns/templates/NOTES.txt (1 hunks)
  • packages/system/external-dns/charts/external-dns/templates/_helpers.tpl (1 hunks)
  • packages/system/external-dns/charts/external-dns/templates/clusterrole.yaml (1 hunks)
  • packages/system/external-dns/charts/external-dns/templates/clusterrolebinding.yaml (1 hunks)
  • packages/system/external-dns/charts/external-dns/templates/deployment.yaml (1 hunks)
  • packages/system/external-dns/charts/external-dns/templates/secret.yaml (1 hunks)
  • packages/system/external-dns/charts/external-dns/templates/service.yaml (1 hunks)
  • packages/system/external-dns/charts/external-dns/templates/serviceaccount.yaml (1 hunks)
  • packages/system/external-dns/charts/external-dns/templates/servicemonitor.yaml (1 hunks)
  • packages/system/external-dns/charts/external-dns/values.schema.json (1 hunks)
  • packages/system/external-dns/charts/external-dns/values.yaml (1 hunks)
  • packages/system/external-dns/values.yaml (1 hunks)
🧰 Additional context used
🪛 yamllint
packages/core/platform/bundles/distro-full.yaml

[warning] 148-148: too few spaces after comma

(commas)


[error] 148-148: no new line character at the end of file

(new-line-at-end-of-file)


[error] 148-148: trailing spaces

(trailing-spaces)

packages/core/platform/bundles/paas-full.yaml

[error] 224-224: no new line character at the end of file

(new-line-at-end-of-file)


[error] 224-224: trailing spaces

(trailing-spaces)

packages/extra/ingress/templates/dashboard.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


[error] 4-4: trailing spaces

(trailing-spaces)


[error] 5-5: trailing spaces

(trailing-spaces)


[error] 7-7: trailing spaces

(trailing-spaces)


[error] 8-8: trailing spaces

(trailing-spaces)


[error] 9-9: trailing spaces

(trailing-spaces)


[error] 10-10: trailing spaces

(trailing-spaces)


[error] 11-11: trailing spaces

(trailing-spaces)


[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 14-14: trailing spaces

(trailing-spaces)


[error] 15-15: trailing spaces

(trailing-spaces)


[error] 16-16: trailing spaces

(trailing-spaces)


[error] 17-17: trailing spaces

(trailing-spaces)


[error] 18-18: trailing spaces

(trailing-spaces)


[error] 19-19: trailing spaces

(trailing-spaces)


[error] 20-20: trailing spaces

(trailing-spaces)


[error] 21-21: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[error] 24-24: trailing spaces

(trailing-spaces)


[error] 25-25: trailing spaces

(trailing-spaces)


[error] 26-26: trailing spaces

(trailing-spaces)


[error] 27-27: trailing spaces

(trailing-spaces)


[error] 28-28: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)


[error] 30-30: trailing spaces

(trailing-spaces)


[error] 31-31: trailing spaces

(trailing-spaces)


[error] 32-32: trailing spaces

(trailing-spaces)


[error] 33-33: trailing spaces

(trailing-spaces)


[error] 34-34: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)

packages/extra/monitoring/templates/alerta/alerta.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 152-152: trailing spaces

(trailing-spaces)


[error] 153-153: trailing spaces

(trailing-spaces)


[error] 154-154: trailing spaces

(trailing-spaces)

packages/extra/monitoring/templates/grafana/grafana.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


[warning] 97-97: wrong indentation: expected 6 but found 8

(indentation)


[error] 97-97: trailing spaces

(trailing-spaces)

packages/system/cert-manager-issuers/templates/cluster-issuers.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


[error] 4-4: trailing spaces

(trailing-spaces)


[error] 5-5: trailing spaces

(trailing-spaces)


[error] 6-6: trailing spaces

(trailing-spaces)


[error] 7-7: trailing spaces

(trailing-spaces)


[error] 8-8: trailing spaces

(trailing-spaces)


[error] 9-9: trailing spaces

(trailing-spaces)


[error] 10-10: trailing spaces

(trailing-spaces)


[error] 11-11: trailing spaces

(trailing-spaces)


[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 14-14: trailing spaces

(trailing-spaces)


[warning] 15-15: wrong indentation: expected 4 but found 8

(indentation)


[error] 15-15: trailing spaces

(trailing-spaces)


[error] 16-16: trailing spaces

(trailing-spaces)


[error] 17-17: trailing spaces

(trailing-spaces)


[error] 18-18: trailing spaces

(trailing-spaces)


[error] 19-19: trailing spaces

(trailing-spaces)


[warning] 20-20: wrong indentation: expected 4 but found 6

(indentation)


[error] 20-20: trailing spaces

(trailing-spaces)


[warning] 21-21: wrong indentation: expected 4 but found 8

(indentation)


[error] 21-21: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[warning] 24-24: wrong indentation: expected 4 but found 6

(indentation)


[error] 24-24: trailing spaces

(trailing-spaces)


[error] 26-26: trailing spaces

(trailing-spaces)


[error] 28-28: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)


[error] 30-30: trailing spaces

(trailing-spaces)


[error] 31-31: trailing spaces

(trailing-spaces)


[error] 32-32: trailing spaces

(trailing-spaces)


[error] 33-33: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)


[error] 36-36: trailing spaces

(trailing-spaces)


[error] 37-37: trailing spaces

(trailing-spaces)


[warning] 38-38: wrong indentation: expected 4 but found 8

(indentation)


[error] 38-38: trailing spaces

(trailing-spaces)


[error] 39-39: trailing spaces

(trailing-spaces)


[error] 40-40: trailing spaces

(trailing-spaces)


[error] 41-41: trailing spaces

(trailing-spaces)


[error] 42-42: trailing spaces

(trailing-spaces)


[warning] 43-43: wrong indentation: expected 4 but found 6

(indentation)


[error] 43-43: trailing spaces

(trailing-spaces)


[warning] 44-44: wrong indentation: expected 4 but found 8

(indentation)


[error] 44-44: trailing spaces

(trailing-spaces)


[error] 45-45: trailing spaces

(trailing-spaces)


[error] 46-46: trailing spaces

(trailing-spaces)


[warning] 47-47: wrong indentation: expected 4 but found 6

(indentation)


[error] 47-47: trailing spaces

(trailing-spaces)


[error] 49-49: trailing spaces

(trailing-spaces)


[error] 51-51: trailing spaces

(trailing-spaces)


[error] 52-52: trailing spaces

(trailing-spaces)


[error] 53-53: trailing spaces

(trailing-spaces)


[error] 54-54: trailing spaces

(trailing-spaces)


[error] 55-55: trailing spaces

(trailing-spaces)


[error] 56-56: no new line character at the end of file

(new-line-at-end-of-file)

packages/system/external-dns/charts/external-dns/templates/clusterrole.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/templates/clusterrolebinding.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/templates/deployment.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/templates/secret.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/templates/service.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/templates/serviceaccount.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/templates/servicemonitor.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/values.yaml

[error] 21-21: trailing spaces

(trailing-spaces)


[error] 22-22: no new line character at the end of file

(new-line-at-end-of-file)

🪛 LanguageTool
packages/system/external-dns/charts/external-dns/README.md

[uncategorized] ~21-~21: Possible missing comma found.
Context: ...g the Chart Before you can install the chart you will need to add the external-dns...

(AI_HYDRA_LEO_MISSING_COMMA)


[typographical] ~27-~27: Consider inserting a comma for improved readability.
Context: ...ns/ After you've installed the repo you can install the chart. shell helm u...

(INITIAL_ADVP_COMMA)


[uncategorized] ~35-~35: When ‘provider-specific’ is used as a modifier, it is usually spelled with a hyphen.
Context: ...done via the provider.name value with provider specific configuration being set via the `provid...

(SPECIFIC_HYPHEN)


[uncategorized] ~35-~35: Possible missing comma found.
Context: ..., and the extraArgs value. For legacy support provider can be set to the name of th...

(AI_HYDRA_LEO_MISSING_COMMA)


[grammar] ~59-~59: The word “setup” is a noun. The verb is spelled with a space.
Context: ...d=trueis defined, the helm chart will setupRolesandRoleBindingsinsteadClu...

(NOUN_VERB_CONFUSION)


[uncategorized] ~93-~93: Possible missing comma found.
Context: ...t provided for pod affinity or pod anti-affinity one will be created from the pod select...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~167-~167: Possible missing preposition found.
Context: ...scrapeTimeout | string | nil | If set override the Prometheus default scrape timeout...

(AI_HYDRA_LEO_MISSING_TO)


[uncategorized] ~175-~175: The preposition ‘to’ seems more likely in this position.
Context: ...create/update/delete events in addition of regular interval. | | txtOwnerId | stri...

(AI_HYDRA_LEO_REPLACE_OF_TO)

packages/system/external-dns/charts/external-dns/templates/NOTES.txt

[uncategorized] ~6-~6: Loose punctuation mark.
Context: ...: {{ include "external-dns.image" . }} **************************************...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 Markdownlint
packages/system/external-dns/charts/external-dns/README.md

48-48: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


49-49: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


50-50: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


51-51: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


52-52: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


53-53: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


54-54: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


118-118: null
Spaces inside code span elements

(MD038, no-space-in-code)

🪛 Gitleaks
packages/system/external-dns/charts/external-dns/templates/secret.yaml

3-11: Possible Kubernetes Secret detected, posing a risk of leaking credentials/tokens from your deployments

(kubernetes-secret-with-data-after)

🔇 Additional comments (57)
packages/system/external-dns/Makefile (1)

1-2: LGTM: Clear and consistent variable declarations.

The variable declarations for NAME and NAMESPACE are clear and follow good practices. Using $(NAME) in the NAMESPACE definition allows for easy updates if the name changes in the future.

packages/system/external-dns/charts/external-dns/templates/secret.yaml (4)

1-1: LGTM: Conditional rendering is appropriate.

The conditional statement ensures that the Secret is only created when explicitly enabled through the chart values. This is a good practice for flexibility and security.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


2-8: LGTM: Secret resource definition follows best practices.

The Secret resource is correctly defined with appropriate API version, kind, and metadata. The use of Helm templating functions for name and labels is a good practice for consistency and maintainability.


9-12: Ensure proper handling of sensitive data.

The template allows for dynamic population of Secret data, which is good for flexibility. However, be cautious about how sensitive data is managed in the chart's values.

To ensure proper handling of sensitive data:

  1. Verify that the chart's documentation clearly states that sensitive data should not be stored in version control.
  2. Consider implementing additional safeguards for sensitive data management.
#!/bin/bash
# Check if there's a warning about sensitive data in the chart's documentation
rg -i "warning|caution|sensitive|secret" README.md values.yaml

1-13: LGTM: Overall structure is sound, with a minor security consideration.

The template is well-structured and follows Helm best practices. It provides a flexible way to create Kubernetes Secrets based on chart values. However, ensure that users are well-informed about the security implications of storing sensitive data in chart values.

To ensure the template is used correctly:

  1. Verify that the chart's documentation includes usage examples and security best practices.
  2. Check if there are any default values that might accidentally expose sensitive information.
🧰 Tools
🪛 Gitleaks

3-11: Possible Kubernetes Secret detected, posing a risk of leaking credentials/tokens from your deployments

(kubernetes-secret-with-data-after)

🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/.helmignore (4)

1-3: LGTM: Clear and informative header

The file header provides a concise and accurate description of the file's purpose and the supported pattern matching types. This is helpful for developers who might need to modify this file in the future.


5-12: LGTM: Comprehensive VCS ignore patterns

The list covers the most common version control systems (Git, Bazaar, Mercurial, and Subversion) and their respective ignore files. This is a thorough approach to ensure VCS-related files are not included in the package.


13-18: LGTM: Comprehensive backup and temporary file ignore patterns

The list covers a wide range of common backup and temporary file extensions. This helps keep the package clean from unnecessary files that might be created during development or by various tools.


1-23: Overall, the .helmignore file is well-structured and comprehensive

The file covers a wide range of common patterns that should be ignored when building packages, including system-specific files, version control system directories, backup files, and IDE-specific files. The suggestions provided in the review are minor enhancements to make it even more comprehensive.

This .helmignore file will help maintain clean and consistent packages by excluding unnecessary files during the build process.

packages/system/external-dns/charts/external-dns/templates/serviceaccount.yaml (1)

1-1: Ignore yamllint false positive for Go template syntax.

The yamllint tool reported a syntax error on this line, but it's a false positive. The {{- if ... -}} syntax is correct for Go templates and commonly used in Helm charts.

To prevent future false positives, consider adding a .yamllint configuration file to the project root with the following content:

extends: default

rules:
  document-start: disable
  truthy:
    check-keys: false
  line-length: disable

This configuration will help yamllint better handle Helm chart templates.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/templates/clusterrolebinding.yaml (4)

1-2: LGTM: Conditional RBAC creation and correct API version.

The conditional statement for RBAC creation and the API version are correctly implemented. This allows for flexible deployment options and uses the appropriate Kubernetes RBAC API.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


8-11: LGTM: Well-structured roleRef section.

The roleRef section is correctly implemented, using the namespaced value to determine the appropriate role kind (Role or ClusterRole). The dynamic generation of the role name ensures consistency with other resources.


1-1: Note: Ignore yamllint false positive.

The yamllint tool reported a syntax error on this line, but it's a false positive. The {{- if ... -}} syntax is valid for Helm templates, although not recognized by standard YAML linters. No action is required.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


12-15: LGTM: Properly defined subjects section with a verification suggestion.

The subjects section correctly defines a ServiceAccount with dynamically generated name and appropriate namespace.

To ensure the referenced ServiceAccount exists, please run the following verification script:

This script will help confirm that the ServiceAccount is properly defined elsewhere in the chart.

packages/system/external-dns/charts/external-dns/RELEASE.md (2)

5-10: Well-documented fixes with clear improvements.

The "Fixed" section provides a comprehensive list of improvements:

  1. Correct resource limit usage for the webhook provider.
  2. Proper implementation of the webhook image pull policy.
  3. Accurate metric port configuration for the webhook.
  4. Removal of unnecessary port exposure for health probes.

These fixes enhance resource management, configuration flexibility, and security. Good job on providing clear descriptions and proper attribution to contributors.


1-10: Overall, well-structured and informative release notes.

The release notes effectively communicate the changes and fixes in this version:

  1. The update to ExternalDNS v0.15.0 is clearly stated.
  2. The fixes address important issues related to the webhook provider and health probes.
  3. Each fix is well-documented with pull request references and contributor attributions.

These notes provide users with valuable information for understanding the improvements and potential impacts of upgrading. The only suggestion for improvement is to add the missing pull request number for the version update in the "Changed" section.

packages/system/external-dns/values.yaml (3)

1-6: LGTM: Well-configured policy and registry settings

The configuration for the policy and registry options is clear and well-documented. The default values ('upsert-only' for policy and 'txt' for registry) are reasonable choices for most use cases. The comments provide good explanations of the available options, which will be helpful for users configuring the system.


16-19: LGTM: Flexible domain filtering options

The configuration for domainFilters and excludeDomains provides flexible options for managing which domains are included or excluded from external-dns management. The empty lists as defaults are appropriate, allowing users to specify their requirements as needed. The descriptions are clear and concise.


1-22: Overall: Well-structured configuration file with minor improvements needed

This values.yaml file provides a comprehensive and flexible configuration for external-dns, aligning well with the PR objectives of integrating External-DNS into the deployment bundles. The majority of options are well-documented with clear descriptions, allowing users to easily customize their setup.

To further improve the file:

  1. Consider adding validation for mutually exclusive options (txtPrefix and txtSuffix).
  2. Add a description for the provider option.
  3. Address the minor formatting issues (trailing spaces and missing new line at the end).

These improvements will enhance the clarity and robustness of the configuration, making it easier for users to correctly set up external-dns in their deployments.

🧰 Tools
🪛 yamllint

[error] 21-21: trailing spaces

(trailing-spaces)


[error] 22-22: no new line character at the end of file

(new-line-at-end-of-file)

packages/system/external-dns/charts/external-dns/templates/service.yaml (1)

1-1: Ignore yamllint error and consider adding a YAML directive.

The yamllint error on line 1 is a false positive due to the Go template syntax. YAML linters often struggle with template directives at the beginning of files.

To improve linter compatibility without affecting functionality, consider adding a YAML directive at the beginning of the file:

---
{{- /* Define provider name for conditional logic later in the template */ -}}
{{- $providerName := include "external-dns.providerName" . }}

This change adds a YAML document start marker (---) which can help some linters recognize the file as valid YAML despite the template syntax.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/extra/ingress/templates/dashboard.yaml (1)

1-35: Summary: Implementation aligns with PR objectives, minor improvements suggested.

The changes in this file successfully implement the dynamic configuration for cluster issuers as described in the PR objectives. The addition of the ConfigMap lookup and conditional annotation setting allows for flexible configuration between different issuer types, including Cloudflare for DNS challenges.

The overall implementation is correct and functional. The suggestions provided are aimed at improving code clarity, maintainability, and adherence to YAML style guidelines. These minor improvements will enhance the long-term maintainability of the code without affecting its current functionality.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


[error] 4-4: trailing spaces

(trailing-spaces)


[error] 5-5: trailing spaces

(trailing-spaces)


[error] 7-7: trailing spaces

(trailing-spaces)


[error] 8-8: trailing spaces

(trailing-spaces)


[error] 9-9: trailing spaces

(trailing-spaces)


[error] 10-10: trailing spaces

(trailing-spaces)


[error] 11-11: trailing spaces

(trailing-spaces)


[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 14-14: trailing spaces

(trailing-spaces)


[error] 15-15: trailing spaces

(trailing-spaces)


[error] 16-16: trailing spaces

(trailing-spaces)


[error] 17-17: trailing spaces

(trailing-spaces)


[error] 18-18: trailing spaces

(trailing-spaces)


[error] 19-19: trailing spaces

(trailing-spaces)


[error] 20-20: trailing spaces

(trailing-spaces)


[error] 21-21: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[error] 24-24: trailing spaces

(trailing-spaces)


[error] 25-25: trailing spaces

(trailing-spaces)


[error] 26-26: trailing spaces

(trailing-spaces)


[error] 27-27: trailing spaces

(trailing-spaces)


[error] 28-28: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)


[error] 30-30: trailing spaces

(trailing-spaces)


[error] 31-31: trailing spaces

(trailing-spaces)


[error] 32-32: trailing spaces

(trailing-spaces)


[error] 33-33: trailing spaces

(trailing-spaces)


[error] 34-34: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)

packages/system/external-dns/charts/external-dns/Chart.yaml (1)

1-12: Well-documented changes and fixes.

The annotations section provides clear and concise information about recent updates and fixes. This follows best practices for maintaining a changelog and helps users understand the improvements in this version.

packages/system/external-dns/charts/external-dns/values.schema.json (2)

1-19: LGTM: Schema declaration and provider property are well-defined.

The schema declaration and provider property are correctly implemented:

  • The schema uses the widely supported draft-07 of JSON Schema.
  • The root object is properly defined as type "object".
  • The provider property allows for flexible configuration, accepting either a string or an object with a name property.

This implementation provides good flexibility for configuring the provider.


20-25: LGTM: extraArgs property is correctly defined.

The extraArgs property is properly implemented as an array of strings. This is an appropriate and common pattern for passing additional command-line arguments to the external-dns service.

packages/system/external-dns/charts/external-dns/templates/servicemonitor.yaml (2)

1-7: LGTM: Well-structured ServiceMonitor definition

The initial setup for the ServiceMonitor is well-implemented:

  • Conditional creation based on .Values.serviceMonitor.enabled allows for flexible deployment.
  • Correct API version and kind are specified for the ServiceMonitor resource.
  • Use of the include function for name generation promotes consistency across resources.
  • Namespace handling with a fallback to the release namespace provides flexibility in resource placement.

These practices contribute to a maintainable and adaptable configuration.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


1-1: False positive: yamllint syntax error

The yamllint error reported for line 1 is a false positive:

[error] 1-1: syntax error: expected the node content, but found '-'

This error occurs because yamllint doesn't recognize the Go template syntax used in Helm charts. The syntax {{- if .Values.serviceMonitor.enabled -}} is valid and necessary for conditional resource creation.

To suppress this warning in future linting, you could consider adding a yamllint configuration file (.yamllint.yaml) in the project root with the following content:

rules:
  document-start: disable

This will disable the rule that expects YAML documents to start with ---, which is causing the false positive in this case.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/templates/_helpers.tpl (10)

4-6: LGTM: Well-implemented name helper function

The external-dns.name function is correctly implemented. It follows Helm best practices by allowing name overrides, truncating to the maximum allowed length for Kubernetes resource names (63 characters), and removing trailing hyphens.


13-24: LGTM: Comprehensive fullname helper function

The external-dns.fullname function is well-implemented. It handles various naming scenarios (fullnameOverride, nameOverride, and default chart name) correctly. The function also ensures the result is truncated to 63 characters and removes trailing hyphens, adhering to Kubernetes naming conventions.


29-31: LGTM: Well-formed chart helper function

The external-dns.chart function is correctly implemented. It creates a valid chart name and version string by replacing '+' with '_', truncating to 63 characters, and removing trailing hyphens. This ensures compatibility with Kubernetes label value requirements.


36-46: LGTM: Comprehensive labels helper function

The external-dns.labels function is well-implemented. It generates all recommended labels for Helm-managed Kubernetes resources, including chart, selector, version, and managed-by labels. The inclusion of .Values.commonLabels provides flexibility for adding custom labels.


51-54: LGTM: Concise selector labels helper function

The external-dns.selectorLabels function is correctly implemented. It generates the minimum required labels (name and instance) for uniquely identifying the application instance, adhering to Kubernetes best practices for selector labels.


59-65: LGTM: Flexible service account name helper function

The external-dns.serviceAccountName function is well-implemented. It correctly handles scenarios for both creating a new service account and using an existing one. The function uses sensible defaults and allows for customization through .Values.serviceAccount.name.


70-72: LGTM: Flexible image reference helper function

The external-dns.image function is correctly implemented. It constructs the image reference using the provided repository and tag, with a sensible default for the tag based on the chart's app version. This approach allows for easy customization while providing a good out-of-the-box experience.


77-83: LGTM: Backward-compatible provider name helper function

The external-dns.providerName function is well-implemented. It handles both string and object formats for the provider value, ensuring backward compatibility. This approach provides flexibility in how the provider is specified in the values while maintaining support for older configurations.


88-95: LGTM: Robust webhook image helper function

The external-dns.webhookImage function is correctly implemented. It constructs the webhook image reference and includes a crucial check for the presence of both repository and tag. The clear error message helps users quickly identify and correct configuration issues.


1-95: Excellent implementation of Helm helper functions

This file provides a comprehensive set of well-implemented helper functions for the external-dns chart. All functions follow Helm and Kubernetes best practices, ensuring consistency, flexibility, and robustness in various deployment scenarios. The helpers cover all necessary aspects of resource naming, labeling, and image referencing, making the chart highly configurable and maintainable.

packages/extra/monitoring/templates/grafana/grafana.yaml (1)

Line range hint 1-98: Overall changes look good and align with PR objectives.

The introduction of $cozyConfig and $issuerType variables, along with the conditional ingress annotation, successfully implements the flexible configuration for different cluster issuers as outlined in the PR objectives. These changes allow for easy switching between HTTP01 and DNS01 (Cloudflare) challenges by updating the Cozystack ConfigMap.

The integration of these changes maintains the overall structure of the Grafana deployment configuration while adding the desired flexibility.

To ensure that these changes don't conflict with other parts of the system, please run the following verification:

This script will help us ensure that the new configuration is consistently applied across the codebase and doesn't introduce conflicts with existing configurations.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)

packages/system/external-dns/charts/external-dns/README.md.gotmpl (5)

1-13: LGTM: Comprehensive chart metadata included

The header section effectively utilizes Helm templating to include all necessary chart metadata, providing a solid foundation for the README.


14-27: LGTM: Clear and concise installation instructions

The installation instructions are well-structured and easy to follow. The use of Helm templating for the chart name and version ensures the instructions remain current.


51-83: LGTM: Comprehensive explanation of namespaced scoped installation

This section provides a clear and detailed explanation of namespaced scoped installation, including its implications and limitations. The support matrix is particularly helpful for users to understand which sources are supported in this mode. This information aligns well with the PR objectives of enhancing DNS management capabilities and providing flexibility in configuration.


85-91: LGTM: Appropriate use of templates and attribution

The closing section correctly includes templates for requirements and values, which will be populated by helm-docs. The attribution to helm-docs is helpful for maintainers and contributors.


1-91: Overall: Excellent README template that aligns well with PR objectives

This README template for the external-dns chart is well-structured, comprehensive, and aligns perfectly with the PR objectives. It provides clear instructions for installation and configuration, explains the nuances of provider setup and namespaced installation, and includes helpful references and warnings.

The content supports the PR goals of enhancing DNS management capabilities and offering flexibility in configuration. The detailed explanations, especially regarding namespaced installation and provider configuration, will be valuable for users implementing the new features introduced in this PR.

Only minor suggestions for improvement were made, primarily around expanding the providers table. Overall, this README template significantly enhances the usability and understanding of the external-dns chart.

packages/system/external-dns/charts/external-dns/crds/dnsendpoint.yaml (3)

17-39: LGTM! Schema structure is well-defined.

The schema structure follows Kubernetes standards, properly defining the basic resource properties and introducing the spec section.


90-97: LGTM! Status section is appropriately defined.

The status section with the observedGeneration property follows Kubernetes best practices for tracking resource versions and synchronization.


98-102: LGTM! Version serving and storage correctly configured.

The CRD version is properly marked as served and stored, and the inclusion of the status subresource allows for efficient status updates.

packages/extra/monitoring/templates/alerta/alerta.yaml (1)

Line range hint 1-254: Approve overall structure and content

The overall structure and content of the file are well-organized and follow Kubernetes best practices. The changes made are consistent with the PR objectives, introducing flexibility in DNS management and certificate issuance.

The file successfully integrates the new configuration for External-DNS and supports the dns01 ClusterIssuer using Cloudflare. No security issues or major concerns were identified in the implementation.

🧰 Tools
🪛 yamllint

[error] 152-152: trailing spaces

(trailing-spaces)


[error] 153-153: trailing spaces

(trailing-spaces)


[error] 154-154: trailing spaces

(trailing-spaces)

packages/system/external-dns/charts/external-dns/templates/deployment.yaml (3)

105-107: Review the condition for setting txt-suffix.

The current condition for setting the txt-suffix argument might not work as intended. It only sets the txt-suffix if txt-prefix is empty, which may not be the desired behavior in all cases.

Consider if this condition aligns with your requirements:

{{- if and (eq .Values.txtPrefix "") (ne .Values.txtSuffix "") }}
- --txt-suffix={{ .Values.txtSuffix }}
{{- end }}

If you want to allow setting both txt-prefix and txt-suffix independently, you might want to change this to:

{{- if .Values.txtSuffix }}
- --txt-suffix={{ .Values.txtSuffix }}
{{- end }}

Please verify the intended behavior and update accordingly.


1-1: Note: Ignore yamllint syntax error.

The yamllint tool reports a syntax error on this line, but it's a false positive. The {{- ... }} syntax is valid for Helm templates. No action is required.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


1-209: Overall, the deployment template is well-structured and comprehensive.

This Helm template for the external-dns deployment is well-designed, offering a high degree of customization through Helm values. It covers all necessary aspects of deploying external-dns in a Kubernetes environment, including:

  1. Flexible metadata configuration
  2. Comprehensive pod and container settings
  3. Conditional inclusion of features (e.g., webhook container)
  4. Proper secret management
  5. Advanced scheduling options

The template makes good use of Helm's capabilities to create a dynamic and adaptable deployment configuration. With the minor suggestions provided, this template should serve as an excellent base for deploying external-dns across various environments and use cases.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

packages/system/external-dns/charts/external-dns/values.yaml (4)

5-14: Image configuration looks good

The image configuration is well-structured and follows Kubernetes best practices. The use of IfNotPresent for pullPolicy is appropriate for most scenarios, balancing between using cached images and fetching updates.


101-138: Container security and health checks are well-configured

The security context for the container follows the principle of least privilege, which is excellent. The liveness and readiness probes are also well-configured with reasonable default values. This setup promotes a secure and reliable deployment.


161-185: ServiceMonitor configuration looks good

The ServiceMonitor configuration provides comprehensive options for Prometheus integration. It's good that it's disabled by default, allowing users to explicitly enable it when needed. The flexibility in configuration will be helpful for various monitoring setups.


1-297: Overall, a well-structured and flexible configuration

This values.yaml file provides a comprehensive and flexible configuration for external-dns. It follows many Kubernetes best practices and offers good customization options. The main areas for improvement are:

  1. Adding more guidance on security implications, especially for RBAC.
  2. Considering a RollingUpdate strategy for better availability.
  3. Setting default resource limits to prevent potential resource contention.
  4. Providing more context on the DNS update interval.
  5. Updating or removing the deprecated secret configuration method.

Addressing these points will further improve the robustness and user-friendliness of this Helm chart.

packages/system/external-dns/charts/external-dns/CHANGELOG.md (1)

1-17: LGTM: Changelog structure and format

The changelog follows the Keep a Changelog format and Semantic Versioning, which is excellent for maintaining clarity and consistency in documenting changes. The structure with categorized changes (Added, Changed, Deprecated, etc.) makes it easy for users to understand the evolution of the project.

packages/system/external-dns/charts/external-dns/README.md (3)

1-17: LGTM: Comprehensive header and introduction

The header and introduction section provide all the necessary information about the ExternalDNS chart, including version details, project links, and maintainer information. This follows best practices for README files and helps users quickly understand the purpose and origin of the chart.


89-182: LGTM: Comprehensive and well-documented values section

The values section is exceptionally well-documented and comprehensive. It provides users with a clear and detailed overview of all configurable options for the ExternalDNS chart. Each value is presented with its type, default value, and a concise description of its purpose, making it easy for users to understand and customize their deployment.

The table format is clear and easy to read, enhancing the overall usability of the documentation. This level of detail is crucial for users to make informed decisions when configuring their ExternalDNS installation.

This section exemplifies best practices in Helm chart documentation and will greatly assist users in deploying and configuring ExternalDNS to meet their specific needs.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~93-~93: Possible missing comma found.
Context: ...t provided for pod affinity or pod anti-affinity one will be created from the pod select...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~167-~167: Possible missing preposition found.
Context: ...scrapeTimeout | string | nil | If set override the Prometheus default scrape timeout...

(AI_HYDRA_LEO_MISSING_TO)


[uncategorized] ~175-~175: The preposition ‘to’ seems more likely in this position.
Context: ...create/update/delete events in addition of regular interval. | | txtOwnerId | stri...

(AI_HYDRA_LEO_REPLACE_OF_TO)

🪛 Markdownlint

118-118: null
Spaces inside code span elements

(MD038, no-space-in-code)


1-182: Excellent README with minor improvements suggested

This README file for the ExternalDNS Helm chart is exceptionally well-written and comprehensive. It provides users with all the necessary information to understand, install, and configure ExternalDNS in their Kubernetes environment. The document is logically structured, covering installation instructions, provider configuration, namespaced installation considerations, and a detailed values reference.

Key strengths of this documentation include:

  1. Clear installation instructions
  2. Comprehensive provider information with links to specific setup guides
  3. Detailed explanation of namespaced installation, including a helpful support matrix
  4. An extensive and well-formatted values section

The minor grammatical and typographical issues identified earlier do not significantly impact the overall quality of the documentation. Addressing these small points will further enhance the professionalism and readability of an already excellent README.

This README sets a high standard for Helm chart documentation and will greatly benefit users working with ExternalDNS.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~21-~21: Possible missing comma found.
Context: ...g the Chart Before you can install the chart you will need to add the external-dns...

(AI_HYDRA_LEO_MISSING_COMMA)


[typographical] ~27-~27: Consider inserting a comma for improved readability.
Context: ...ns/ After you've installed the repo you can install the chart. shell helm u...

(INITIAL_ADVP_COMMA)


[uncategorized] ~35-~35: When ‘provider-specific’ is used as a modifier, it is usually spelled with a hyphen.
Context: ...done via the provider.name value with provider specific configuration being set via the `provid...

(SPECIFIC_HYPHEN)


[uncategorized] ~35-~35: Possible missing comma found.
Context: ..., and the extraArgs value. For legacy support provider can be set to the name of th...

(AI_HYDRA_LEO_MISSING_COMMA)


[grammar] ~59-~59: The word “setup” is a noun. The verb is spelled with a space.
Context: ...d=trueis defined, the helm chart will setupRolesandRoleBindingsinsteadClu...

(NOUN_VERB_CONFUSION)


[uncategorized] ~93-~93: Possible missing comma found.
Context: ...t provided for pod affinity or pod anti-affinity one will be created from the pod select...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~167-~167: Possible missing preposition found.
Context: ...scrapeTimeout | string | nil | If set override the Prometheus default scrape timeout...

(AI_HYDRA_LEO_MISSING_TO)


[uncategorized] ~175-~175: The preposition ‘to’ seems more likely in this position.
Context: ...create/update/delete events in addition of regular interval. | | txtOwnerId | stri...

(AI_HYDRA_LEO_REPLACE_OF_TO)

🪛 Markdownlint

48-48: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


49-49: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


50-50: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


51-51: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


52-52: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


53-53: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


54-54: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


118-118: null
Spaces inside code span elements

(MD038, no-space-in-code)

export NAME=external-dns
export NAMESPACE=cozy-$(NAME)

include ../../../scripts/package.mk

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Missing Parent Makefile

The included parent Makefile at ../../../scripts/package.mk was not found. Please ensure that the file exists at the specified path or update the inclusion path accordingly.

🔗 Analysis chain

LGTM: Proper inclusion of parent Makefile.

The inclusion of the parent Makefile is correct and follows good practices for maintaining consistent rules across packages.

Let's verify the existence of the parent Makefile:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the existence of the parent Makefile
if [ -f ../../../scripts/package.mk ]; then
    echo "Parent Makefile exists."
else
    echo "Warning: Parent Makefile not found at ../../../scripts/package.mk"
fi

Length of output: 181

{{- include "external-dns.labels" . | nindent 4 }}
data:
{{- range $key, $value := .Values.secretConfiguration.data }}
{{ $key }}: {{ tpl $value $ | b64enc | quote }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider additional encoding for sensitive values.

The current implementation uses base64 encoding, which is reversible. For sensitive data, consider using a more secure method of storing and retrieving secrets.

Consider integrating with a secrets management solution like HashiCorp Vault or using Kubernetes external secrets for enhanced security.

🧰 Tools
🪛 Gitleaks

3-11: Possible Kubernetes Secret detected, posing a risk of leaking credentials/tokens from your deployments

(kubernetes-secret-with-data-after)

Comment on lines +7 to +14
# -- (string) Specify an identifier for this instance of _ExternalDNS_ wWhen using a registry other than `noop`.
txtOwnerId:
# -- (string) Specify a prefix for the domain names of TXT records created for the `txt` registry.
# Mutually exclusive with `txtSuffix`.
txtPrefix:
# -- (string) Specify a suffix for the domain names of TXT records created for the `txt` registry.
# Mutually exclusive with `txtPrefix`.
txtSuffix:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider adding validation for mutually exclusive options

The configuration for txtOwnerId, txtPrefix, and txtSuffix is well-documented and flexible. However, to prevent potential conflicts, it would be beneficial to add validation to ensure that txtPrefix and txtSuffix are not specified simultaneously, as they are mutually exclusive.

Consider adding a validation check in the code that processes this configuration to ensure that only one of txtPrefix or txtSuffix is set. This could be implemented as a simple if-else check when reading the configuration.

Comment thread packages/system/external-dns/values.yaml Outdated
Comment on lines +28 to +47
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-stage
acme:
privateKeySecretRef:
name: letsencrypt-stage
server: https://acme-staging-v02.api.letsencrypt.org/directory
solvers:
- http01:
ingress:
class: nginx
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: selfsigned-cluster-issuer
spec:
selfSigned: {}
server: https://acme-staging-v02.api.letsencrypt.org/directory
solvers:
- {{- if eq $issuerType "cloudflare" }}
dns01:
cloudflare:
apiTokenSecretRef:
name: cloudflare-api-token-secret
key: api-token
{{- else }}
http01:
ingress:
class: nginx
{{- end }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

LGTM! Fix indentation and add missing 'spec:' key.

The letsencrypt-stage ClusterIssuer configuration is correctly implemented with the appropriate staging server URL and dynamic solver selection. This aligns well with the PR objectives.

Please add the missing 'spec:' key and fix the indentation issues:

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-stage
spec:
  acme:
    privateKeySecretRef:
      name: letsencrypt-stage
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    solvers:
    - {{- if eq $issuerType "cloudflare" }}
      dns01:
        cloudflare:
          apiTokenSecretRef:
            name: cloudflare-api-token-secret
            key: api-token
    {{- else }}
      http01:
        ingress:
          class: nginx
    {{- end }}
🧰 Tools
🪛 yamllint

[error] 28-28: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)


[error] 30-30: trailing spaces

(trailing-spaces)


[error] 31-31: trailing spaces

(trailing-spaces)


[error] 32-32: trailing spaces

(trailing-spaces)


[error] 33-33: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)


[error] 36-36: trailing spaces

(trailing-spaces)


[error] 37-37: trailing spaces

(trailing-spaces)


[warning] 38-38: wrong indentation: expected 4 but found 8

(indentation)


[error] 38-38: trailing spaces

(trailing-spaces)


[error] 39-39: trailing spaces

(trailing-spaces)


[error] 40-40: trailing spaces

(trailing-spaces)


[error] 41-41: trailing spaces

(trailing-spaces)


[error] 42-42: trailing spaces

(trailing-spaces)


[warning] 43-43: wrong indentation: expected 4 but found 6

(indentation)


[error] 43-43: trailing spaces

(trailing-spaces)


[warning] 44-44: wrong indentation: expected 4 but found 8

(indentation)


[error] 44-44: trailing spaces

(trailing-spaces)


[error] 45-45: trailing spaces

(trailing-spaces)


[error] 46-46: trailing spaces

(trailing-spaces)


[warning] 47-47: wrong indentation: expected 4 but found 6

(indentation)


[error] 47-47: trailing spaces

(trailing-spaces)

Comment on lines +60 to +61
deploymentStrategy:
type: Recreate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider using RollingUpdate strategy

The current deployment strategy is set to Recreate, which might cause downtime during updates. For better availability, consider using a RollingUpdate strategy unless there's a specific reason for using Recreate.

You might want to change the deployment strategy to:

deploymentStrategy:
  type: RollingUpdate
  rollingUpdate:
    maxSurge: 1
    maxUnavailable: 1

This allows for zero-downtime updates in most scenarios.

Comment on lines +146 to +148
# -- [Resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the `external-dns` container.
resources: {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider setting default resource limits

While the configuration allows for customization of resource requests and limits, it's generally a good practice to set some default values. This helps prevent potential resource contention issues in the cluster.

Consider adding default resource limits, for example:

resources:
  limits:
    cpu: 100m
    memory: 128Mi
  requests:
    cpu: 50m
    memory: 64Mi

These values are just examples and should be adjusted based on your specific use case and performance requirements.

Comment on lines +289 to +297
secretConfiguration:
# -- If `true`, create a `Secret` to store sensitive provider configuration (**DEPRECATED**).
enabled: false
# -- Mount path for the `Secret`, this can be templated.
mountPath:
# -- Sub-path for mounting the `Secret`, this can be templated.
subPath:
# -- `Secret` data.
data: {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update or remove deprecated secret configuration

The secret configuration section is marked as deprecated. It's generally a good practice to avoid using deprecated features as they may be removed in future versions.

Consider either removing this section or updating it to use a non-deprecated method for managing sensitive configuration data. If there's a newer recommended approach for handling sensitive provider configuration, it should be documented here instead.

Comment on lines +70 to +75
## [v1.14.2] - 2024-01-22

### Fixed

- Restore template support in `.Values.provider` and `.Values.provider.name`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Date inconsistency in v1.14.2

There's an inconsistency in the release date for version v1.14.2. It's currently dated 2024-01-22, which is in the future compared to later versions. This appears to be a typo and should be corrected to maintain the chronological order of releases.

Please update the date for v1.14.2 to the correct date, ensuring it's consistent with the chronological order of the releases.

Comment on lines +21 to +32
## [v1.15.0] - 2023-09-10

### Changed

- Updated _ExternalDNS_ OCI image version to [v0.15.0](https://github.com/kubernetes-sigs/external-dns/releases/tag/v0.15.0). ([#xxxx](https://github.com/kubernetes-sigs/external-dns/pull/xxxx)) _@stevehipwell_

### Fixed

- Fixed `provider.webhook.resources` behavior to correctly leverage resource limits. ([#4560](https://github.com/kubernetes-sigs/external-dns/pull/4560)) _@crutonjohn_
- Fixed `provider.webhook.imagePullPolicy` behavior to correctly leverage pull policy. ([#4643](https://github.com/kubernetes-sigs/external-dns/pull/4643)) _@kimsondrup_
- Fixed to add correct webhook metric port to `Service` and `ServiceMonitor`. ([#4643](https://github.com/kubernetes-sigs/external-dns/pull/4643)) _@kimsondrup_
- Fixed to no longer require the unauthenticated webhook provider port to be exposed for health probes. ([#4691](https://github.com/kubernetes-sigs/external-dns/pull/4691)) _@kimsondrup_ & _@hatrx_

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

CHANGELOG.md Missing Information on Removed Configurations

The recent review of the shell script output indicates that certain containerPort configurations have been removed or commented out in several deployment files:

  • packages/apps/vpn/templates/deployment.yaml: Removed containerPort: 60000
  • Other deployment files also show similar removals without corresponding entries in the CHANGELOG.md.

This omission means that the CHANGELOG.md does not fully reflect the changes made to the codebase, specifically the removal of certain configurations. It's important to document such changes to maintain clear and comprehensive project logs.

🔗 Analysis chain

Significant updates in v1.15.0

This version includes important changes:

  1. Updated ExternalDNS OCI image to v0.15.0, which may introduce new features or bug fixes.
  2. Fixed several issues related to the webhook provider, including resource limits, image pull policy, and metric ports.
  3. Improved security by no longer requiring the unauthenticated webhook provider port to be exposed for health probes.

These changes, especially the webhook provider fixes, could significantly impact the functionality and security of the system. Ensure thorough testing of these changes in a non-production environment before deployment.

To verify the impact of these changes, run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any references to the webhook provider in the codebase

# Search for webhook provider references
echo "Searching for webhook provider references:"
rg --type yaml 'provider.*webhook' -g '*.yaml'

# Check for exposed ports in deployment files
echo "Checking for exposed ports in deployment files:"
rg --type yaml 'ports:' -A 10 -g '*deployment*.yaml'

Length of output: 60145

@kvaps Andrei Kvapil (kvaps) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Just few momets I mentioned here:

Comment thread packages/extra/ingress/templates/dashboard.yaml Outdated
Comment thread packages/core/platform/bundles/distro-full.yaml Outdated
Co-authored-by: Andrei Kvapil <kvapss@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Added external-dns to distro-hosted bundle

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (2)
packages/extra/ingress/templates/dashboard.yaml (1)

1-35: Address trailing spaces throughout the file

The static analysis tool has reported multiple instances of trailing spaces in the file. While these don't affect functionality, removing them improves code cleanliness and consistency.

Consider running a linter or using an editor feature to remove trailing spaces throughout the file. This will improve code consistency and prevent potential issues with version control systems that are sensitive to whitespace changes.

Note: The syntax error reported on line 1 appears to be a false positive due to the Go templating syntax and can be ignored.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


[error] 4-4: trailing spaces

(trailing-spaces)


[error] 5-5: trailing spaces

(trailing-spaces)


[error] 7-7: trailing spaces

(trailing-spaces)


[error] 8-8: trailing spaces

(trailing-spaces)


[error] 9-9: trailing spaces

(trailing-spaces)


[error] 10-10: trailing spaces

(trailing-spaces)


[error] 11-11: trailing spaces

(trailing-spaces)


[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 14-14: trailing spaces

(trailing-spaces)


[error] 15-15: trailing spaces

(trailing-spaces)


[error] 16-16: trailing spaces

(trailing-spaces)


[error] 17-17: trailing spaces

(trailing-spaces)


[error] 18-18: trailing spaces

(trailing-spaces)


[error] 19-19: trailing spaces

(trailing-spaces)


[error] 20-20: trailing spaces

(trailing-spaces)


[error] 21-21: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[error] 24-24: trailing spaces

(trailing-spaces)


[error] 25-25: trailing spaces

(trailing-spaces)


[error] 26-26: trailing spaces

(trailing-spaces)


[error] 27-27: trailing spaces

(trailing-spaces)


[error] 28-28: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)


[error] 30-30: trailing spaces

(trailing-spaces)


[error] 31-31: trailing spaces

(trailing-spaces)


[error] 32-32: trailing spaces

(trailing-spaces)


[error] 33-33: trailing spaces

(trailing-spaces)


[error] 34-34: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)

packages/extra/monitoring/templates/alerta/alerta.yaml (1)

152-154: Approve changes with minor formatting suggestions

The conditional annotations for the Ingress resource are well-implemented, allowing for flexibility in using either HTTP01 or DNS01 challenges based on the $issuerType. This aligns perfectly with the PR objectives.

Consider removing the trailing spaces at the end of lines 152-154 for better code formatting:

-    {{- if ne $issuerType "cloudflare" }} 
-    acme.cert-manager.io/http01-ingress-class: {{ $ingress }}  
-    {{- end }} 
+    {{- if ne $issuerType "cloudflare" }}
+    acme.cert-manager.io/http01-ingress-class: {{ $ingress }}
+    {{- end }}
🧰 Tools
🪛 yamllint

[error] 152-152: trailing spaces

(trailing-spaces)


[error] 153-153: trailing spaces

(trailing-spaces)


[error] 154-154: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 2533a6d and c23cc52.

📒 Files selected for processing (4)
  • packages/core/platform/bundles/distro-hosted.yaml (1 hunks)
  • packages/extra/ingress/templates/dashboard.yaml (1 hunks)
  • packages/extra/monitoring/templates/alerta/alerta.yaml (2 hunks)
  • packages/system/external-dns/values.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/system/external-dns/values.yaml
🧰 Additional context used
🪛 yamllint
packages/extra/ingress/templates/dashboard.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


[error] 4-4: trailing spaces

(trailing-spaces)


[error] 5-5: trailing spaces

(trailing-spaces)


[error] 7-7: trailing spaces

(trailing-spaces)


[error] 8-8: trailing spaces

(trailing-spaces)


[error] 9-9: trailing spaces

(trailing-spaces)


[error] 10-10: trailing spaces

(trailing-spaces)


[error] 11-11: trailing spaces

(trailing-spaces)


[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 14-14: trailing spaces

(trailing-spaces)


[error] 15-15: trailing spaces

(trailing-spaces)


[error] 16-16: trailing spaces

(trailing-spaces)


[error] 17-17: trailing spaces

(trailing-spaces)


[error] 18-18: trailing spaces

(trailing-spaces)


[error] 19-19: trailing spaces

(trailing-spaces)


[error] 20-20: trailing spaces

(trailing-spaces)


[error] 21-21: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[error] 24-24: trailing spaces

(trailing-spaces)


[error] 25-25: trailing spaces

(trailing-spaces)


[error] 26-26: trailing spaces

(trailing-spaces)


[error] 27-27: trailing spaces

(trailing-spaces)


[error] 28-28: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)


[error] 30-30: trailing spaces

(trailing-spaces)


[error] 31-31: trailing spaces

(trailing-spaces)


[error] 32-32: trailing spaces

(trailing-spaces)


[error] 33-33: trailing spaces

(trailing-spaces)


[error] 34-34: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)

packages/extra/monitoring/templates/alerta/alerta.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 152-152: trailing spaces

(trailing-spaces)


[error] 153-153: trailing spaces

(trailing-spaces)


[error] 154-154: trailing spaces

(trailing-spaces)

🔇 Additional comments (4)
packages/extra/ingress/templates/dashboard.yaml (2)

1-2: LGTM: ConfigMap lookup and issuer type retrieval

The addition of ConfigMap lookup for cozystack and the retrieval of the clusterissuer value with a default of "http01" aligns well with the PR objectives. This change enables flexible configuration of the issuer type, which is crucial for supporting different DNS management strategies.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)


[error] 2-2: trailing spaces

(trailing-spaces)


15-15: Revisit past comment on http01-ingress-class annotation

A previous review comment suggested updating the acme.cert-manager.io/http01-ingress-class annotation to use {{ .Release.Namespace }}. While the current implementation does use this value, it's wrapped in a conditional block.

Please confirm if the current conditional implementation meets the requirements or if we should revert to the simpler form suggested in the past comment:

acme.cert-manager.io/http01-ingress-class: {{ .Release.Namespace }}

If the conditional is necessary, ensure that it covers all required use cases for different issuer types.

🧰 Tools
🪛 yamllint

[error] 15-15: trailing spaces

(trailing-spaces)

packages/core/platform/bundles/distro-hosted.yaml (1)

96-100: LGTM! Consider potential dependencies.

The new external-dns entry is correctly formatted and consistent with other entries in the file. Its placement at the end of the list is appropriate.

However, it's worth considering if external-dns should have any dependencies. While an empty dependsOn list is valid, you might want to verify if it should depend on services like cert-manager or other networking-related components. Please review and confirm if any dependencies should be added.

To help verify potential dependencies, you can run the following script:

This script will help identify any mentions of external-dns in other components and check if cert-manager is typically a dependency for external-dns.

✅ Verification successful

LGTM! Dependencies confirmed as none.

The new external-dns entry is correctly formatted and consistent with other entries in the file. Its placement at the end of the list is appropriate. The dependsOn field being empty aligns with the current codebase, indicating no additional dependencies are required.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential dependencies of external-dns

# Test: Search for mentions of external-dns in other components
echo "Searching for mentions of external-dns in other components:"
rg --type yaml 'external-dns' --glob '!packages/core/platform/bundles/distro-hosted.yaml'

# Test: Check if cert-manager is typically a dependency for external-dns
echo "Checking if cert-manager is typically a dependency for external-dns:"
rg --type yaml 'external-dns.*cert-manager' --glob '!packages/core/platform/bundles/distro-hosted.yaml'

Length of output: 9464

packages/extra/monitoring/templates/alerta/alerta.yaml (1)

Line range hint 1-254: Approve overall structure and consistency

The changes introduced in this file are well-contained and focused on the specific areas related to the PR objectives. The overall structure of the file remains intact, and no unintended modifications to other resources are observed. This maintains the consistency and integrity of the Kubernetes resource definitions.

🧰 Tools
🪛 yamllint

[error] 152-152: trailing spaces

(trailing-spaces)


[error] 153-153: trailing spaces

(trailing-spaces)


[error] 154-154: trailing spaces

(trailing-spaces)

Comment on lines +13 to +16
{{- if eq $issuerType "cloudflare" }}
{{- else }}
acme.cert-manager.io/http01-ingress-class: {{ .Release.Namespace }}
{{- end }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Refine conditional logic for ingress class annotation

The conditional block for setting the acme.cert-manager.io/http01-ingress-class annotation is a good addition, but there are a couple of points to consider:

  1. The current logic only sets the annotation when the issuer is not "cloudflare". Consider if there are other issuer types that might need different handling.

  2. The indentation of the conditional block seems off, which could lead to YAML parsing issues.

Consider refactoring the conditional block as follows:

  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    {{- if ne $issuerType "cloudflare" }}
    acme.cert-manager.io/http01-ingress-class: {{ .Release.Namespace }}
    {{- end }}

This change ensures proper YAML indentation and maintains the current logic. However, you might want to consider if additional conditions are needed for other issuer types.

🧰 Tools
🪛 yamllint

[error] 13-13: trailing spaces

(trailing-spaces)


[error] 14-14: trailing spaces

(trailing-spaces)


[error] 15-15: trailing spaces

(trailing-spaces)


[error] 16-16: trailing spaces

(trailing-spaces)

Comment on lines +1 to +2
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Approve changes with a minor syntax correction

The introduction of $cozyConfig and $issuerType variables aligns well with the PR objectives, providing flexibility in configuration. However, there's a minor syntax error that needs to be addressed.

Please apply the following fix to correct the syntax error:

{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}  
- {{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01"
+ {{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}
🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
packages/core/platform/bundles/paas-hosted.yaml (1)

102-106: LGTM! Minor formatting fix needed.

The addition of the external-dns release is well-structured and aligns with the PR objectives to integrate External-DNS into the deployment bundles. The dependencies on cilium and kubeovn are appropriate, ensuring that the necessary networking components are set up before external-dns.

However, there's a minor formatting issue in the dependsOn field.

Please add a space after the comma in the dependsOn field for consistency with YAML best practices:

- dependsOn: [cilium,kubeovn]
+ dependsOn: [cilium, kubeovn]
🧰 Tools
🪛 yamllint

[warning] 106-106: too few spaces after comma

(commas)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c23cc52 and ba8d35a.

📒 Files selected for processing (4)
  • packages/core/platform/bundles/distro-full.yaml (1 hunks)
  • packages/core/platform/bundles/distro-hosted.yaml (1 hunks)
  • packages/core/platform/bundles/paas-full.yaml (1 hunks)
  • packages/core/platform/bundles/paas-hosted.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/core/platform/bundles/distro-full.yaml
  • packages/core/platform/bundles/distro-hosted.yaml
  • packages/core/platform/bundles/paas-full.yaml
🧰 Additional context used
🪛 yamllint
packages/core/platform/bundles/paas-hosted.yaml

[warning] 106-106: too few spaces after comma

(commas)

🔇 Additional comments (1)
packages/core/platform/bundles/paas-hosted.yaml (1)

Line range hint 1-107: Summary: Successful integration of External-DNS

The addition of the external-dns release to this configuration file successfully integrates External-DNS into the deployment bundle. This change aligns well with the PR objectives and enhances the DNS management capabilities of the system.

Key points:

  1. The new entry follows the established structure of other releases in the file.
  2. Dependencies on cilium and kubeovn ensure proper networking setup before External-DNS deployment.
  3. The integration doesn't disrupt existing configurations.

This change will enable automatic DNS record management for services within the Kubernetes cluster, as intended by the PR objectives.

🧰 Tools
🪛 yamllint

[warning] 106-106: too few spaces after comma

(commas)

@kvaps Andrei Kvapil (kvaps) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@kvaps
Andrei Kvapil (kvaps) merged commit eda62ff into cozystack:main Oct 4, 2024
acme:
privateKeySecretRef:
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mr. Khachaturov (@mrkhachaturov) could you please update documentation on how to use this parameter

https://github.com/aenix-io/cozystack-website/

chumkaska pushed a commit to chumkaska/cozystack that referenced this pull request Oct 15, 2024
Overview

This pull request introduces the integration of External-DNS into the
full bundles and adds support for a dns01 ClusterIssuer using
Cloudflare. It enhances the DNS management capabilities for our
deployments by allowing dynamic DNS record management directly from
Kubernetes resources.

Changes Made

 1. **External-DNS Integration:**
 
   - Added External-DNS to the full deployment bundles.

- Configured External-DNS to automatically manage DNS records for
services within the Kubernetes cluster ( we must discuss how to
configure external-dns via configmap or create an application in tenant
`external-dns` where we can define values).

We must define some additional annotations for ingresses in order to
make external-dns work , so we must discuss this also which is best
method to configure it ( from configmap or dashboard ).

**2. dns01 ClusterIssuer for Cloudflare:**

- Implemented support for a dns01 ClusterIssuer using Cloudflare.
- This allows for automated certificate issuance via DNS challenge,
leveraging Cloudflare as the DNS provider.
- The configuration can be defined in the Cozystack ConfigMap

3. Default Ingress Configuration: 

- Updated the default Ingress resources to use Cloudflare for DNS
challenges.
- Ensured that if the Cloudflare issuer is defined in the Cozystack
ConfigMap, it will be utilized for all default Ingresses, streamlining
the deployment process and improving reliability.

**Benefits**

- Automated DNS Management: With External-DNS, DNS entries will be
created and updated automatically based on the state of Kubernetes
resources, reducing manual overhead.
- Seamless Certificate Management: The dns01 ClusterIssuer integration
allows for automated SSL/TLS certificate issuance, enhancing security
for deployed applications.
- Flexibility in Configuration: Users can easily switch between
different issuers by updating the Cozystack ConfigMap, providing
flexibility in the choice of DNS and certificate management solutions.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

- **New Features**
- Introduced a new `external-dns` release with support for managing DNS
records in Kubernetes.
- Added configuration options for DNS synchronization policies and
provider settings.
  - Implemented a new lookup for issuer types in Ingress configurations.
- Expanded configuration with new entries for `external-dns` in multiple
deployment files, enhancing deployment flexibility.

- **Documentation**
- Comprehensive README and configuration schema for the `external-dns`
Helm chart added, detailing installation and customization options.

- **Improvements**
  - Enhanced RBAC configuration for flexible permissions management.
- Updated annotations and health check configurations for better service
monitoring.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Co-authored-by: Andrei Kvapil <kvapss@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@coderabbitai coderabbitai Bot mentioned this pull request Nov 4, 2024
@coderabbitai coderabbitai Bot mentioned this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants