installer: create namespace with kustomization
diff --git a/core/installer/cmd/env-tmpl/kustomization.yaml b/core/installer/cmd/env-tmpl/kustomization.yaml
index 8ac663b..70db25f 100644
--- a/core/installer/cmd/env-tmpl/kustomization.yaml
+++ b/core/installer/cmd/env-tmpl/kustomization.yaml
@@ -1,6 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- - config-secret.yaml
- - config-source.yaml
- - config-kustomization.yaml
+- namespace.yaml
+- config-secret.yaml
+- config-source.yaml
+- config-kustomization.yaml
diff --git a/core/installer/cmd/env-tmpl/namespace.yaml b/core/installer/cmd/env-tmpl/namespace.yaml
new file mode 100644
index 0000000..0c14654
--- /dev/null
+++ b/core/installer/cmd/env-tmpl/namespace.yaml
@@ -0,0 +1,8 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: {{ .Name }}
+ labels:
+ pcloud-instance-id: {{ .Name }}
+ annotations:
+ helm.sh/resource-policy: keep
diff --git a/core/installer/cmd/env.go b/core/installer/cmd/env.go
index 798b89f..8b7dc1e 100644
--- a/core/installer/cmd/env.go
+++ b/core/installer/cmd/env.go
@@ -46,7 +46,7 @@
)
cmd.Flags().IntVar(
&createEnvFlags.port,
- "ip",
+ "port",
22,
"",
)
@@ -122,7 +122,6 @@
return err
}
}
- kust.AddResources(createEnvFlags.name)
if err := repoIO.WriteKustomization("environments/kustomization.yaml", *kust); err != nil {
return err
}