Move CAPI resources to target-infra namespace
Moves CAPI resources in ephemeral cluster from the 'default' namespace to a new 'target-infra' namespace. Closes: #551 Change-Id: I419a71baa8e05e7b57b38234d15b955b36951b40
This commit is contained in:
parent
92e70c734e
commit
75429db630
@ -38,8 +38,6 @@ spec:
|
||||
- configMapRef:
|
||||
name: ironic-vars
|
||||
env:
|
||||
- name: WATCH_NAMESPACE
|
||||
value: default
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
|
@ -55,7 +55,7 @@ template: |
|
||||
bootMode: {{ $host.bootMode }}
|
||||
networkData:
|
||||
name: {{ $hostName }}-network-data
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
bmc:
|
||||
address: {{ $host.bmcAddress }}
|
||||
credentialsName: {{ $hostName }}-bmc-secret
|
||||
|
@ -1,3 +1,6 @@
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- cluster.yaml
|
||||
- controlplane.yaml
|
||||
|
||||
namespace: target-infra
|
||||
|
5
manifests/function/k8scontrol/namespace.yaml
Normal file
5
manifests/function/k8scontrol/namespace.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: target-infra
|
@ -1,6 +1,9 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- kubeadmconfigtemplate.yaml
|
||||
- metal3machinetemplate.yaml
|
||||
- machinedeployment.yaml
|
||||
|
||||
namespace: target-infra
|
||||
|
5
manifests/function/workers-capm3/namespace.yaml
Normal file
5
manifests/function/workers-capm3/namespace.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: target-infra
|
@ -20,7 +20,7 @@ map:
|
||||
clusterAPI:
|
||||
clusterNamespacedName:
|
||||
name: target-cluster
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
ephemeral-cluster:
|
||||
kubeconfigSources:
|
||||
- type: "filesystem"
|
||||
|
@ -44,7 +44,8 @@ apiVersion: airshipit.org/v1alpha1
|
||||
kind: Clusterctl
|
||||
metadata:
|
||||
name: clusterctl_move
|
||||
move-options: {}
|
||||
move-options:
|
||||
namespace: target-infra
|
||||
action: move
|
||||
---
|
||||
apiVersion: airshipit.org/v1alpha1
|
||||
@ -223,6 +224,7 @@ config: |
|
||||
builder:
|
||||
userDataSelector:
|
||||
kind: Secret
|
||||
namespace: target-infra
|
||||
labelSelector: airshipit.org/ephemeral-user-data
|
||||
userDataKey: userData
|
||||
networkConfigSelector:
|
||||
|
@ -1,9 +1,12 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- ../../../../function/ephemeral
|
||||
- ../catalogues
|
||||
|
||||
namespace: target-infra
|
||||
|
||||
generators:
|
||||
- hostgenerator
|
||||
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: target-infra
|
@ -7,5 +7,7 @@ resources:
|
||||
- ../../target/catalogues # NOTE: use target networking for this phase
|
||||
- nodes
|
||||
|
||||
namespace: target-infra
|
||||
|
||||
transformers:
|
||||
- ../../../../function/k8scontrol/replacements
|
||||
|
@ -7,6 +7,8 @@ resources:
|
||||
- ../../../../function/k8scontrol
|
||||
- ../catalogues
|
||||
|
||||
namespace: target-infra
|
||||
|
||||
commonLabels:
|
||||
airshipit.org/stage: initinfra
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
resources:
|
||||
- ../../../../composite/infra/
|
||||
- namespace.yaml
|
||||
|
||||
commonLabels:
|
||||
airshipit.org/stage: initinfra
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: target-infra
|
@ -5,5 +5,7 @@ resources:
|
||||
- ../../../../function/workers-capm3/
|
||||
- nodes
|
||||
|
||||
namespace: target-infra
|
||||
|
||||
transformers:
|
||||
- ../../../../function/workers-capm3/replacements
|
||||
|
@ -45,7 +45,7 @@ const (
|
||||
"tlsSecrets": [
|
||||
{
|
||||
"name": "test-cluster-etcd",
|
||||
"namespace": "default",
|
||||
"namespace": "target-infra",
|
||||
"certificate": {
|
||||
"ca.crt": "2030-08-31 10:12:49 +0000 UTC",
|
||||
"tls.crt": "2030-08-31 10:12:49 +0000 UTC"
|
||||
@ -55,7 +55,7 @@ const (
|
||||
"kubeconfs": [
|
||||
{
|
||||
"secretName": "test-cluster-kubeconfig",
|
||||
"secretNamespace": "default",
|
||||
"secretNamespace": "target-infra",
|
||||
"cluster": [
|
||||
{
|
||||
"name": "workload-cluster",
|
||||
@ -102,7 +102,7 @@ kubeconfs:
|
||||
expirationDate: 2030-08-31 10:12:48 +0000 UTC
|
||||
name: workload-cluster
|
||||
secretName: test-cluster-kubeconfig
|
||||
secretNamespace: default
|
||||
secretNamespace: target-infra
|
||||
user:
|
||||
- certificateName: ClientCertificateData
|
||||
expirationDate: 2021-09-02 10:12:50 +0000 UTC
|
||||
@ -112,7 +112,7 @@ tlsSecrets:
|
||||
ca.crt: 2030-08-31 10:12:49 +0000 UTC
|
||||
tls.crt: 2030-08-31 10:12:49 +0000 UTC
|
||||
name: test-cluster-etcd
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
nodeCerts:
|
||||
- name: test-node
|
||||
certificate:
|
||||
|
@ -6,7 +6,7 @@ metadata:
|
||||
labels:
|
||||
cluster.x-k8s.io/cluster-name: workload-cluster
|
||||
name: test-cluster-kubeconfig
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
ownerReferences:
|
||||
- apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
|
||||
blockOwnerDeletion: true
|
||||
|
@ -8,5 +8,5 @@ metadata:
|
||||
labels:
|
||||
cluster.x-k8s.io/cluster-name: test-cluster
|
||||
name: test-cluster-etcd
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
type: Opaque
|
@ -24,7 +24,7 @@ import (
|
||||
)
|
||||
|
||||
// DefaultClusterAPIObjNamespace is a default namespace used for cluster-api cluster object
|
||||
const DefaultClusterAPIObjNamespace = "default"
|
||||
const DefaultClusterAPIObjNamespace = "target-infra"
|
||||
|
||||
// WriteOptions has format in which we want to print the output(table/yaml/cluster name)
|
||||
type WriteOptions struct {
|
||||
|
@ -218,7 +218,7 @@ func TestReadStatus(t *testing.T) {
|
||||
statusMap, err := cluster.NewStatusMap(c)
|
||||
require.NoError(t, err)
|
||||
ctx := context.Background()
|
||||
resource := object.ObjMetadata{Namespace: "default",
|
||||
resource := object.ObjMetadata{Namespace: "target-infra",
|
||||
Name: "pending-resource", GroupKind: schema.GroupKind{Group: "example.com", Kind: "Resource"}}
|
||||
result := statusMap.ReadStatus(ctx, resource)
|
||||
assert.Equal(t, "Pending", result.Status.String())
|
||||
@ -231,7 +231,7 @@ func makeResource(name, state string) *unstructured.Unstructured {
|
||||
"kind": "Resource",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": name,
|
||||
"namespace": "default",
|
||||
"namespace": "target-infra",
|
||||
},
|
||||
"status": map[string]interface{}{
|
||||
"state": state,
|
||||
|
@ -4,4 +4,4 @@ apiVersion: "example.com/v1"
|
||||
kind: Legacy
|
||||
metadata:
|
||||
name: stable-legacy
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
|
2
pkg/cluster/testdata/statusmap/missing.yaml
vendored
2
pkg/cluster/testdata/statusmap/missing.yaml
vendored
@ -4,4 +4,4 @@ apiVersion: "example.com/v1"
|
||||
kind: Missing
|
||||
metadata:
|
||||
name: missing-resource
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
|
@ -4,4 +4,4 @@ apiVersion: "example.com/v1"
|
||||
kind: Resource
|
||||
metadata:
|
||||
name: pending-resource
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
|
@ -4,4 +4,4 @@ apiVersion: "example.com/v1"
|
||||
kind: Resource
|
||||
metadata:
|
||||
name: stable-resource
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
|
2
pkg/cluster/testdata/statusmap/unknown.yaml
vendored
2
pkg/cluster/testdata/statusmap/unknown.yaml
vendored
@ -5,4 +5,4 @@ apiVersion: "example.com/v1"
|
||||
kind: Resource
|
||||
metadata:
|
||||
name: unknown
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
|
@ -25,7 +25,7 @@ apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: first-map
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
labels:
|
||||
cli-utils.sigs.k8s.io/inventory-id: "some id"
|
||||
---
|
||||
@ -33,7 +33,7 @@ apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: second-map
|
||||
namespace: default
|
||||
namespace: target-infra
|
||||
labels:
|
||||
cli-utils.sigs.k8s.io/inventory-id: "some id"
|
||||
|
||||
|
@ -179,7 +179,7 @@ func TestBuilderClusterctl(t *testing.T) {
|
||||
ClusterAPI: v1alpha1.KubeconfigSourceClusterAPI{
|
||||
NamespacedName: v1alpha1.NamespacedName{
|
||||
Name: childClusterID,
|
||||
Namespace: "default",
|
||||
Namespace: "target-infra",
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -192,7 +192,7 @@ func TestBuilderClusterctl(t *testing.T) {
|
||||
ClusterAPI: v1alpha1.KubeconfigSourceClusterAPI{
|
||||
NamespacedName: v1alpha1.NamespacedName{
|
||||
Name: parentClusterID,
|
||||
Namespace: "default",
|
||||
Namespace: "target-infra",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user