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 annotations when creating load balancer #16

Merged
merged 2 commits into from Jun 15, 2023

Conversation

yaocw2020
Copy link
Contributor

@yaocw2020 yaocw2020 commented Jun 12, 2023

Add annotations

  • loadbalancer.harvesterhci.io/network
  • loadbalancer.harvesterhci.io/project
  • loadbalancer.harvesterhci.io/namespace

IP pool module will select the IP pool automatically according to those annotations.

Related issue: harvester/harvester#2134

Dependency chart PR: harvester/charts#178

@yaocw2020 yaocw2020 force-pushed the lbannotations branch 2 times, most recently from f0fd8c7 to 78dd5c2 Compare June 14, 2023 08:34
pkg/webhook/loadbalancer/mutator.go Outdated Show resolved Hide resolved
pkg/webhook/loadbalancer/mutator.go Outdated Show resolved Hide resolved
futuretea
futuretea previously approved these changes Jun 15, 2023
Copy link

@futuretea futuretea left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

bk201
bk201 previously approved these changes Jun 15, 2023
Copy link
Member

@bk201 bk201 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

pkg/webhook/loadbalancer/mutator.go Outdated Show resolved Hide resolved
pkg/webhook/loadbalancer/mutator.go Outdated Show resolved Hide resolved
- loadbalancer.harvesterhci.io/network
- loadbalancer.harvesterhci.io/project
- loadbalancer.harvesterhci.io/namespace
@yaocw2020 yaocw2020 requested a review from bk201 June 15, 2023 10:10
Copy link

@chrisho chrisho left a comment

Choose a reason for hiding this comment

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

LGTM, and it looks to work fine, thanks.
image

Copy link
Contributor

@guangbochen guangbochen left a comment

Choose a reason for hiding this comment

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

LGTM, verified that the guest LB with IP pool config can get IP correctly, thanks.

apiVersion: loadbalancer.harvesterhci.io/v1beta1                                                                                                                                                     │
│ kind: LoadBalancer                                                                                                                                                                                   │
│ metadata:                                                                                                                                                                                            │
│   annotations:                                                                                                                                                                                       │
│     loadbalancer.harvesterhci.io/cluster: rke2-lb                                                                                                                                                    │
│     loadbalancer.harvesterhci.io/namespace: default                                                                                                                                                  │
│     loadbalancer.harvesterhci.io/network: default/vlan1238                                                                                                                                           │
│     loadbalancer.harvesterhci.io/project: c-m-28b8nfb4/p-srzp5                                                                                                                                       │
│   creationTimestamp: "2023-06-15T10:24:30Z"                                                                                                                                                          │
│   finalizers:                                                                                                                                                                                        │
│   - wrangler.cattle.io/harvester-lb-controller                                                                                                                                                       │
│   generation: 2                                                                                                                                                                                      │
│   labels:                                                                                                                                                                                            │
│     cloudprovider.harvesterhci.io/cluster: rke2-lb                                                                                                                                                   │
│     cloudprovider.harvesterhci.io/serviceName: foo                                                                                                                                                   │
│     cloudprovider.harvesterhci.io/serviceNamespace: default                                                                                                                                          │
│   name: rke2-lb-default-foo-a794f73b                                                                                                                                                                 │
│   namespace: default                                                                                                                                                                                 │
│   resourceVersion: "17018118"                                                                                                                                                                        │
│   uid: eb377caa-e3b8-4f0c-b776-f7b4a5408290                                                                                                                                                          │
│ spec:                                                                                                                                                                                                │
│   ipam: pool                                                                                                                                                                                         │
│   workloadType: cluster                                                                                                                                                                              │
│ status:                                                                                                                                                                                              │
│   address: 10.84.103.193                                                                                                                                                                             │
│   allocatedAddress:                                                                                                                                                                                  │
│     gateway: 10.84.103.254                                                                                                                                                                           │
│     ip: 10.84.103.193                                                                                                                                                                                │
│     ipPool: guest-rke2                                                                                                                                                                               │
│     mask: 255.255.255.192                                                                                                                                                                            │
│   conditions:                                                                                                                                                                                        │
│   - lastUpdateTime: "2023-06-15T10:24:30Z"                                                                                                                                                           │
│     status: "True"                                                                                                                                                                                   │
│     type: Ready                                                                                                                                                                                      │

@guangbochen guangbochen merged commit 9eb14c5 into harvester:master Jun 15, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants