Skip to content

Commit

Permalink
make --directory=cluster-service personal-runtime-config
Browse files Browse the repository at this point in the history
  • Loading branch information
cgiradkar committed Nov 18, 2024
1 parent 7458cd9 commit 7c44b88
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 5 deletions.
8 changes: 7 additions & 1 deletion cluster-service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ deploy: deploy-namespace-template deploy-istio-configurations-template ${DB_SECR
OIDC_CONTAINER="$$web" && \
OCP_ACR_URL=$(shell az acr show -n ${OCP_ACR_NAME} --query loginServer -o tsv) && \
OCP_ACR_RESOURCE_ID=$(shell az acr show -n ${OCP_ACR_NAME} --query id -o tsv) && \
AZURE_ARM_HELPER_IDENTITY_CLIENT_ID=$(shell az ad app list --display-name aro-dev-arm-helper --query '[*]'.appId -o tsv) && \
AZURE_ARM_HELPER_MOCK_FPA_PRINCIPAL_ID=$(shell az ad sp list --display-name aro-dev-first-party --query "[*].id" -o tsv) && \
oc process --local -f deploy/openshift-templates/arohcp-service-template.yml \
-p AZURE_CS_MI_CLIENT_ID=$${AZURE_CS_MI_CLIENT_ID} \
-p TENANT_ID=$${TENANT_ID} \
Expand All @@ -26,7 +28,11 @@ deploy: deploy-namespace-template deploy-istio-configurations-template ${DB_SECR
-p OCP_ACR_RESOURCE_ID=$${OCP_ACR_RESOURCE_ID} \
-p OCP_ACR_URL=$${OCP_ACR_URL} \
-p DATABASE_DISABLE_TLS=${DATABASE_DISABLE_TLS} \
-p DATABASE_AUTH_METHOD=${DATABASE_AUTH_METHOD} | oc apply -f -
-p DATABASE_AUTH_METHOD=${DATABASE_AUTH_METHOD} \
-p AZURE_ARM_HELPER_IDENTITY_CLIENT_ID=${AZURE_ARM_HELPER_IDENTITY_CLIENT_ID} \
-p AZURE_ARM_HELPER_IDENTITY_CERT_NAME=${MOCK_FPA_CERT_NAME} \
-p AZURE_ARM_HELPER_MOCK_FPA_PRINCIPAL_ID=${AZURE_ARM_HELPER_MOCK_FPA_PRINCIPAL_ID} \
| oc apply -f -

deploy-namespace-template:
ISTO_VERSION=$(shell az aks show -n ${AKS_NAME} -g ${RESOURCEGROUP} --query serviceMeshProfile.istio.revisions[-1] -o tsv) && \
Expand Down
1 change: 1 addition & 0 deletions cluster-service/config.tmpl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ACR_NAME ?= {{ .svcAcrName }}
OCP_ACR_NAME ?= {{ .ocpAcrName }}
AZURE_FIRST_PARTY_APPLICATION_CLIENT_ID ?= {{ .firstPartyAppClientId }}
FPA_CERT_NAME ?= firstPartyCert
MOCK_FPA_CERT_NAME ?= armHelperCert
ZONE_NAME ?= {{ .regionalDNSSubdomain }}.{{ .baseDnsZoneName }}

DATABASE_DISABLE_TLS ?= {{ not .clusterServicePostgresDeploy }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,15 @@ parameters:
- name: DATABASE_AUTH_METHOD
description: "Authentication method to use when connecting to the database. Accepted values are 'az-entra', 'postgres'"
value: "az-entra"
- name: AZURE_ARM_HELPER_IDENTITY_CLIENT_ID
description: The client id of the service principal that represents the ARM Helper Identity.
value: ""
- name: AZURE_ARM_HELPER_IDENTITY_CERT_NAME
description: The name of the secret that contains the ARM Helper Indentity certificate bundle.
value: ""
- name: AZURE_ARM_HELPER_MOCK_FPA_PRINCIPAL_ID
description: The principal id of the service principal that represents the ARM Helper Identity
value: ""

objects:

Expand All @@ -270,6 +279,26 @@ objects:
usePodIdentity: "false"
provider: azure

- apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: arm-identity
namespace: ${NAMESPACE}
spec:
parameters:
clientID: ${AZURE_CS_MI_CLIENT_ID}
cloudName: AzurePublicCloud
keyvaultName: ${SERVICE_KEYVAULT_NAME}
objects: |-
array:
- |
objectName: ${AZURE_ARM_HELPER_IDENTITY_CERT_NAME}
objectType: secret
objectAlias: armHelperIndentityCertificateBundle
tenantId: ${TENANT_ID}
usePodIdentity: "false"
provider: azure

- apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -555,6 +584,12 @@ objects:
- name: azure-credentials
secret:
secretName: azure-credentials
- name: arm-identity
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: arm-identity
- name: keyvault
csi:
driver: secrets-store.csi.k8s.io
Expand Down Expand Up @@ -624,6 +659,9 @@ objects:
- name: azure-operators-managed-identities-config
mountPath: /configs/azure-operators-managed-identities-config.yaml
subPath: azure-operators-managed-identities-config.yaml
- name: arm-identity
mountPath: /secrets/arm-identity
readOnly: true
env:
- name: NAMESPACE
valueFrom:
Expand Down Expand Up @@ -676,6 +714,9 @@ objects:
- --azure-first-party-application-certificate-bundle-path=/secrets/keyvault/firstPartyApplicationCertificateBundle
- --azure-runtime-config-path=/configs/azure-runtime-config/config.json
- --azure-operators-managed-identities-config-path=/configs/azure-operators-managed-identities-config.yaml
- --azure-arm-helper-identity-certificate-bundle-path=/secrets/arm-identity/armHelperIndentityCertificateBundle
- --azure-arm-helper-identity-client-id=${AZURE_ARM_HELPER_IDENTITY_CLIENT_ID}
- --azure-arm-helper-mock-fpa-principal-id=${AZURE_ARM_HELPER_MOCK_FPA_PRINCIPAL_ID}
livenessProbe:
httpGet:
path: /api/clusters_mgmt/v1
Expand Down
2 changes: 1 addition & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ clouds:
maestroImageBase: quay.io/redhat-user-workloads/maestro-rhtap-tenant/maestro/maestro
maestroImageTag: ea066c250a002f0cc458711945165591bc9f6d3f
# Cluster Service
clusterServiceImageTag: a23276d
clusterServiceImageTag: 356f85d
clusterServiceImageRepo: app-sre/uhc-clusters-service
# Hypershift Operator
hypershiftOperatorImageTag: a95fc46
Expand Down
3 changes: 2 additions & 1 deletion config/public-cloud-cs-pr.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"baseDnsZoneRG": "global",
"clusterServiceAcrRG": "global",
"clusterServiceImageRepo": "app-sre/uhc-clusters-service",
"clusterServiceImageTag": "a23276d",
"clusterServiceImageTag": "356f85d",
"clusterServicePostgresDeploy": true,
"clusterServicePostgresName": "arohcp-cs-cspr",
"clusterServicePostgresPrivate": false,
Expand All @@ -16,6 +16,7 @@
"externalDNSImageTag": "v0.14.2",
"externalDNSManagedIdentityName": "external-dns",
"externalDNSServiceAccountName": "external-dns",
"extraVars": {},
"firstPartyAppClientId": "57e54810-3138-4f38-bd3b-29cb33f4c358",
"frontendCosmosDBDeploy": true,
"frontendCosmosDBDisableLocalAuth": true,
Expand Down
3 changes: 2 additions & 1 deletion config/public-cloud-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"baseDnsZoneRG": "global",
"clusterServiceAcrRG": "global",
"clusterServiceImageRepo": "app-sre/uhc-clusters-service",
"clusterServiceImageTag": "a23276d",
"clusterServiceImageTag": "356f85d",
"clusterServicePostgresDeploy": true,
"clusterServicePostgresName": "arohcp-cs-dev",
"clusterServicePostgresPrivate": false,
Expand All @@ -16,6 +16,7 @@
"externalDNSImageTag": "v0.14.2",
"externalDNSManagedIdentityName": "external-dns",
"externalDNSServiceAccountName": "external-dns",
"extraVars": {},
"firstPartyAppClientId": "57e54810-3138-4f38-bd3b-29cb33f4c358",
"frontendCosmosDBDeploy": true,
"frontendCosmosDBDisableLocalAuth": true,
Expand Down
3 changes: 2 additions & 1 deletion config/public-cloud-personal-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"baseDnsZoneRG": "global",
"clusterServiceAcrRG": "global",
"clusterServiceImageRepo": "app-sre/uhc-clusters-service",
"clusterServiceImageTag": "a23276d",
"clusterServiceImageTag": "356f85d",
"clusterServicePostgresDeploy": false,
"clusterServicePostgresName": "arohcp-cs-usw3tst",
"clusterServicePostgresPrivate": false,
Expand All @@ -16,6 +16,7 @@
"externalDNSImageTag": "v0.14.2",
"externalDNSManagedIdentityName": "external-dns",
"externalDNSServiceAccountName": "external-dns",
"extraVars": {},
"firstPartyAppClientId": "57e54810-3138-4f38-bd3b-29cb33f4c358",
"frontendCosmosDBDeploy": true,
"frontendCosmosDBDisableLocalAuth": true,
Expand Down

0 comments on commit 7c44b88

Please sign in to comment.