-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: configure pipeline to run scale test and publish data to app in…
…sights (#1014) # Description Configure pipeline to run scale test and publish data to app insights. Data published: timestamp, pod, podCpuInMilliCore, PodMemoryInMB, PodRestarts, node, nodeCpuInMilliCore, nodeMemoryInMB, retinaVersion, clusterName ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Alex Castilio dos Santos <[email protected]>
- Loading branch information
1 parent
beba2ac
commit 5ff1567
Showing
17 changed files
with
413 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package azure | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/Azure/azure-sdk-for-go/sdk/azidentity" | ||
armcontainerservice "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" | ||
) | ||
|
||
func GetFqdnFn(subscriptionId, resourceGroupName, clusterName string) (string, error) { | ||
cred, err := azidentity.NewAzureCLICredential(nil) | ||
if err != nil { | ||
return "", fmt.Errorf("failed to obtain a credential: %w", err) | ||
} | ||
ctx := context.Background() | ||
clientFactory, err := armcontainerservice.NewClientFactory(subscriptionId, cred, nil) | ||
if err != nil { | ||
return "", fmt.Errorf("failed to create client: %w", err) | ||
} | ||
res, err := clientFactory.NewManagedClustersClient().Get(ctx, resourceGroupName, clusterName, nil) | ||
if err != nil { | ||
return "", fmt.Errorf("failed to finish the get managed cluster client request: %w", err) | ||
} | ||
|
||
return *res.Properties.Fqdn, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package kubernetes | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
"helm.sh/helm/v3/pkg/action" | ||
"helm.sh/helm/v3/pkg/cli" | ||
) | ||
|
||
type UninstallHelmChart struct { | ||
Namespace string | ||
ReleaseName string | ||
KubeConfigFilePath string | ||
} | ||
|
||
func (i *UninstallHelmChart) Run() error { | ||
settings := cli.New() | ||
settings.KubeConfig = i.KubeConfigFilePath | ||
actionConfig := new(action.Configuration) | ||
|
||
err := actionConfig.Init(settings.RESTClientGetter(), i.Namespace, os.Getenv("HELM_DRIVER"), log.Printf) | ||
if err != nil { | ||
return fmt.Errorf("failed to initialize helm action config: %w", err) | ||
} | ||
|
||
delclient := action.NewUninstall(actionConfig) | ||
delclient.Wait = true | ||
delclient.Timeout = deleteTimeout | ||
_, err = delclient.Run(i.ReleaseName) | ||
if err != nil { | ||
return fmt.Errorf("failed to delete existing release %s: %w", i.ReleaseName, err) | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (i *UninstallHelmChart) Prevalidate() error { | ||
return nil | ||
} | ||
|
||
func (i *UninstallHelmChart) Stop() error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.