Skip to content

Commit

Permalink
feat: namespaces are created via ArgoCD Apps now
Browse files Browse the repository at this point in the history
  • Loading branch information
dharapvj committed Nov 14, 2024
1 parent e8ac71f commit 66a4def
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 91 deletions.
2 changes: 1 addition & 1 deletion charts/kkp-argocd-apps/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.1.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
10 changes: 3 additions & 7 deletions charts/kkp-argocd-apps/templates/argocd-apps-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
# limitations under the License.

{{ if .Values.velero.enable }}
---
apiVersion: v1
kind: Namespace
metadata:
name: velero

---
apiVersion: argoproj.io/v1alpha1
kind: Application
Expand Down Expand Up @@ -48,8 +42,10 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: velero
{{- if .Values.velero.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.velero.autoSync }}
automated: {}
{{ end }}
{{ end }}
48 changes: 17 additions & 31 deletions charts/kkp-argocd-apps/templates/argocd-apps-kkp-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{ if or .Values.seedSettings.enable .Values.seedExtras.enable }}
---
apiVersion: v1
kind: Namespace
metadata:
name: kubermatic
{{ end }}
---
apiVersion: argoproj.io/v1alpha1
kind: AppProject
Expand All @@ -40,11 +33,6 @@ spec:

{{ if .Values.oauth.enable }}
---
apiVersion: v1
kind: Namespace
metadata:
name: oauth
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
Expand All @@ -69,19 +57,16 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: oauth
{{- if .Values.oauth.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.oauth.autoSync }}
automated: {}
{{ end }}
{{ end }}

{{ if .Values.nginx.enable }}
---
apiVersion: v1
kind: Namespace
metadata:
name: nginx-ingress-controller
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
Expand All @@ -107,20 +92,17 @@ spec:
server: 'https://kubernetes.default.svc'
namespace: nginx-ingress-controller
# nginx ingress app to be synced automatically so that we can access ArgoCD via it!
{{- if .Values.nginx.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.nginx.autoSync }}
automated: {}
{{ end }}
{{ end }}


{{ if .Values.certManager.enable }}
---
apiVersion: v1
kind: Namespace
metadata:
name: cert-manager
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
Expand Down Expand Up @@ -148,9 +130,11 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: cert-manager
# cert-manager app to be synced automatically so that we get certificates issued for KKP dashboard and ArgoCD to start with
{{- if .Values.certManager.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.certManager.autoSync }}
# cert-manager app to be synced automatically so that we get certificates issued for KKP dashboard and ArgoCD to start with
automated: {}
{{ end }}
{{ end }}
Expand All @@ -164,16 +148,17 @@ metadata:
namespace: argocd
spec:
project: kubermatic-config
project: default
sources:
- repoURL: '{{ .Values.repoURL }}'
targetRevision: {{ template "git-tag-version" . }}
path: {{ template "argo-cd-apps.env-specific-kkp-settings.path" . }}
destination:
server: 'https://kubernetes.default.svc'
namespace: kubermatic
{{- if .Values.seedSettings.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.seedSettings.autoSync }}
automated: {}
{{ end }}
{{ end }}
Expand All @@ -187,20 +172,21 @@ metadata:
namespace: argocd
spec:
project: kubermatic-config
project: default
sources:
- repoURL: '{{ .Values.repoURL }}'
targetRevision: {{ template "git-tag-version" . }}
path: '{{ .Values.environment }}'
directory:
recurse: true
exclude: 'values.yaml'
exclude: 'values.yaml,{{ .Values.userMlaValuesFileName }}'
include: '{common/*,{{ .Values.seed }}/*}'
destination:
server: 'https://kubernetes.default.svc'
namespace: kubermatic
{{- if .Values.seedExtras.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.seedExtras.autoSync }}
automated: {}
{{ end }}
{{ end }}
16 changes: 6 additions & 10 deletions charts/kkp-argocd-apps/templates/argocd-apps-logging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{ if or .Values.promtail.enable .Values.loki.enable }}
---
apiVersion: v1
kind: Namespace
metadata:
name: logging
{{ end }}

{{ if .Values.promtail.enable }}
---
apiVersion: argoproj.io/v1alpha1
Expand Down Expand Up @@ -47,8 +39,10 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: logging
{{- if .Values.promtail.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.promtail.autoSync }}
automated: {}
{{ end }}
{{ end }}
Expand Down Expand Up @@ -79,8 +73,10 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: logging
{{- if .Values.loki.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.loki.autoSync }}
automated: {}
{{ end }}
{{ end }}
44 changes: 23 additions & 21 deletions charts/kkp-argocd-apps/templates/argocd-apps-monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{ if or .Values.prometheus .Values.alertManager.enable .Values.grafana.enable .Values.kubeStateMetrics.enable .Values.nodeExporter.enable .Values.blackboxExporter.enable .Values.thanos.enable }}
---
apiVersion: v1
kind: Namespace
metadata:
name: monitoring
{{ end }}

{{ if .Values.prometheus.enable }}
---
apiVersion: argoproj.io/v1alpha1
Expand All @@ -46,8 +38,10 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: monitoring
{{- if .Values.prometheus.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.prometheus.autoSync }}
automated: {}
{{ end }}
{{ end }}
Expand Down Expand Up @@ -78,8 +72,10 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: monitoring
{{- if .Values.alertManager.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.alertManager.autoSync }}
automated: {}
{{ end }}
{{ end }}
Expand Down Expand Up @@ -113,7 +109,8 @@ spec:
# need to work around long annotations for dashboard configmaps
syncPolicy:
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
- ServerSideApply=true
{{- if .Values.grafana.autoSync }}
automated: {}
{{ end }}
Expand Down Expand Up @@ -151,8 +148,10 @@ spec:
kind: Deployment
jsonPointers:
- /spec/template/spec/containers/0/resources
{{- if .Values.kubeStateMetrics.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.kubeStateMetrics.autoSync }}
automated: {}
{{ end }}
{{ end }}
Expand Down Expand Up @@ -183,8 +182,10 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: monitoring
{{- if .Values.nodeExporter.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.nodeExporter.autoSync }}
automated: {}
{{ end }}
{{ end }}
Expand Down Expand Up @@ -215,8 +216,10 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: monitoring
{{- if .Values.blackboxExporter.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.blackboxExporter.autoSync }}
automated: {}
{{ end }}
{{ end }}
Expand Down Expand Up @@ -252,8 +255,10 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: monitoring
{{- if .Values.thanos.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.thanos.autoSync }}
automated: {}
{{ end }}
{{ end }}
Expand All @@ -262,11 +267,6 @@ spec:

{{ if .Values.iapSeedMla.enable }}
---
apiVersion: v1
kind: Namespace
metadata:
name: iap
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
Expand All @@ -291,8 +291,10 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: iap
{{- if .Values.iapSeedMla.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.iapSeedMla.autoSync }}
automated: {}
{{ end }}
{{ end }}
10 changes: 3 additions & 7 deletions charts/kkp-argocd-apps/templates/argocd-apps-storage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
# limitations under the License.

{{ if .Values.minio.enable }}
---
apiVersion: v1
kind: Namespace
metadata:
name: minio

---
apiVersion: argoproj.io/v1alpha1
kind: Application
Expand All @@ -44,8 +38,10 @@ spec:
destination:
server: 'https://kubernetes.default.svc'
namespace: minio
{{- if .Values.minio.autoSync }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- if .Values.minio.autoSync }}
automated: {}
{{ end }}
{{ end }}
Loading

0 comments on commit 66a4def

Please sign in to comment.