Move namespaces out of terraform
This commit is contained in:
parent
865831f1de
commit
6cecb90baf
7 changed files with 66 additions and 20 deletions
5
charts/fluent-bit/Chart.yaml
Normal file
5
charts/fluent-bit/Chart.yaml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
apiVersion: v2
|
||||||
|
name: fluent-bit-namespace
|
||||||
|
description: fluent-bit namespace with privileged PodSecurity
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
8
charts/fluent-bit/templates/namespace.yaml
Normal file
8
charts/fluent-bit/templates/namespace.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: fluent-bit
|
||||||
|
labels:
|
||||||
|
pod-security.kubernetes.io/enforce: privileged
|
||||||
|
pod-security.kubernetes.io/audit: privileged
|
||||||
|
pod-security.kubernetes.io/warn: privileged
|
||||||
5
charts/ingress-nginx/Chart.yaml
Normal file
5
charts/ingress-nginx/Chart.yaml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
apiVersion: v2
|
||||||
|
name: ingress-nginx-namespace
|
||||||
|
description: ingress-nginx namespace with privileged PodSecurity
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
|
|
@ -1,5 +1,26 @@
|
||||||
apiVersion: argoproj.io/v1alpha1
|
apiVersion: argoproj.io/v1alpha1
|
||||||
kind: Application
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: fluent-bit-namespace
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
repoURL: https://forge.keane.sh/ian/dumpnet-argo.git
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: charts/fluent-bit
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: fluent-bit
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
|
---
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
metadata:
|
metadata:
|
||||||
name: fluent-bit
|
name: fluent-bit
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
|
|
@ -24,4 +45,4 @@ spec:
|
||||||
prune: true
|
prune: true
|
||||||
selfHeal: true
|
selfHeal: true
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=false
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,26 @@
|
||||||
apiVersion: argoproj.io/v1alpha1
|
apiVersion: argoproj.io/v1alpha1
|
||||||
kind: Application
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: ingress-nginx-namespace
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
repoURL: https://forge.keane.sh/ian/dumpnet-argo.git
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: charts/ingress-nginx
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: ingress-nginx
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
|
---
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
metadata:
|
metadata:
|
||||||
name: ingress-nginx
|
name: ingress-nginx
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,5 @@
|
||||||
provider "kubernetes" {
|
# Namespaces that need privileged PodSecurity are managed as Helm charts
|
||||||
host = "https://${aws_eip.controlplane.public_ip}:6443"
|
# in charts/<name>/templates/namespace.yaml so ArgoCD creates them with
|
||||||
cluster_ca_certificate = base64decode(talos_cluster_kubeconfig.this.kubernetes_client_configuration.ca_certificate)
|
# the correct labels before deploying workloads into them.
|
||||||
client_certificate = base64decode(talos_cluster_kubeconfig.this.kubernetes_client_configuration.client_certificate)
|
#
|
||||||
client_key = base64decode(talos_cluster_kubeconfig.this.kubernetes_client_configuration.client_key)
|
# This file is intentionally empty.
|
||||||
}
|
|
||||||
|
|
||||||
resource "kubernetes_namespace" "ingress_nginx" {
|
|
||||||
metadata {
|
|
||||||
name = "ingress-nginx"
|
|
||||||
labels = {
|
|
||||||
"pod-security.kubernetes.io/enforce" = "privileged"
|
|
||||||
"pod-security.kubernetes.io/audit" = "privileged"
|
|
||||||
"pod-security.kubernetes.io/warn" = "privileged"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
depends_on = [talos_cluster_kubeconfig.this]
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue