Skip to content

Commit

Permalink
Deploy resources to given namespace (#35)
Browse files Browse the repository at this point in the history
* feat: specify namespace to avoid accidentally deploying resources to wrong ns

* fix: bump chart version to please linter
  • Loading branch information
rbjorklin authored Feb 13, 2025
1 parent 3c07d43 commit 1e3d14f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/azure-aks-aso/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: azure-aks-aso
description: A chart describing an AKS cluster for CAPZ using the ASO API
type: application
version: 0.4.1
version: 0.4.2
appVersion: 0.1.0
maintainers:
- name: mboersma
Expand Down
5 changes: 5 additions & 0 deletions charts/azure-aks-aso/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: {{ include "capz.clusterName" . | quote }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "capz.commonLabels" . | nindent 4 }}
spec:
Expand Down Expand Up @@ -32,6 +33,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: AzureASOManagedCluster
metadata:
name: {{ include "capz.clusterName" . | quote }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "capz.commonLabels" . | nindent 4 }}
annotations:
Expand All @@ -43,6 +45,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: AzureASOManagedControlPlane
metadata:
name: {{ include "capz.clusterName" . | quote }}
namespace: {{ .Release.Namespace }}
annotations:
helm.sh/resource-policy: keep
spec:
Expand All @@ -53,6 +56,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
name: {{ printf "%s-%s" (include "capz.clusterName" $) $mpName | quote }}
namespace: {{ $.Release.Namespace }}
labels:
{{- include "capz.commonLabels" $ | nindent 4 }}
annotations:
Expand All @@ -77,6 +81,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: AzureASOManagedMachinePool
metadata:
name: {{ printf "%s-%s" (include "capz.clusterName" $) $mpName | quote }}
namespace: {{ $.Release.Namespace }}
labels:
{{- include "capz.commonLabels" $ | nindent 4 }}
annotations:
Expand Down
5 changes: 5 additions & 0 deletions charts/azure-aks-aso/templates/clusterclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: ClusterClass
metadata:
name: {{ required "value clusterClassName must be set" .Values.clusterClassName | quote }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "capz.commonLabels" . | nindent 4 }}
spec:
Expand Down Expand Up @@ -81,6 +82,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: AzureASOManagedClusterTemplate
metadata:
name: {{ .Values.clusterClassName | quote }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "capz.commonLabels" . | nindent 4 }}
annotations:
Expand All @@ -93,6 +95,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: AzureASOManagedControlPlaneTemplate
metadata:
name: {{ .Values.clusterClassName | quote }}
namespace: {{ .Release.Namespace }}
annotations:
helm.sh/resource-policy: keep
spec:
Expand All @@ -103,6 +106,7 @@ apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: {{ .Values.clusterClassName | quote }}
namespace: {{ .Release.Namespace }}
spec:
template:
spec: {}
Expand All @@ -112,6 +116,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: AzureASOManagedMachinePoolTemplate
metadata:
name: {{ printf "%s-%s" $.Values.clusterClassName $mpName | quote }}
namespace: {{ $.Release.Namespace }}
labels:
{{- include "capz.commonLabels" $ | nindent 4 }}
annotations:
Expand Down
1 change: 1 addition & 0 deletions charts/azure-aks-aso/templates/credentials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.credentialSecretName | quote }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "capz.commonLabels" . | nindent 4 }}
annotations:
Expand Down

0 comments on commit 1e3d14f

Please sign in to comment.