Skip to content

[FLINK-37911][Helm] Reorganize Helm chart templates #985

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025

Conversation

ChenYi015
Copy link
Contributor

@ChenYi015 ChenYi015 commented Jun 6, 2025

What is the purpose of the change

Brief change log

Reorganize the directory structure of Helm chart as follows:

$ # Before
$ tree helm/flink-kubernetes-operator
helm/flink-kubernetes-operator
├── .helmignore
├── Chart.yaml
├── conf
│   ├── flink-conf.yaml
│   ├── log4j-console.properties
│   └── log4j-operator.properties
├── crds
│   ├── flinkdeployments.flink.apache.org-v1.yml
│   ├── flinksessionjobs.flink.apache.org-v1.yml
│   └── flinkstatesnapshots.flink.apache.org-v1.yml
├── templates
│   ├── _helpers.tpl
│   ├── flink-operator.yaml
│   ├── rbac.yaml
│   ├── serviceaccount.yaml
│   └── webhook.yaml
└── values.yaml

$ # After
$ tree helm/flink-kubernetes-operator
helm/flink-kubernetes-operator
├── .helmignore
├── Chart.yaml
├── conf
│   ├── flink-conf.yaml
│   ├── log4j-console.properties
│   └── log4j-operator.properties
├── crds
│   ├── flinkdeployments.flink.apache.org-v1.yml
│   ├── flinksessionjobs.flink.apache.org-v1.yml
│   └── flinkstatesnapshots.flink.apache.org-v1.yml
├── templates
│   ├── _helpers.tpl
│   ├── cert-manager
│   │   ├── certificate.yaml
│   │   └── issuer.yaml
│   ├── controller
│   │   ├── configmap.yaml
│   │   └── deployment.yaml
│   ├── flink
│   │   ├── _helpers.tpl
│   │   ├── role.yaml
│   │   ├── role_binding.yaml
│   │   └── service_account.yaml
│   ├── rbac
│   │   ├── _helpers.tpl
│   │   ├── cluster_role.yaml
│   │   ├── cluster_role_binding.yaml
│   │   ├── role.yaml
│   │   ├── role_binding.yaml
│   │   └── service_account.yaml
│   └── webhook
│       ├── _helpers.tpl
│       ├── mutating_webhook_configuration.yaml
│       ├── secret.yaml
│       ├── service.yaml
│       └── validating_webhook_configuration.yaml
└── values.yaml

Verifying this change

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

One can verify there is no changes to the rendered manifests as follows:

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changes to the CustomResourceDescriptors: (no)
  • Core observer or reconciler logic that is regularly executed: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@ChenYi015
Copy link
Contributor Author

One can verify that there is no changes to the templated manifests after this reorganization:

$ # main branch
$ git checkout main

$ # helm template with default values
$ helm template flink-operator helm/flink-kubernetes-operator | yq eval-all '[.] | map(select(length > 0)) | sort_by(.kind,.metadata.name,.metadata.namespace) | .[] | splitDoc' > before-1.yaml

$ # helm template with multi-namespaces values
$ helm template flink-operator helm/flink-kubernetes-operator --set 'watchNamespaces={ns1,ns2,ns3}' | yq eval-all '[.] | map(select(length > 0)) | sort_by(.kind,.metadata.name,.metadata.namespace) | .[] | splitDoc' > before-2.yaml

$ # this branch
$ git checkout helm/reorganize-templates

$ # helm template with default values
$ helm template flink-operator helm/flink-kubernetes-operator | yq eval-all '[.] | map(select(length > 0)) | sort_by(.kind,.metadata.name,.metadata.namespace) | .[] | splitDoc' > after-1.yaml

$ # helm template with multi-namespaces values
$ helm template flink-operator helm/flink-kubernetes-operator --set 'watchNamespaces={ns1,ns2,ns3}' | yq eval-all '[.] | map(select(length > 0)) | sort_by(.kind,.metadata.name,.metadata.namespace) | .[] | splitDoc' > after-2.yaml

