Skip to content

Commit

Permalink
Add AKS ManagedCluster and Credential yamls
Browse files Browse the repository at this point in the history
  • Loading branch information
eromanova committed Dec 19, 2024
1 parent 13af4d6 commit 572aa14
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ dev-vsphere-creds: envsubst

dev-eks-creds: dev-aws-creds

.PHONY: dev-aks-creds
dev-aks-creds: envsubst
@NAMESPACE=$(NAMESPACE) $(ENVSUBST) -no-unset -i config/dev/aks-credentials.yaml | $(KUBECTL) apply -f -

.PHONY: dev-apply ## Apply the development environment by deploying the kind cluster, local registry and the HMC helm chart.
dev-apply: kind-deploy registry-deploy dev-push dev-deploy dev-templates dev-release

Expand Down
25 changes: 25 additions & 0 deletions config/dev/aks-credentials.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
apiVersion: v1
kind: Secret
metadata:
name: azure-aks-credential
namespace: ${NAMESPACE}
stringData:
AZURE_CLIENT_ID: "${AZURE_CLIENT_ID}"
AZURE_CLIENT_SECRET: "${AZURE_CLIENT_SECRET}"
AZURE_SUBSCRIPTION_ID: "${AZURE_SUBSCRIPTION_ID}"
AZURE_TENANT_ID: "${AZURE_TENANT_ID}"
type: Opaque
---
apiVersion: hmc.mirantis.com/v1alpha1
kind: Credential
metadata:
name: azure-aks-credential
namespace: ${NAMESPACE}
spec:
description: Azure AKS credentials
identityRef:
apiVersion: v1
kind: Secret
name: azure-aks-credential
namespace: ${NAMESPACE}
18 changes: 18 additions & 0 deletions config/dev/aks-managedcluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: hmc.mirantis.com/v1alpha1
kind: ManagedCluster
metadata:
name: azure-aks-dev
namespace: ${NAMESPACE}
spec:
template: azure-aks-0-0-1
credential: azure-aks-credential
propagateCredentials: false
config:
location: "westus"
machinePools:
system:
count: 1
vmSize: Standard_A4_v2
user:
count: 1
vmSize: Standard_A4_v2
3 changes: 2 additions & 1 deletion internal/webhook/managedcluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ func isCredMatchTemplate(cred *hmcv1alpha1.Credential, template *hmcv1alpha1.Clu
return errMsg(provider)
}
case "infrastructure-azure":
if idtyKind != "AzureClusterIdentity" {
if idtyKind != "AzureClusterIdentity" &&
idtyKind != "Secret" {
return errMsg(provider)
}
case "infrastructure-vsphere":
Expand Down

0 comments on commit 572aa14

Please sign in to comment.