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

Kyma Binding with Gardener's Adminkubeconfig #1160

Merged
merged 17 commits into from
Sep 24, 2024

Conversation

ralikio
Copy link
Member

@ralikio ralikio commented Sep 18, 2024

Description

The following PR introduces kubeconfig generation for Kyma Binding using a Gardener's shoot subresource - adminkubeconfig.

Changes proposed in this pull request:

  • implementation of a manager struct for creating kubeconfigs with a Gardener's shoot subresource.
  • change of service account used for token request kubeconfig generation to a default account.

Related issue(s)

#284

@ralikio ralikio added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/enhancement Categorizes issue or PR as related to modifying or improving an existing feature labels Sep 18, 2024
@ralikio ralikio requested a review from a team as a code owner September 18, 2024 12:39
@kyma-bot kyma-bot added cla: yes Indicates the PR's author has signed the CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 18, 2024
Copy link

Add one of following labels

- kind/feature -> Use it when you want to submit a new feature

- kind/enhancement -> Use it when you modify or improve an existing feature

- kind/bug -> Use it when you fix a bug

@ralikio ralikio marked this pull request as draft September 18, 2024 12:46
@kyma-bot kyma-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 18, 2024
@ralikio ralikio marked this pull request as ready for review September 18, 2024 14:12
@kyma-bot kyma-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 18, 2024
@ralikio ralikio removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 24, 2024

log logrus.FieldLogger
}

func NewBind(cfg BindingConfig, instanceStorage storage.Instances, log logrus.FieldLogger, clientProvider broker.ClientProvider, kubeconfigProvider broker.KubeconfigProvider, tokenExpirationSeconds int) *BindEndpoint {
type BindingParams struct {
TokenRequest bool `json:"token_requests,omit"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
TokenRequest bool `json:"token_requests,omit"`
TokenRequest bool `json:"token_request,omit"`

// get kubeconfig for the instance
kubeconfig, err = b.tokenRequestBindingManager.Create(ctx, instance, bindingID)
if err != nil {
return domain.Binding{}, fmt.Errorf("failed to create kyma binding using token requests: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return domain.Binding{}, fmt.Errorf("failed to create kyma binding using token requests: %s", err)
return domain.Binding{}, fmt.Errorf("failed to create kyma binding using token request: %s", err)

@@ -204,6 +210,7 @@ func TestCreateBindingEndpoint(t *testing.T) {
"service_id": "123",
"plan_id": "%s",
"parameters": {
"token_requests": true
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"token_requests": true
"token_request": true

@kyma-bot kyma-bot added the lgtm Looks good to me! label Sep 24, 2024
@kyma-bot kyma-bot merged commit 15bcf34 into main Sep 24, 2024
25 checks passed
ukff pushed a commit to ukff/kyma-environment-broker that referenced this pull request Oct 9, 2024
* Gardener Admin Kubeconfig Generation as a Default Binding Provider

* Linter & Default Service Account Correction

* Build Correction

* Added Missing Scheme Registration for shoot Package

* Linter

* Removed Empty Test

* Removed Debug Lines

* Review Remarks

* Review Remarks

* Removed Unnecessary Import

* Linter

* Review Remarks

* Review Remarks

* Linter

* Review Remarks
kyma-gopher-bot added a commit that referenced this pull request Oct 9, 2024
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Kyma Binding with Gardener's Adminkubeconfig  (#1160)

* Gardener Admin Kubeconfig Generation as a Default Binding Provider

* Linter & Default Service Account Correction

* Build Correction

* Added Missing Scheme Registration for shoot Package

* Linter

* Removed Empty Test

* Removed Debug Lines

* Review Remarks

* Review Remarks

* Removed Unnecessary Import

* Linter

* Review Remarks

* Review Remarks

* Linter

* Review Remarks

* Bump sec-scanners-config.yaml, KEB images and Chart to 1.10.6 (#1181)

* Extend binding create endpoint (#1180)

* Extend binding create endpoint

* Apply suggestions

* Remove necessary comment

* Bump sec-scanners-config.yaml, KEB images and Chart to 1.10.7 (#1183)

* Remove avs (#1182)

* Remove AvS code

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

---------

Co-authored-by: Wojciech Wrzalik <[email protected]>
Co-authored-by: Kyma gopher bot <[email protected]>
Co-authored-by: KsaweryZietara <[email protected]>
Co-authored-by: Piotr Miśkiewicz <[email protected]>
kyma-gopher-bot added a commit that referenced this pull request Oct 9, 2024
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Kyma Binding with Gardener's Adminkubeconfig  (#1160)

* Gardener Admin Kubeconfig Generation as a Default Binding Provider

* Linter & Default Service Account Correction

* Build Correction

* Added Missing Scheme Registration for shoot Package

* Linter

* Removed Empty Test

* Removed Debug Lines

* Review Remarks

* Review Remarks

* Removed Unnecessary Import

* Linter

* Review Remarks

* Review Remarks

* Linter

* Review Remarks

* Bump sec-scanners-config.yaml, KEB images and Chart to 1.10.6 (#1181)

* Extend binding create endpoint (#1180)

* Extend binding create endpoint

* Apply suggestions

* Remove necessary comment

* Bump sec-scanners-config.yaml, KEB images and Chart to 1.10.7 (#1183)

* Remove avs (#1182)

* Remove AvS code

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

---------

Co-authored-by: Wojciech Wrzalik <[email protected]>
Co-authored-by: Kyma gopher bot <[email protected]>
Co-authored-by: KsaweryZietara <[email protected]>
Co-authored-by: Piotr Miśkiewicz <[email protected]>
kyma-gopher-bot added a commit that referenced this pull request Oct 9, 2024
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Kyma Binding with Gardener's Adminkubeconfig  (#1160)

* Gardener Admin Kubeconfig Generation as a Default Binding Provider

* Linter & Default Service Account Correction

* Build Correction

* Added Missing Scheme Registration for shoot Package

* Linter

* Removed Empty Test

* Removed Debug Lines

* Review Remarks

* Review Remarks

* Removed Unnecessary Import

* Linter

* Review Remarks

* Review Remarks

* Linter

* Review Remarks

* Bump sec-scanners-config.yaml, KEB images and Chart to 1.10.6 (#1181)

* Extend binding create endpoint (#1180)

* Extend binding create endpoint

* Apply suggestions

* Remove necessary comment

* Bump sec-scanners-config.yaml, KEB images and Chart to 1.10.7 (#1183)

* Remove avs (#1182)

* Remove AvS code

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

---------

Co-authored-by: Wojciech Wrzalik <[email protected]>
Co-authored-by: Kyma gopher bot <[email protected]>
Co-authored-by: KsaweryZietara <[email protected]>
Co-authored-by: Piotr Miśkiewicz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. kind/enhancement Categorizes issue or PR as related to modifying or improving an existing feature lgtm Looks good to me! size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants