Skip to content

Commit

Permalink
vm based providers: Introduce robust stack provider (#954)
Browse files Browse the repository at this point in the history
* psa: Add missing psa configuration for kubeadm_ipv6.conf

Signed-off-by: Or Shoval <[email protected]>

* k8s-1.25-ipv6: Delete provider

Create robust stack provider.

Signed-off-by: Or Shoval <[email protected]>

* publish: Create only the robust provider

Signed-off-by: Or Shoval <[email protected]>

* vm based cluster: Support both dual stack and single stack

In order to reduce busywork and number of providers,
Update the provider to support both single stack and dual stack
according cluster-up configuration.

This commit introduces KUBEVIRT_SINGLE_STACK which determines
which stack to use (default: dual stack).

Remove the logic that allows provisioning single stack,
as we don't need it, and it will be easier to maintain without it.

Signed-off-by: Or Shoval <[email protected]>

* single stack: Move single stack sanity check

Use the sanity check as part of cluster-up
Fix it to wait for the calico pod to be ready before
checking its IP to avoid flakes.

Run single stack cluser-up sanity check as part
of check cluster-up.

Signed-off-by: Or Shoval <[email protected]>

* gocli: Remove provision stack type argument

Since we don't support anymore provisioning of single stack
remove it's flag.

Signed-off-by: Or Shoval <[email protected]>

* k8s-1.26: Support robust stack provider

Signed-off-by: Or Shoval <[email protected]>

* k8s-1.26-centos9: Adapt to robust provider

Signed-off-by: Or Shoval <[email protected]>

---------

Signed-off-by: Or Shoval <[email protected]>
  • Loading branch information
oshoval authored Feb 17, 2023
1 parent 15b2c14 commit 31e5860
Show file tree
Hide file tree
Showing 136 changed files with 136 additions and 83,878 deletions.
8 changes: 7 additions & 1 deletion K8S.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ SSH into a node
```
cluster-up/ssh.sh node01
```

Start single stack IPv6 cluster
```
export KUBEVIRT_SINGLE_STACK=true KUBEVIRT_PROVIDER=k8s-1.25
make cluster-up
```

## Attach to node console with screen and pty
```
# Attach to node01 console
Expand Down
8 changes: 1 addition & 7 deletions cluster-provision/gocli/cmd/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func NewProvisionCommand() *cobra.Command {
provision.Flags().Uint("ssh-port", 0, "port on localhost for ssh server")
provision.Flags().String("container-suffix", "", "use additional suffix for the provisioned container image")
provision.Flags().String("phases", "linux,k8s", "phases to run, possible values: linux,k8s linux k8s")
provision.Flags().String("network-stack", "dualstack", "cluster network stack, possible values: dualstack ipv6")
provision.Flags().StringArray("additional-persistent-kernel-arguments", []string{}, "additional persistent kernel arguments applied after provision")

return provision
Expand Down Expand Up @@ -86,11 +85,6 @@ func provisionCluster(cmd *cobra.Command, args []string) (retErr error) {
target = base + "-dev"
}

networkStack, err := cmd.Flags().GetString("network-stack")
if err != nil {
return err
}

memory, err := cmd.Flags().GetString("memory")
if err != nil {
return err
Expand Down Expand Up @@ -251,7 +245,7 @@ func provisionCluster(cmd *cobra.Command, args []string) (retErr error) {
return err
}

envVars := fmt.Sprintf("version=%s networkstack=%s slim=%t", version, networkStack, slim)
envVars := fmt.Sprintf("version=%s slim=%t", version, slim)
if strings.Contains(phases, "linux") {
// Copy manifests to the VM
err = _cmd(cli, nodeContainer(prefix, nodeName), "scp -r -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vagrant.key -P 22 /scripts/manifests/* [email protected]:/tmp", "copying manifests to the VM")
Expand Down
18 changes: 17 additions & 1 deletion cluster-provision/gocli/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func NewRunCommand() *cobra.Command {
run.Flags().Bool("enable-realtime-scheduler", false, "configures the kernel to allow unlimited runtime for processes that require realtime scheduling")
run.Flags().Bool("enable-fips", false, "enables FIPS")
run.Flags().Bool("enable-psa", false, "Pod Security Admission")
run.Flags().Bool("single-stack", false, "enable single stack IPv6")
return run
}

Expand Down Expand Up @@ -269,7 +270,10 @@ func run(cmd *cobra.Command, args []string) (retErr error) {
if err != nil {
return err
}

singleStack, err := cmd.Flags().GetBool("single-stack")
if err != nil {
return err
}
fipsEnabled, err := cmd.Flags().GetBool("enable-fips")
if err != nil {
return err
Expand Down Expand Up @@ -601,6 +605,18 @@ func run(cmd *cobra.Command, args []string) (retErr error) {
}
}

if singleStack {
ok, err := docker.Exec(cli, nodeContainer(prefix, nodeName),
[]string{"/bin/bash", "-c", "ssh.sh touch /home/vagrant/single_stack"}, os.Stdout)
if err != nil {
return err
}

if !ok {
return fmt.Errorf("provisioning node %s failed (setting singleStack phase)", nodeName)
}
}

if psaEnabled {
success, err := docker.Exec(cli, nodeContainer(prefix, nodeName), []string{"/bin/bash", "-c", "ssh.sh sudo /bin/bash < /scripts/psa.sh"}, os.Stdout)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion cluster-provision/k8s/1.25-ipv6/base

This file was deleted.

55 changes: 0 additions & 55 deletions cluster-provision/k8s/1.25-ipv6/bind_device_to_vfio.sh

This file was deleted.

47 changes: 0 additions & 47 deletions cluster-provision/k8s/1.25-ipv6/conformance.json

This file was deleted.

10 changes: 0 additions & 10 deletions cluster-provision/k8s/1.25-ipv6/extra-pre-pull-images

This file was deleted.

54 changes: 0 additions & 54 deletions cluster-provision/k8s/1.25-ipv6/fetch-images.sh

This file was deleted.

50 changes: 0 additions & 50 deletions cluster-provision/k8s/1.25-ipv6/istio.sh

This file was deleted.

Loading

0 comments on commit 31e5860

Please sign in to comment.