-
Notifications
You must be signed in to change notification settings - Fork 191
Hive upgrade artifact cache #4469
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
Open
shubhadapaithankar
wants to merge
6
commits into
master
Choose a base branch
from
hive-upgrade-artifact-cache
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ec4ded4
Add Hive upgrade infrastructure with artifact cache support
shubhadapaithankar b2b1c9a
Trigger CI rerun
shubhadapaithankar 0cf10bb
Add Hive ACR deployment functions to deploy-shared-env.sh
shubhadapaithankar dcfaa59
Consolidate Hive ACR deployment into combined Bicep template
shubhadapaithankar 8ddaa05
Use HIVE_ACR_NAME environment variable
shubhadapaithankar f14634c
Remove individual names from code comments
shubhadapaithankar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,52 @@ | ||
| { | ||
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
| "contentVersion": "1.0.0.0", | ||
| "parameters": { | ||
| "aksClusterName": { | ||
| "type": "string", | ||
| "metadata": { | ||
| "description": "Name of the AKS cluster" | ||
| } | ||
| }, | ||
| "acrName": { | ||
| "type": "string", | ||
| "metadata": { | ||
| "description": "Name of the ACR to grant pull access to" | ||
| } | ||
| }, | ||
| "acrResourceGroup": { | ||
| "type": "string", | ||
| "defaultValue": "[resourceGroup().name]", | ||
| "metadata": { | ||
| "description": "Resource group containing the ACR" | ||
| } | ||
| } | ||
| }, | ||
| "variables": { | ||
| "aksClusterId": "[resourceId('Microsoft.ContainerService/managedClusters', parameters('aksClusterName'))]", | ||
| "acrResourceId": "[resourceId(parameters('acrResourceGroup'), 'Microsoft.ContainerRegistry/registries', parameters('acrName'))]", | ||
| "acrPullRoleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d')]", | ||
| "roleAssignmentName": "[guid(variables('aksClusterId'), variables('acrResourceId'), variables('acrPullRoleDefinitionId'))]" | ||
| }, | ||
| "resources": [ | ||
| { | ||
| "type": "Microsoft.Authorization/roleAssignments", | ||
| "apiVersion": "2022-04-01", | ||
| "name": "[variables('roleAssignmentName')]", | ||
| "scope": "[variables('acrResourceId')]", | ||
| "properties": { | ||
| "roleDefinitionId": "[variables('acrPullRoleDefinitionId')]", | ||
| "principalId": "[reference(variables('aksClusterId'), '2023-01-01', 'Full').properties.identityProfile.kubeletidentity.objectId]", | ||
| "principalType": "ServicePrincipal", | ||
| "description": "Allows AKS cluster to pull images from ACR for Hive deployment" | ||
| } | ||
| } | ||
| ], | ||
| "outputs": { | ||
| "roleAssignmentId": { | ||
| "type": "string", | ||
| "value": "[resourceId('Microsoft.Authorization/roleAssignments', variables('roleAssignmentName'))]" | ||
| } | ||
| } | ||
| } | ||
|
|
This file contains hidden or 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,39 @@ | ||
| // Credential Set for Artifact Cache | ||
| // Stores credentials needed to pull from the new Hive repository | ||
|
|
||
| @description('Name of the Azure Container Registry') | ||
| param acrName string | ||
|
|
||
| @description('Name for the credential set') | ||
| param credentialSetName string = 'hive-pull-credentials' | ||
|
|
||
| @description('Username or client ID for authentication') | ||
| @secure() | ||
| param username string | ||
|
|
||
| @description('Password or client secret for authentication') | ||
| @secure() | ||
| param password string | ||
|
|
||
| resource acr 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' existing = { | ||
| name: acrName | ||
| } | ||
|
|
||
| resource credentialSet 'Microsoft.ContainerRegistry/registries/credentialSets@2023-01-01-preview' = { | ||
| parent: acr | ||
| name: credentialSetName | ||
| properties: { | ||
| authCredentials: [ | ||
| { | ||
| name: 'Credential1' | ||
| usernameSecretIdentifier: username | ||
| passwordSecretIdentifier: password | ||
| } | ||
| ] | ||
| loginServer: 'quay.io' | ||
| } | ||
| } | ||
|
|
||
| output credentialSetResourceId string = credentialSet.id | ||
| output credentialSetName string = credentialSet.name | ||
|
|
This file contains hidden or 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,32 @@ | ||
| // Artifact Cache Rules for Hive Images | ||
| // Based on https://msazure.visualstudio.com/AzureRedHatOpenShift/_git/sdp-pipelines?path=/classic/global/infra/Templates/artifact-cache.bicep | ||
|
|
||
| @description('Name of the Azure Container Registry') | ||
| param acrName string | ||
|
|
||
| @description('Source repository for Hive images') | ||
| param sourceRepository string = 'quay.io/redhat-services-prod/crt-redhat-acm-tenant/hive-operator/hive' | ||
|
|
||
| @description('Target repository name in ACR') | ||
| param targetRepository string = 'redhat-services-prod/crt-redhat-acm-tenant/hive-operator/hive' | ||
|
|
||
| @description('Credential set resource ID for pull authentication') | ||
| param credentialSetResourceId string | ||
|
|
||
| resource acr 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' existing = { | ||
| name: acrName | ||
| } | ||
|
|
||
| resource cacheRule 'Microsoft.ContainerRegistry/registries/cacheRules@2023-01-01-preview' = { | ||
| parent: acr | ||
| name: 'hive-cache-rule' | ||
| properties: { | ||
| sourceRepository: sourceRepository | ||
| targetRepository: targetRepository | ||
| credentialSetResourceId: credentialSetResourceId | ||
| } | ||
| } | ||
|
|
||
| output cacheRuleName string = cacheRule.name | ||
| output cacheRuleId string = cacheRule.id | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.