-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #718 from Azure/deploy-sync-as-jobs
Use containerapps for component-sync
- Loading branch information
Showing
16 changed files
with
272 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
using '../templates/image-sync.bicep' | ||
|
||
param acrResourceGroup = 'gobal' | ||
param acrResourceGroup = 'global' | ||
|
||
param keyVaultName = 'aro-hcp-dev-global-kv' | ||
|
||
param requiredSecretNames = [ | ||
'pull-secret' | ||
'component-sync-pull-secret' | ||
'bearer-secret' | ||
] |
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,9 @@ | ||
repositories: | ||
- registry.k8s.io/external-dns/external-dns | ||
- quay.io/acm-d/rhtap-hypershift-operator | ||
- quay.io/pstefans/controlplaneoperator | ||
- quay.io/app-sre/uhc-clusters-service | ||
numberOfTags: 10 | ||
quaySecretfile: /auth/quayio-auth.json | ||
acrRegistry: arohcpdev.azurecr.io | ||
tenantId: 64dc69e4-d083-49fc-9569-ebece1dd1408 |
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,30 @@ | ||
kind: ImageSetConfiguration | ||
apiVersion: mirror.openshift.io/v1alpha2 | ||
storageConfig: | ||
registry: | ||
imageURL: arohcpdev.azurecr.io/mirror/oc-mirror-metadata | ||
skipTLS: false | ||
mirror: | ||
platform: | ||
architectures: | ||
- multi | ||
- amd64 | ||
channels: | ||
- name: stable-4.16 | ||
minVersion: 4.16.0 | ||
maxVersion: 4.16.3 | ||
type: ocp | ||
- name: stable-4.17 | ||
minVersion: 4.17.0 | ||
maxVersion: 4.17.0 | ||
type: ocp | ||
graph: true | ||
additionalImages: | ||
- name: registry.redhat.io/redhat/redhat-operator-index:v4.16 | ||
- name: registry.redhat.io/redhat/certified-operator-index:v4.16 | ||
- name: registry.redhat.io/redhat/community-operator-index:v4.16 | ||
- name: registry.redhat.io/redhat/redhat-marketplace-index:v4.16 | ||
- name: registry.redhat.io/redhat/redhat-operator-index:v4.17 | ||
- name: registry.redhat.io/redhat/certified-operator-index:v4.17 | ||
- name: registry.redhat.io/redhat/community-operator-index:v4.17 | ||
- name: registry.redhat.io/redhat/redhat-marketplace-index:v4.17 |
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
123 changes: 123 additions & 0 deletions
123
image-sync/deployment/componentSync/component-sync.bicep
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,123 @@ | ||
@description('Azure Region Location') | ||
param location string = resourceGroup().location | ||
|
||
@description('Name of the Container App Environment') | ||
param environmentName string | ||
|
||
@description('Name of the Container App Job') | ||
param jobName string | ||
|
||
@description('Container image to use for the job') | ||
param containerImage string | ||
|
||
@description('Name of the user assigned managed identity') | ||
param imageSyncManagedIdentity string | ||
|
||
@description('DNS Name of the ACR') | ||
param acrDnsName string | ||
|
||
@description('URL of the pull secret') | ||
param pullSecretUrl string | ||
|
||
@description('URL of the bearer secret') | ||
param bearerSecretUrl string | ||
|
||
resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2022-03-01' existing = { | ||
name: environmentName | ||
} | ||
|
||
resource uami 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' existing = { | ||
name: imageSyncManagedIdentity | ||
} | ||
|
||
resource symbolicname 'Microsoft.App/jobs@2024-03-01' = { | ||
name: jobName | ||
location: location | ||
|
||
identity: { | ||
type: 'UserAssigned' | ||
userAssignedIdentities: { | ||
'${uami.id}': {} | ||
} | ||
} | ||
|
||
properties: { | ||
environmentId: containerAppEnvironment.id | ||
configuration: { | ||
eventTriggerConfig: {} | ||
triggerType: 'Manual' | ||
replicaTimeout: 60 * 60 | ||
registries: [ | ||
{ | ||
identity: uami.id | ||
server: acrDnsName | ||
} | ||
] | ||
secrets: [ | ||
{ | ||
name: 'pull-secrets' | ||
keyVaultUrl: pullSecretUrl | ||
identity: uami.id | ||
} | ||
{ | ||
name: 'bearer-secret' | ||
keyVaultUrl: bearerSecretUrl | ||
identity: uami.id | ||
} | ||
] | ||
} | ||
template: { | ||
containers: [ | ||
{ | ||
name: jobName | ||
image: containerImage | ||
volumeMounts: [ | ||
{ volumeName: 'pull-secrets-updated', mountPath: '/auth' } | ||
] | ||
env: [ | ||
{ name: 'MANAGED_IDENTITY_CLIENT_ID', value: uami.properties.clientId } | ||
{ name: 'DOCKER_CONFIG', value: '/auth' } | ||
] | ||
} | ||
] | ||
initContainers: [ | ||
{ | ||
name: 'decodesecrets' | ||
image: 'mcr.microsoft.com/azure-cli:cbl-mariner2.0' | ||
command: [ | ||
'/bin/sh' | ||
] | ||
args: [ | ||
'-c' | ||
'cat /tmp/secret-orig/pull-secrets |base64 -d > /etc/containers/config.json && cat /tmp/bearer-secret/bearer-secret | base64 -d > /etc/containers/quayio-auth.json' | ||
] | ||
volumeMounts: [ | ||
{ volumeName: 'pull-secrets-updated', mountPath: '/etc/containers' } | ||
{ volumeName: 'pull-secrets', mountPath: '/tmp/secret-orig' } | ||
{ volumeName: 'bearer-secret', mountPath: '/tmp/bearer-secret' } | ||
] | ||
} | ||
] | ||
volumes: [ | ||
{ | ||
name: 'pull-secrets-updated' | ||
storageType: 'EmptyDir' | ||
} | ||
{ | ||
name: 'pull-secrets' | ||
storageType: 'Secret' | ||
secrets: [ | ||
{ secretRef: 'pull-secrets' } | ||
] | ||
} | ||
{ | ||
name: 'bearer-secret' | ||
storageType: 'Secret' | ||
secrets: [ | ||
{ secretRef: 'bearer-secret' } | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
image-sync/deployment/componentSync/mvp-component-sync.bicepparam
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,15 @@ | ||
using 'component-sync.bicep' | ||
|
||
param environmentName = 'image-sync-env-sxo4oqbcjiekg' | ||
|
||
param jobName = 'component-sync' | ||
|
||
param containerImage = 'arohcpdev.azurecr.io/image-sync/component-sync:latest' | ||
|
||
param imageSyncManagedIdentity = 'image-sync-sxo4oqbcjiekg' | ||
|
||
param acrDnsName = 'arohcpdev.azurecr.io' | ||
|
||
param pullSecretUrl = 'https://aro-hcp-dev-global-kv.vault.azure.net/secrets/component-sync-pull-secret' | ||
|
||
param bearerSecretUrl = 'https://aro-hcp-dev-global-kv.vault.azure.net/secrets/bearer-secret' |
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,30 @@ | ||
kind: ImageSetConfiguration | ||
apiVersion: mirror.openshift.io/v1alpha2 | ||
storageConfig: | ||
registry: | ||
imageURL: arohcpdev.azurecr.io/mirror/oc-mirror-metadata | ||
skipTLS: false | ||
mirror: | ||
platform: | ||
architectures: | ||
- multi | ||
- amd64 | ||
channels: | ||
- name: stable-4.16 | ||
minVersion: 4.16.0 | ||
maxVersion: 4.16.3 | ||
type: ocp | ||
- name: stable-4.17 | ||
minVersion: 4.17.0 | ||
maxVersion: 4.17.0 | ||
type: ocp | ||
graph: true | ||
additionalImages: | ||
- name: registry.redhat.io/redhat/redhat-operator-index:v4.16 | ||
- name: registry.redhat.io/redhat/certified-operator-index:v4.16 | ||
- name: registry.redhat.io/redhat/community-operator-index:v4.16 | ||
- name: registry.redhat.io/redhat/redhat-marketplace-index:v4.16 | ||
- name: registry.redhat.io/redhat/redhat-operator-index:v4.17 | ||
- name: registry.redhat.io/redhat/certified-operator-index:v4.17 | ||
- name: registry.redhat.io/redhat/community-operator-index:v4.17 | ||
- name: registry.redhat.io/redhat/redhat-marketplace-index:v4.17 |
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
Oops, something went wrong.