Skip to content

Commit

Permalink
feat: specify namespace to avoid accidentally deploying resources to …
Browse files Browse the repository at this point in the history
…wrong ns
  • Loading branch information
rbjorklin committed Nov 27, 2024
1 parent 0387a30 commit 86af1e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
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 86af1e4

Please sign in to comment.