Skip to content

Commit

Permalink
Add knitnet operator namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielXLee committed Jul 12, 2021
1 parent fbaa6c5 commit dae7b01
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ The setup can be done by using `kustomize`.
- Export `submariner-broker-info` configmap to a yaml file

```shell
kubectl -n submariner-k8s-broker get cm submariner-broker-info -oyaml > submariner-k8s-broker.yaml
kubectl -n knitnet-operator-system get cm submariner-broker-info -oyaml > submariner-k8s-broker.yaml
```

1. Join cluster to broker
Expand All @@ -109,7 +109,6 @@ The setup can be done by using `kustomize`.
- Create `submariner-broker-info` configmap

```shell
kubectl create ns submariner-k8s-broker
kubectl apply -f submariner-k8s-broker.yaml
```

Expand All @@ -126,7 +125,7 @@ The setup can be done by using `kustomize`.
```shell
kubectl config use-context cluster-b
kubectl -n default create deployment nginx --image=nginx
kubectl -n default expose deployment nginx --port=8080
kubectl -n default expose deployment nginx --port=80
```

1. Export service
Expand All @@ -148,5 +147,5 @@ The setup can be done by using `kustomize`.
```shell
kubectl config use-context cluster-a
kubectl -n default run --generator=run-pod/v1 tmp-shell --rm -i --tty --image quay.io/submariner/nettest -- /bin/bash
curl nginx.default.svc.clusterset.local:8080
curl nginx.default.svc.clusterset.local:80
```
4 changes: 2 additions & 2 deletions controllers/ensures/broker/brokerinfo_cm.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (data *BrokerInfo) WriteConfigMap(c client.Client, instance *operatorv1alph
cm := &v1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: consts.SubmarinerBrokerInfo,
Namespace: consts.SubmarinerBrokerNamespace,
Namespace: consts.KnitnetOperatorNamespace,
},
}
labels := make(map[string]string)
Expand All @@ -121,7 +121,7 @@ func (data *BrokerInfo) WriteConfigMap(c client.Client, instance *operatorv1alph

func NewFromConfigMap(c client.Client) (*BrokerInfo, error) {
cm := &v1.ConfigMap{}
cmKey := types.NamespacedName{Name: consts.SubmarinerBrokerInfo, Namespace: consts.SubmarinerBrokerNamespace}
cmKey := types.NamespacedName{Name: consts.SubmarinerBrokerInfo, Namespace: consts.KnitnetOperatorNamespace}
if err := c.Get(context.TODO(), cmKey, cm); err != nil {
return nil, err
}
Expand Down
2 changes: 2 additions & 0 deletions controllers/ensures/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ const (

//KnitnetNamespaceLabel is the label used to label the resource managed by knitnet
KnitnetNamespaceLabel = "operator.tkestack.io/knitnet-namespace"

KnitnetOperatorNamespace = "knitnet-operator-system"
)

0 comments on commit dae7b01

Please sign in to comment.