Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add value to configure control plane load balancer allow list #343

Merged
merged 5 commits into from
Oct 12, 2023

Conversation

fiunchinho
Copy link
Member

What this PR does / why we need it

Towards giantswarm/roadmap#2351

Checklist

  • Update changelog in CHANGELOG.md.

@fiunchinho fiunchinho self-assigned this Jul 13, 2023
@tityosbot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@fiunchinho
Copy link
Member Author

/run cluster-test-suites

@fiunchinho fiunchinho marked this pull request as ready for review September 28, 2023 10:05
@fiunchinho fiunchinho requested a review from a team as a code owner September 28, 2023 10:05
@tinkerers-ci
Copy link

tinkerers-ci bot commented Sep 28, 2023

cluster-test-suites

Run name pr-cluster-aws-343-cluster-test-suitesswzfj
Commit SHA dac7b6e
Result Failed ❌

📋 View full results in Tekton Dashboard

Rerun trigger:
/run cluster-test-suites

@marians
Copy link
Member

marians commented Sep 28, 2023

I think schemadocs needs updating, too

@fiunchinho
Copy link
Member Author

The e2e tests on this PR will fail until CAPA v2.2.3 release is deployed on grizzly.

helm/cluster-aws/README.md Outdated Show resolved Hide resolved
fromPort: 6443
toPort: 6443
cidrBlocks:
{{- toYaml .Values.controlPlane.allowList | nindent 6 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation needs to match the existing list item for the Kubernetes API, so shouldn't it be nindent 4?

Copy link
Member Author

@fiunchinho fiunchinho Oct 9, 2023

Choose a reason for hiding this comment

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

If I use nindent 4 it would look like this, and it wouldn't work

- description: "Kubernetes API"
  protocol: tcp
  fromPort: 6443
  toPort: 6443
  cidrBlocks:
- 1.2.3.4/32

Copy link
Contributor

Choose a reason for hiding this comment

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

See #343 (comment) – I understood the goal now

CHANGELOG.md Outdated
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add `controlPlane.allowList` to configure control plane load balancer ingress rules.
Copy link
Contributor

Choose a reason for hiding this comment

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

The name is quite unclear. What about controlPlane.loadBalancerIngressRules which matches CAPA naming? Also, it looks like the default value ["0.0.0.0/0"] shouldn't work because []IngressRule is expected, not []string.

The description shouldn't say anything about IPv4. The IngressRule type supports IPv6 as well.

Also, should we move this into .Values.providerSpecific?

Copy link
Member Author

Choose a reason for hiding this comment

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

We are not exposing CAPA values directly. We are only exposing the cidrBlock field of the IngressRule, so it expects a string.

The helm value we expose it's not AWS specific. I don't know how firewall rules are managed on other providers, but I don't see why we couldn't use the same helm value for all providers, just used differently depending on the provider. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Regarding IPv4, we are currently only setting cidrBlocks field, which is IPv4. I don't know if we support clusters using IPv6 at this point.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was confused by

cidrBlocks:
  {{- toYaml .Values.controlPlane.loadBalancerIngressRules | ... }}

because the name controlPlane.loadBalancerIngressRules reads as if users can pass additional rules. Therefore I commented as if that was the goal.

However, what you currently implement is rather something like controlPlane.loadBalancerIngressAllowCidrBlocks, right? I'm fine to only allow configuring IPv4 blocks, defaulting to 0.0.0.0/0, but then we need to give the value a good name. We can still migrate to supporting the configuration of full rules later.

@fiunchinho
Copy link
Member Author

/run cluster-test-suites

@github-actions
Copy link
Contributor

(helm/cluster-aws/ci/test-wc-minimal-values.yaml) rendered manifest diff
/spec/controlPlaneLoadBalancer  (AWSCluster/org-giantswarm/test-wc-minimal)
  + one map entry added:
    ingressRules:
    - description: "Kubernetes API"
      protocol: tcp
      fromPort: 6443
      toPort: 6443
      cidrBlocks:
      - 0.0.0.0/0

@tinkerers-ci
Copy link

tinkerers-ci bot commented Oct 10, 2023

cluster-test-suites

Run name pr-cluster-aws-343-cluster-test-suites87q92
Commit SHA c1c1eec
Result Succeeded ✅

📋 View full results in Tekton Dashboard

Rerun trigger:
/run cluster-test-suites

helm/cluster-aws/README.md Outdated Show resolved Hide resolved
helm/cluster-aws/values.schema.json Outdated Show resolved Hide resolved
@fiunchinho fiunchinho requested a review from AndiDog October 11, 2023 09:03
@AndiDog AndiDog merged commit be45cef into master Oct 12, 2023
11 of 12 checks passed
@AndiDog AndiDog deleted the cp-lb-allow-list branch October 12, 2023 08:45
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.

6 participants