$ # diff
$ diff before-1.yaml after-1.yaml
1c1
< # Source: flink-kubernetes-operator/templates/webhook.yaml
---
> # Source: flink-kubernetes-operator/templates/cert-manager/certificate.yaml
23c23
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/rbac/cluster_role.yaml
139c139
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/rbac/cluster_role_binding.yaml
159c159
< # Source: flink-kubernetes-operator/templates/flink-operator.yaml
---
> # Source: flink-kubernetes-operator/templates/controller/configmap.yaml
418c418
< # Source: flink-kubernetes-operator/templates/flink-operator.yaml
---
> # Source: flink-kubernetes-operator/templates/controller/deployment.yaml
558c558
< # Source: flink-kubernetes-operator/templates/webhook.yaml
---
> # Source: flink-kubernetes-operator/templates/cert-manager/issuer.yaml
567c567
< # Source: flink-kubernetes-operator/templates/webhook.yaml
---
> # Source: flink-kubernetes-operator/templates/webhook/mutating_webhook_configuration.yaml
595c595
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/role.yaml
636c636
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/role_binding.yaml
658c658
< # Source: flink-kubernetes-operator/templates/webhook.yaml
---
> # Source: flink-kubernetes-operator/templates/webhook/secret.yaml
667a668
> # Source: flink-kubernetes-operator/templates/webhook/service.yaml
680c681
< # Source: flink-kubernetes-operator/templates/serviceaccount.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/service_account.yaml
694c695
< # Source: flink-kubernetes-operator/templates/serviceaccount.yaml
---
> # Source: flink-kubernetes-operator/templates/rbac/service_account.yaml
706c707
< # Source: flink-kubernetes-operator/templates/webhook.yaml
---
> # Source: flink-kubernetes-operator/templates/webhook/validating_webhook_configuration.yaml

$ diff before-2.yaml after-2.yaml 
1c1
< # Source: flink-kubernetes-operator/templates/webhook.yaml
---
> # Source: flink-kubernetes-operator/templates/cert-manager/certificate.yaml
23c23
< # Source: flink-kubernetes-operator/templates/flink-operator.yaml
---
> # Source: flink-kubernetes-operator/templates/controller/configmap.yaml
284c284
< # Source: flink-kubernetes-operator/templates/flink-operator.yaml
---
> # Source: flink-kubernetes-operator/templates/controller/deployment.yaml
424c424
< # Source: flink-kubernetes-operator/templates/webhook.yaml
---
> # Source: flink-kubernetes-operator/templates/cert-manager/issuer.yaml
433c433
< # Source: flink-kubernetes-operator/templates/webhook.yaml
---
> # Source: flink-kubernetes-operator/templates/webhook/mutating_webhook_configuration.yaml
466c466
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/role.yaml
507c507
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/role.yaml
548c548
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/role.yaml
589c589
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/rbac/role.yaml
613a614
> # Source: flink-kubernetes-operator/templates/rbac/role.yaml
729c730
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/rbac/role.yaml
845c846
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/rbac/role.yaml
961c962
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/rbac/role_binding.yaml
981c982
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/rbac/role_binding.yaml
1001c1002
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/rbac/role_binding.yaml
1021c1022
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/rbac/role_binding.yaml
1041c1042
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/role_binding.yaml
1063c1064
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/role_binding.yaml
1085c1086
< # Source: flink-kubernetes-operator/templates/rbac.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/role_binding.yaml
1107c1108
< # Source: flink-kubernetes-operator/templates/webhook.yaml
---
> # Source: flink-kubernetes-operator/templates/webhook/secret.yaml
1116a1118
> # Source: flink-kubernetes-operator/templates/webhook/service.yaml
1129c1131
< # Source: flink-kubernetes-operator/templates/serviceaccount.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/service_account.yaml
1143c1145
< # Source: flink-kubernetes-operator/templates/serviceaccount.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/service_account.yaml
1157c1159
< # Source: flink-kubernetes-operator/templates/serviceaccount.yaml
---
> # Source: flink-kubernetes-operator/templates/flink/service_account.yaml
1171c1173
< # Source: flink-kubernetes-operator/templates/serviceaccount.yaml
---
> # Source: flink-kubernetes-operator/templates/rbac/service_account.yaml
1183c1185
< # Source: flink-kubernetes-operator/templates/webhook.yaml
---
> # Source: flink-kubernetes-operator/templates/webhook/validating_webhook_configuration.yaml

@gyfora gyfora merged commit 8a18cc4 into apache:main Jun 10, 2025
121 checks passed
@ChenYi015 ChenYi015 deleted the helm/reorganize-templates branch June 10, 2025 14:27
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