Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Update helper.psm1 to set env var for Windows FQDN #2623

Merged
merged 1 commit into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ the legacy Antrea CRDs:
two lists.

```bash
kubectl get lanp.security.antrea.tanzu.vmware.com -o=jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}'
kubectl get anp.crd.antrea.io -o=jsonpath='{range .items[?(@.metadata.annotations.crd\.antrea\.io/managed-by=="crdmirroring-controller")]}{.metadata.name}{"\n"}{end}'
kubectl get lanp.security.antrea.tanzu.vmware.com -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}'
kubectl get anp.crd.antrea.io -o jsonpath='{range .items[?(@.metadata.annotations.crd\.antrea\.io/managed-by=="crdmirroring-controller")]}{.metadata.name}{"\n"}{end}'
```

3. Stop the old version of the application, which uses the legacy CRDs.
Expand All @@ -159,13 +159,13 @@ the legacy Antrea CRDs:
the same command as before should return an empty list:

```bash
kubectl get anp.crd.antrea.io -o=jsonpath='{range .items[?(@.metadata.annotations.crd\.antrea\.io/managed-by=="crdmirroring-controller")]}{.metadata.name}{"\n"}{end}'
kubectl get anp.crd.antrea.io -o jsonpath='{range .items[?(@.metadata.annotations.crd\.antrea\.io/managed-by=="crdmirroring-controller")]}{.metadata.name}{"\n"}{end}'
```

If you remove the filter, all your ANPs should still exist:

```bash
kubectl get anp.crd.antrea.io -o=jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}'
kubectl get anp.crd.antrea.io -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}'
```

6. Safely delete all legacy CRDs previously managed by the application. As an
Expand All @@ -179,7 +179,7 @@ the legacy Antrea CRDs:
Once again, all new ANPs should still exist, which can be confirmed with:

```bash
kubectl get anp.crd.antrea.io -o=jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}'
kubectl get anp.crd.antrea.io -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}'
```

7. Start the new version of the application, which uses the new CRDs. All
Expand Down
6 changes: 6 additions & 0 deletions hack/windows/Helper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ function Install-AntreaAgent {
kubectl config --kubeconfig=$AntreaEtc\antrea-agent.antrea.kubeconfig set-credentials antrea-agent --token=$TOKEN
kubectl config --kubeconfig=$AntreaEtc\antrea-agent.antrea.kubeconfig set-context antrea-agent@antrea --cluster=antrea --user=antrea-agent
kubectl config --kubeconfig=$AntreaEtc\antrea-agent.antrea.kubeconfig use-context antrea-agent@antrea

$KUBE_DNS_SERVICE_HOST=$(kubectl --kubeconfig=$KubeConfig get service -n kube-system kube-dns -o jsonpath="{.spec.clusterIP}")
$KUBE_DNS_SERVICE_PORT=$(kubectl --kubeconfig=$KubeConfig get service -n kube-system kube-dns -o jsonpath="{.spec.ports[0].port}")
[System.Environment]::SetEnvironmentVariable('KUBE_DNS_SERVICE_HOST',$KUBE_DNS_SERVICE_HOST)
[System.Environment]::SetEnvironmentVariable('KUBE_DNS_SERVICE_PORT',$KUBE_DNS_SERVICE_PORT)

return $true
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/infra/vagrant/push_antrea.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ if [ "$FLOW_AGGREGATOR" == "true" ]; then
ssh -F ssh-config k8s-node-control-plane kubectl create namespace elk-flow-collector
ssh -F ssh-config k8s-node-control-plane kubectl create configmap logstash-configmap -n elk-flow-collector --from-file=./elk-flow-collector/logstash/
ssh -F ssh-config k8s-node-control-plane kubectl apply -f elk-flow-collector/elk-flow-collector.yml -n elk-flow-collector
LOGSTASH_CLUSTER_IP=$(ssh -F ssh-config k8s-node-control-plane kubectl get -n elk-flow-collector svc logstash -o=jsonpath='{.spec.clusterIP}')
LOGSTASH_CLUSTER_IP=$(ssh -F ssh-config k8s-node-control-plane kubectl get -n elk-flow-collector svc logstash -o jsonpath='{.spec.clusterIP}')
ELK_ADDR="${LOGSTASH_CLUSTER_IP}:4739:udp"

$THIS_DIR/../../../../hack/generate-manifest-flow-aggregator.sh --mode dev -fc $ELK_ADDR > "${FLOW_AGG_YML}"
Expand Down