From 4e32f41c836e9c021a12ab8ec720ab6aea4bc3f0 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 10 Aug 2021 14:24:43 -0700 Subject: [PATCH 01/53] move away from v1beta apis --- .../ambassador-operator-crds.yaml.tmpl | 2 +- .../ingress-dns/ingress-dns-pod.yaml.tmpl | 4 +-- .../istio-operator.yaml.tmpl | 2 +- pkg/minikube/cni/calico.go | 30 +++++++++---------- pkg/minikube/cni/flannel.go | 4 +-- .../docs/tutorials/includes/kube-flannel.yaml | 4 +-- test/integration/addons_test.go | 23 ++++---------- .../integration/testdata/nginx-ingv1beta.yaml | 17 ----------- 8 files changed, 28 insertions(+), 58 deletions(-) delete mode 100644 test/integration/testdata/nginx-ingv1beta.yaml diff --git a/deploy/addons/ambassador/ambassador-operator-crds.yaml.tmpl b/deploy/addons/ambassador/ambassador-operator-crds.yaml.tmpl index e8495d9551..b8d52b3b89 100644 --- a/deploy/addons/ambassador/ambassador-operator-crds.yaml.tmpl +++ b/deploy/addons/ambassador/ambassador-operator-crds.yaml.tmpl @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: ambassadorinstallations.getambassador.io diff --git a/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl b/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl index bb0e7c1b3f..4eaa00a48f 100644 --- a/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl +++ b/deploy/addons/ingress-dns/ingress-dns-pod.yaml.tmpl @@ -24,7 +24,7 @@ metadata: app.kubernetes.io/part-of: kube-system addonmanager.kubernetes.io/mode: Reconcile --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: minikube-ingress-dns @@ -47,7 +47,7 @@ rules: - list - watch --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: minikube-ingress-dns diff --git a/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl b/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl index 6c5f23118b..2ac8a34890 100644 --- a/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl +++ b/deploy/addons/istio-provisioner/istio-operator.yaml.tmpl @@ -8,7 +8,7 @@ metadata: addonmanager.kubernetes.io/mode: EnsureExists ... --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: istiooperators.install.istio.io diff --git a/pkg/minikube/cni/calico.go b/pkg/minikube/cni/calico.go index fee66bfd09..7b28fda254 100644 --- a/pkg/minikube/cni/calico.go +++ b/pkg/minikube/cni/calico.go @@ -83,7 +83,7 @@ data: --- # Source: calico/templates/kdd-crds.yaml -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: bgpconfigurations.crd.projectcalico.org @@ -97,7 +97,7 @@ spec: singular: bgpconfiguration --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: bgppeers.crd.projectcalico.org @@ -111,7 +111,7 @@ spec: singular: bgppeer --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: blockaffinities.crd.projectcalico.org @@ -125,7 +125,7 @@ spec: singular: blockaffinity --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clusterinformations.crd.projectcalico.org @@ -139,7 +139,7 @@ spec: singular: clusterinformation --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: felixconfigurations.crd.projectcalico.org @@ -153,7 +153,7 @@ spec: singular: felixconfiguration --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: globalnetworkpolicies.crd.projectcalico.org @@ -169,7 +169,7 @@ spec: - gnp --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: globalnetworksets.crd.projectcalico.org @@ -183,7 +183,7 @@ spec: singular: globalnetworkset --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: hostendpoints.crd.projectcalico.org @@ -197,7 +197,7 @@ spec: singular: hostendpoint --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: ipamblocks.crd.projectcalico.org @@ -211,7 +211,7 @@ spec: singular: ipamblock --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: ipamconfigs.crd.projectcalico.org @@ -225,7 +225,7 @@ spec: singular: ipamconfig --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: ipamhandles.crd.projectcalico.org @@ -239,7 +239,7 @@ spec: singular: ipamhandle --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: ippools.crd.projectcalico.org @@ -253,7 +253,7 @@ spec: singular: ippool --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: kubecontrollersconfigurations.crd.projectcalico.org @@ -266,7 +266,7 @@ spec: plural: kubecontrollersconfigurations singular: kubecontrollersconfiguration --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: networkpolicies.crd.projectcalico.org @@ -280,7 +280,7 @@ spec: singular: networkpolicy --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: networksets.crd.projectcalico.org diff --git a/pkg/minikube/cni/flannel.go b/pkg/minikube/cni/flannel.go index 27e199f118..eefb86a9bf 100644 --- a/pkg/minikube/cni/flannel.go +++ b/pkg/minikube/cni/flannel.go @@ -76,7 +76,7 @@ spec: rule: 'RunAsAny' --- kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 metadata: name: flannel rules: @@ -105,7 +105,7 @@ rules: - patch --- kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 metadata: name: flannel roleRef: diff --git a/site/content/en/docs/tutorials/includes/kube-flannel.yaml b/site/content/en/docs/tutorials/includes/kube-flannel.yaml index bfed51be44..a3e8c916bf 100644 --- a/site/content/en/docs/tutorials/includes/kube-flannel.yaml +++ b/site/content/en/docs/tutorials/includes/kube-flannel.yaml @@ -47,7 +47,7 @@ spec: rule: 'RunAsAny' --- kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 metadata: name: flannel rules: @@ -76,7 +76,7 @@ rules: - patch --- kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 metadata: name: flannel roleRef: diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index 59025f671f..9c5d0270b6 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -159,10 +159,10 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) { t.Fatalf("failed waititing for ingress-nginx-controller : %v", err) } - // create networking.k8s.io/v1beta1 ingress - createv1betaIngress := func() error { + // create networking.k8s.io/v1 ingress + createv1Ingress := func() error { // apply networking.k8s.io/v1beta1 ingress - rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "replace", "--force", "-f", filepath.Join(*testdataDir, "nginx-ingv1beta.yaml"))) + rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "replace", "--force", "-f", filepath.Join(*testdataDir, "nginx-ingv1.yaml"))) if err != nil { return err } @@ -172,8 +172,8 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) { return nil } - // create networking.k8s.io/v1beta1 ingress - if err := retry.Expo(createv1betaIngress, 1*time.Second, Seconds(90)); err != nil { + // create networking.k8s.io/v1 ingress + if err := retry.Expo(createv1Ingress, 1*time.Second, Seconds(90)); err != nil { t.Errorf("failed to create ingress: %v", err) } @@ -224,19 +224,6 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) { t.Errorf("failed to get expected response from %s within minikube: %v", addr, err) } - // create networking.k8s.io/v1 ingress - createv1Ingress := func() error { - // apply networking.k8s.io/v1beta1 ingress - rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "replace", "--force", "-f", filepath.Join(*testdataDir, "nginx-ingv1.yaml"))) - if err != nil { - return err - } - if rr.Stderr.String() != "" { - t.Logf("%v: unexpected stderr: %s (may be temporary)", rr.Command(), rr.Stderr) - } - return nil - } - // create networking.k8s.io/v1 ingress if err := retry.Expo(createv1Ingress, 1*time.Second, Seconds(90)); err != nil { t.Errorf("failed to create ingress: %v", err) diff --git a/test/integration/testdata/nginx-ingv1beta.yaml b/test/integration/testdata/nginx-ingv1beta.yaml deleted file mode 100644 index a714737080..0000000000 --- a/test/integration/testdata/nginx-ingv1beta.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: networking.k8s.io/v1beta1 -kind: Ingress -metadata: - name: nginx-ingress - annotations: - kubernetes.io/ingress.class: "nginx" - labels: - integration-test: ingress -spec: - rules: - - host: nginx.example.com - http: - paths: - - path: "/" - backend: - serviceName: nginx - servicePort: 80 \ No newline at end of file From 2646b49a19431d99515792d4ab551f0c4fe33265 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Wed, 11 Aug 2021 11:15:51 -0700 Subject: [PATCH 02/53] add TestStartStop to Cloud Shell tests --- hack/jenkins/cloud_shell_functional_tests_docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/jenkins/cloud_shell_functional_tests_docker.sh b/hack/jenkins/cloud_shell_functional_tests_docker.sh index 70c937fd23..4433bc9b4d 100755 --- a/hack/jenkins/cloud_shell_functional_tests_docker.sh +++ b/hack/jenkins/cloud_shell_functional_tests_docker.sh @@ -30,7 +30,7 @@ gcloud cloud-shell ssh --authorize-session << EOF DRIVER="docker" JOB_NAME="Docker_Cloud_Shell" CONTAINER_RUNTIME="docker" - EXTRA_TEST_ARGS="-test.run (TestFunctional|TestAddons)" + EXTRA_TEST_ARGS="-test.run (TestFunctional|TestAddons|TestStartStop/group/default-k8s-different-port)" # Need to set these in cloud-shell or will not be present in common.sh MINIKUBE_LOCATION=$MINIKUBE_LOCATION From 72c5ee1e3280b30d4064dc5c1d03f75c3d50104c Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Wed, 11 Aug 2021 12:49:48 -0700 Subject: [PATCH 03/53] widen it to all start stop tests --- hack/jenkins/cloud_shell_functional_tests_docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/jenkins/cloud_shell_functional_tests_docker.sh b/hack/jenkins/cloud_shell_functional_tests_docker.sh index 4433bc9b4d..8f743dcc3e 100755 --- a/hack/jenkins/cloud_shell_functional_tests_docker.sh +++ b/hack/jenkins/cloud_shell_functional_tests_docker.sh @@ -30,7 +30,7 @@ gcloud cloud-shell ssh --authorize-session << EOF DRIVER="docker" JOB_NAME="Docker_Cloud_Shell" CONTAINER_RUNTIME="docker" - EXTRA_TEST_ARGS="-test.run (TestFunctional|TestAddons|TestStartStop/group/default-k8s-different-port)" +EXTRA_TEST_ARGS="-test.run (TestFunctional|TestAddons|TestStartStop)" # Need to set these in cloud-shell or will not be present in common.sh MINIKUBE_LOCATION=$MINIKUBE_LOCATION From cf10ce5663b72314ac69739ecea105d9a9a7dd77 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Thu, 12 Aug 2021 14:40:42 -0700 Subject: [PATCH 04/53] run simple test for cloud shell --- test/integration/start_stop_delete_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 85e0f0f924..c756965d03 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -33,6 +33,7 @@ import ( "github.com/google/go-cmp/cmp" "k8s.io/minikube/pkg/minikube/bootstrapper/images" "k8s.io/minikube/pkg/minikube/constants" + "k8s.io/minikube/pkg/minikube/detect" ) // TestStartStop tests starting, stopping and restarting a minikube clusters with various Kubernetes versions and configurations @@ -76,6 +77,16 @@ func TestStartStop(t *testing.T) { }}, } + if detect.IsCloudShell() { + tests = []struct { + name string + version string + args []string + }{ + {"cloud-shell", constants.DefaultKubernetesVersion, []string{}}, + } + } + for _, tc := range tests { tc := tc t.Run(tc.name, func(t *testing.T) { From 7809b3b2aed53da256662fa095c641e952d0230f Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Thu, 12 Aug 2021 15:22:32 -0700 Subject: [PATCH 05/53] update calico to v 3.20 --- pkg/minikube/bootstrapper/images/images.go | 27 +- pkg/minikube/cni/calico.go | 862 +---- pkg/minikube/cni/calico.yaml | 4090 ++++++++++++++++++++ 3 files changed, 4127 insertions(+), 852 deletions(-) create mode 100644 pkg/minikube/cni/calico.yaml diff --git a/pkg/minikube/bootstrapper/images/images.go b/pkg/minikube/bootstrapper/images/images.go index 4ce501418f..6d8fcf4b07 100644 --- a/pkg/minikube/bootstrapper/images/images.go +++ b/pkg/minikube/bootstrapper/images/images.go @@ -163,18 +163,37 @@ func KindNet(repo string) string { return path.Join(repo, "kindnetd:v20210326-1e038dc5") } +// all calico images are from https://docs.projectcalico.org/manifests/calico.yaml +const calicoVersion = "v3.20.0" + // CalicoDaemonSet returns the image used for calicoDaemonSet func CalicoDaemonSet(repo string) string { if repo == "" { - repo = "calico" + repo = "docker.io/calico" } - return path.Join(repo, "node:v3.14.1") + return path.Join(repo, "node:"+calicoVersion) } // CalicoDeployment returns the image used for calicoDeployment func CalicoDeployment(repo string) string { if repo == "" { - repo = "calico" + repo = "docker.io/calico" } - return path.Join(repo, "kube-controllers:v3.14.1") + return path.Join(repo, "kube-controllers::"+calicoVersion) +} + +// CalicoFelixDriver returns image used for felix driver +func CalicoFelixDriver(repo string) string { + if repo == "" { + repo = "docker.io/calico" + } + return path.Join(repo, "pod2daemon-flexvol::"+calicoVersion) +} + +// CalicoBin returns image used for calico binary image +func CalicoBin(repo string) string { + if repo == "" { + repo = "docker.io/calico" + } + return path.Join(repo, "cni::"+calicoVersion) } diff --git a/pkg/minikube/cni/calico.go b/pkg/minikube/cni/calico.go index 7b28fda254..11c03a233e 100644 --- a/pkg/minikube/cni/calico.go +++ b/pkg/minikube/cni/calico.go @@ -18,6 +18,7 @@ package cni import ( "bytes" + _ "embed" "text/template" "github.com/pkg/errors" @@ -26,851 +27,12 @@ import ( "k8s.io/minikube/pkg/minikube/config" ) +// https://docs.projectcalico.org/manifests/calico.yaml +//go:embed calico.yaml +var calicoYaml string + // calicoTmpl is from https://docs.projectcalico.org/manifests/calico.yaml -var calicoTmpl = template.Must(template.New("calico").Parse(`--- -# Source: calico/templates/calico-config.yaml -# This ConfigMap is used to configure a self-hosted Calico installation. -kind: ConfigMap -apiVersion: v1 -metadata: - name: calico-config - namespace: kube-system -data: - # Typha is disabled. - typha_service_name: "none" - # Configure the backend to use. - calico_backend: "bird" - # Configure the MTU to use for workload interfaces and the - # tunnels. For IPIP, set to your network MTU - 20; for VXLAN - # set to your network MTU - 50. - veth_mtu: "1440" - - # The CNI network configuration to install on each node. The special - # values in this config will be automatically populated. - cni_network_config: |- - { - "name": "k8s-pod-network", - "cniVersion": "0.3.1", - "plugins": [ - { - "type": "calico", - "log_level": "info", - "datastore_type": "kubernetes", - "nodename": "__KUBERNETES_NODE_NAME__", - "mtu": __CNI_MTU__, - "ipam": { - "type": "calico-ipam" - }, - "policy": { - "type": "k8s" - }, - "kubernetes": { - "kubeconfig": "__KUBECONFIG_FILEPATH__" - } - }, - { - "type": "portmap", - "snat": true, - "capabilities": {"portMappings": true} - }, - { - "type": "bandwidth", - "capabilities": {"bandwidth": true} - } - ] - } - ---- -# Source: calico/templates/kdd-crds.yaml - -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: bgpconfigurations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: BGPConfiguration - plural: bgpconfigurations - singular: bgpconfiguration - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: bgppeers.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: BGPPeer - plural: bgppeers - singular: bgppeer - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: blockaffinities.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: BlockAffinity - plural: blockaffinities - singular: blockaffinity - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: clusterinformations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: ClusterInformation - plural: clusterinformations - singular: clusterinformation - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: felixconfigurations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: FelixConfiguration - plural: felixconfigurations - singular: felixconfiguration - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: globalnetworkpolicies.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: GlobalNetworkPolicy - plural: globalnetworkpolicies - singular: globalnetworkpolicy - shortNames: - - gnp - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: globalnetworksets.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: GlobalNetworkSet - plural: globalnetworksets - singular: globalnetworkset - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: hostendpoints.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: HostEndpoint - plural: hostendpoints - singular: hostendpoint - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: ipamblocks.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: IPAMBlock - plural: ipamblocks - singular: ipamblock - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: ipamconfigs.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: IPAMConfig - plural: ipamconfigs - singular: ipamconfig - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: ipamhandles.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: IPAMHandle - plural: ipamhandles - singular: ipamhandle - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: ippools.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: IPPool - plural: ippools - singular: ippool - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: kubecontrollersconfigurations.crd.projectcalico.org -spec: - scope: Cluster - group: crd.projectcalico.org - version: v1 - names: - kind: KubeControllersConfiguration - plural: kubecontrollersconfigurations - singular: kubecontrollersconfiguration ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: networkpolicies.crd.projectcalico.org -spec: - scope: Namespaced - group: crd.projectcalico.org - version: v1 - names: - kind: NetworkPolicy - plural: networkpolicies - singular: networkpolicy - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: networksets.crd.projectcalico.org -spec: - scope: Namespaced - group: crd.projectcalico.org - version: v1 - names: - kind: NetworkSet - plural: networksets - singular: networkset - ---- ---- -# Source: calico/templates/rbac.yaml - -# Include a clusterrole for the kube-controllers component, -# and bind it to the calico-kube-controllers serviceaccount. -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: calico-kube-controllers -rules: - # Nodes are watched to monitor for deletions. - - apiGroups: [""] - resources: - - nodes - verbs: - - watch - - list - - get - # Pods are queried to check for existence. - - apiGroups: [""] - resources: - - pods - verbs: - - get - # IPAM resources are manipulated when nodes are deleted. - - apiGroups: ["crd.projectcalico.org"] - resources: - - ippools - verbs: - - list - - apiGroups: ["crd.projectcalico.org"] - resources: - - blockaffinities - - ipamblocks - - ipamhandles - verbs: - - get - - list - - create - - update - - delete - # kube-controllers manages hostendpoints. - - apiGroups: ["crd.projectcalico.org"] - resources: - - hostendpoints - verbs: - - get - - list - - create - - update - - delete - # Needs access to update clusterinformations. - - apiGroups: ["crd.projectcalico.org"] - resources: - - clusterinformations - verbs: - - get - - create - - update - # KubeControllersConfiguration is where it gets its config - - apiGroups: ["crd.projectcalico.org"] - resources: - - kubecontrollersconfigurations - verbs: - # read its own config - - get - # create a default if none exists - - create - # update status - - update - # watch for changes - - watch ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: calico-kube-controllers -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: calico-kube-controllers -subjects: -- kind: ServiceAccount - name: calico-kube-controllers - namespace: kube-system ---- -# Include a clusterrole for the calico-node DaemonSet, -# and bind it to the calico-node serviceaccount. -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: calico-node -rules: - # The CNI plugin needs to get pods, nodes, and namespaces. - - apiGroups: [""] - resources: - - pods - - nodes - - namespaces - verbs: - - get - - apiGroups: [""] - resources: - - endpoints - - services - verbs: - # Used to discover service IPs for advertisement. - - watch - - list - # Used to discover Typhas. - - get - # Pod CIDR auto-detection on kubeadm needs access to config maps. - - apiGroups: [""] - resources: - - configmaps - verbs: - - get - - apiGroups: [""] - resources: - - nodes/status - verbs: - # Needed for clearing NodeNetworkUnavailable flag. - - patch - # Calico stores some configuration information in node annotations. - - update - # Watch for changes to Kubernetes NetworkPolicies. - - apiGroups: ["networking.k8s.io"] - resources: - - networkpolicies - verbs: - - watch - - list - # Used by Calico for policy information. - - apiGroups: [""] - resources: - - pods - - namespaces - - serviceaccounts - verbs: - - list - - watch - # The CNI plugin patches pods/status. - - apiGroups: [""] - resources: - - pods/status - verbs: - - patch - # Calico monitors various CRDs for config. - - apiGroups: ["crd.projectcalico.org"] - resources: - - globalfelixconfigs - - felixconfigurations - - bgppeers - - globalbgpconfigs - - bgpconfigurations - - ippools - - ipamblocks - - globalnetworkpolicies - - globalnetworksets - - networkpolicies - - networksets - - clusterinformations - - hostendpoints - - blockaffinities - verbs: - - get - - list - - watch - # Calico must create and update some CRDs on startup. - - apiGroups: ["crd.projectcalico.org"] - resources: - - ippools - - felixconfigurations - - clusterinformations - verbs: - - create - - update - # Calico stores some configuration information on the node. - - apiGroups: [""] - resources: - - nodes - verbs: - - get - - list - - watch - # These permissions are only required for upgrade from v2.6, and can - # be removed after upgrade or on fresh installations. - - apiGroups: ["crd.projectcalico.org"] - resources: - - bgpconfigurations - - bgppeers - verbs: - - create - - update - # These permissions are required for Calico CNI to perform IPAM allocations. - - apiGroups: ["crd.projectcalico.org"] - resources: - - blockaffinities - - ipamblocks - - ipamhandles - verbs: - - get - - list - - create - - update - - delete - - apiGroups: ["crd.projectcalico.org"] - resources: - - ipamconfigs - verbs: - - get - # Block affinities must also be watchable by confd for route aggregation. - - apiGroups: ["crd.projectcalico.org"] - resources: - - blockaffinities - verbs: - - watch - # The Calico IPAM migration needs to get daemonsets. These permissions can be - # removed if not upgrading from an installation using host-local IPAM. - - apiGroups: ["apps"] - resources: - - daemonsets - verbs: - - get - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: calico-node -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: calico-node -subjects: -- kind: ServiceAccount - name: calico-node - namespace: kube-system - ---- -# Source: calico/templates/calico-node.yaml -# This manifest installs the calico-node container, as well -# as the CNI plugins and network config on -# each master and worker node in a Kubernetes cluster. -kind: DaemonSet -apiVersion: apps/v1 -metadata: - name: calico-node - namespace: kube-system - labels: - k8s-app: calico-node -spec: - selector: - matchLabels: - k8s-app: calico-node - updateStrategy: - type: RollingUpdate - rollingUpdate: - maxUnavailable: 1 - template: - metadata: - labels: - k8s-app: calico-node - annotations: - # This, along with the CriticalAddonsOnly toleration below, - # marks the pod as a critical add-on, ensuring it gets - # priority scheduling and that its resources are reserved - # if it ever gets evicted. - scheduler.alpha.kubernetes.io/critical-pod: '' - spec: - nodeSelector: - kubernetes.io/os: linux - hostNetwork: true - tolerations: - # Make sure calico-node gets scheduled on all nodes. - - effect: NoSchedule - operator: Exists - # Mark the pod as a critical add-on for rescheduling. - - key: CriticalAddonsOnly - operator: Exists - - effect: NoExecute - operator: Exists - serviceAccountName: calico-node - # Minimize downtime during a rolling upgrade or deletion; tell Kubernetes to do a "force - # deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods. - terminationGracePeriodSeconds: 0 - priorityClassName: system-node-critical - initContainers: - # This container performs upgrade from host-local IPAM to calico-ipam. - # It can be deleted if this is a fresh installation, or if you have already - # upgraded to use calico-ipam. - - name: upgrade-ipam - image: calico/cni:v3.14.1 - command: ["/opt/cni/bin/calico-ipam", "-upgrade"] - env: - - name: KUBERNETES_NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: CALICO_NETWORKING_BACKEND - valueFrom: - configMapKeyRef: - name: calico-config - key: calico_backend - volumeMounts: - - mountPath: /var/lib/cni/networks - name: host-local-net-dir - - mountPath: /host/opt/cni/bin - name: cni-bin-dir - securityContext: - privileged: true - # This container installs the CNI binaries - # and CNI network config file on each node. - - name: install-cni - image: calico/cni:v3.14.1 - command: ["/install-cni.sh"] - env: - # Name of the CNI config file to create. - - name: CNI_CONF_NAME - value: "10-calico.conflist" - # The CNI network config to install on each node. - - name: CNI_NETWORK_CONFIG - valueFrom: - configMapKeyRef: - name: calico-config - key: cni_network_config - # Set the hostname based on the k8s node name. - - name: KUBERNETES_NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - # CNI MTU Config variable - - name: CNI_MTU - valueFrom: - configMapKeyRef: - name: calico-config - key: veth_mtu - # Prevents the container from sleeping forever. - - name: SLEEP - value: "false" - volumeMounts: - - mountPath: /host/opt/cni/bin - name: cni-bin-dir - - mountPath: /host/etc/cni/net.d - name: cni-net-dir - securityContext: - privileged: true - # Adds a Flex Volume Driver that creates a per-pod Unix Domain Socket to allow Dikastes - # to communicate with Felix over the Policy Sync API. - - name: flexvol-driver - image: calico/pod2daemon-flexvol:v3.14.1 - volumeMounts: - - name: flexvol-driver-host - mountPath: /host/driver - securityContext: - privileged: true - containers: - # Runs calico-node container on each Kubernetes node. This - # container programs network policy and routes on each - # host. - - name: calico-node - image: {{ .DaemonSetImageName }} - env: - # Use Kubernetes API as the backing datastore. - - name: DATASTORE_TYPE - value: "kubernetes" - # Wait for the datastore. - - name: WAIT_FOR_DATASTORE - value: "true" - # Set based on the k8s node name. - - name: NODENAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - # Choose the backend to use. - - name: CALICO_NETWORKING_BACKEND - valueFrom: - configMapKeyRef: - name: calico-config - key: calico_backend - # Cluster type to identify the deployment type - - name: CLUSTER_TYPE - value: "k8s,bgp" - # Auto-detect the BGP IP address. - - name: IP - value: "autodetect" - # Enable IPIP - - name: CALICO_IPV4POOL_IPIP - value: "Always" - # Enable or Disable VXLAN on the default IP pool. - - name: CALICO_IPV4POOL_VXLAN - value: "Never" - # Set MTU for tunnel device used if ipip is enabled - - name: FELIX_IPINIPMTU - valueFrom: - configMapKeyRef: - name: calico-config - key: veth_mtu - # Set MTU for the VXLAN tunnel device. - - name: FELIX_VXLANMTU - valueFrom: - configMapKeyRef: - name: calico-config - key: veth_mtu - # The default IPv4 pool to create on startup if none exists. Pod IPs will be - # chosen from this range. Changing this value after installation will have - # no effect. This should fall within --cluster-cidr - # - name: CALICO_IPV4POOL_CIDR - # value: "192.168.0.0/16" - # Disable file logging so kubectl logs works. - - name: CALICO_DISABLE_FILE_LOGGING - value: "true" - # Set Felix endpoint to host default action to ACCEPT. - - name: FELIX_DEFAULTENDPOINTTOHOSTACTION - value: "ACCEPT" - # Disable IPv6 on Kubernetes. - - name: FELIX_IPV6SUPPORT - value: "false" - # Set Felix logging to "info" - - name: FELIX_LOGSEVERITYSCREEN - value: "info" - - name: FELIX_HEALTHENABLED - value: "true" - - name: IP_AUTODETECTION_METHOD - value: interface=eth.* - securityContext: - privileged: true - resources: - requests: - cpu: 250m - livenessProbe: - exec: - command: - - /bin/calico-node - - -felix-live - - -bird-live - periodSeconds: 10 - initialDelaySeconds: 10 - failureThreshold: 6 - readinessProbe: - exec: - command: - - /bin/calico-node - - -felix-ready - - -bird-ready - periodSeconds: 10 - volumeMounts: - - mountPath: /lib/modules - name: lib-modules - readOnly: true - - mountPath: /run/xtables.lock - name: xtables-lock - readOnly: false - - mountPath: /var/run/calico - name: var-run-calico - readOnly: false - - mountPath: /var/lib/calico - name: var-lib-calico - readOnly: false - - name: policysync - mountPath: /var/run/nodeagent - volumes: - # Used by calico-node. - - name: lib-modules - hostPath: - path: /lib/modules - - name: var-run-calico - hostPath: - path: /var/run/calico - - name: var-lib-calico - hostPath: - path: /var/lib/calico - - name: xtables-lock - hostPath: - path: /run/xtables.lock - type: FileOrCreate - # Used to install CNI. - - name: cni-bin-dir - hostPath: - path: /opt/cni/bin - - name: cni-net-dir - hostPath: - path: /etc/cni/net.d - # Mount in the directory for host-local IPAM allocations. This is - # used when upgrading from host-local to calico-ipam, and can be removed - # if not using the upgrade-ipam init container. - - name: host-local-net-dir - hostPath: - path: /var/lib/cni/networks - # Used to create per-pod Unix Domain Sockets - - name: policysync - hostPath: - type: DirectoryOrCreate - path: /var/run/nodeagent - # Used to install Flex Volume Driver - - name: flexvol-driver-host - hostPath: - type: DirectoryOrCreate - path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/nodeagent~uds ---- - -apiVersion: v1 -kind: ServiceAccount -metadata: - name: calico-node - namespace: kube-system - ---- -# Source: calico/templates/calico-kube-controllers.yaml -# See https://github.com/projectcalico/kube-controllers -apiVersion: apps/v1 -kind: Deployment -metadata: - name: calico-kube-controllers - namespace: kube-system - labels: - k8s-app: calico-kube-controllers -spec: - # The controllers can only have a single active instance. - replicas: 1 - selector: - matchLabels: - k8s-app: calico-kube-controllers - strategy: - type: Recreate - template: - metadata: - name: calico-kube-controllers - namespace: kube-system - labels: - k8s-app: calico-kube-controllers - annotations: - scheduler.alpha.kubernetes.io/critical-pod: '' - spec: - nodeSelector: - kubernetes.io/os: linux - tolerations: - # Mark the pod as a critical add-on for rescheduling. - - key: CriticalAddonsOnly - operator: Exists - - key: node-role.kubernetes.io/master - effect: NoSchedule - serviceAccountName: calico-kube-controllers - priorityClassName: system-cluster-critical - containers: - - name: calico-kube-controllers - image: {{ .DeploymentImageName }} - env: - # Choose which controllers to run. - - name: ENABLED_CONTROLLERS - value: node - - name: DATASTORE_TYPE - value: kubernetes - readinessProbe: - exec: - command: - - /usr/bin/check-status - - -r - ---- - -apiVersion: v1 -kind: ServiceAccount -metadata: - name: calico-kube-controllers - namespace: kube-system - ---- -# Source: calico/templates/calico-etcd-secrets.yaml - ---- -# Source: calico/templates/calico-typha.yaml - ---- -# Source: calico/templates/configure-canal.yaml - -`)) +var calicoTmpl = template.Must(template.New("calico").Parse(calicoYaml)) // Calico is the Calico CNI manager type Calico struct { @@ -878,8 +40,10 @@ type Calico struct { } type calicoTmplStruct struct { - DeploymentImageName string - DaemonSetImageName string + DeploymentImageName string + DaemonSetImageName string + FelixDriverImageName string + BinaryImageName string } // String returns a string representation of this CNI @@ -890,8 +54,10 @@ func (c Calico) String() string { // manifest returns a Kubernetes manifest for a CNI func (c Calico) manifest() (assets.CopyableFile, error) { input := &calicoTmplStruct{ - DeploymentImageName: images.CalicoDeployment(c.cc.KubernetesConfig.ImageRepository), - DaemonSetImageName: images.CalicoDaemonSet(c.cc.KubernetesConfig.ImageRepository), + DeploymentImageName: images.CalicoDeployment(c.cc.KubernetesConfig.ImageRepository), + DaemonSetImageName: images.CalicoDaemonSet(c.cc.KubernetesConfig.ImageRepository), + FelixDriverImageName: images.CalicoFelixDriver(c.cc.KubernetesConfig.ImageRepository), + BinaryImageName: images.CalicoBin(c.cc.KubernetesConfig.ImageRepository), } b := bytes.Buffer{} diff --git a/pkg/minikube/cni/calico.yaml b/pkg/minikube/cni/calico.yaml new file mode 100644 index 0000000000..8f9d2776bf --- /dev/null +++ b/pkg/minikube/cni/calico.yaml @@ -0,0 +1,4090 @@ +--- +# Source: calico/templates/calico-config.yaml +# This ConfigMap is used to configure a self-hosted Calico installation. +kind: ConfigMap +apiVersion: v1 +metadata: + name: calico-config + namespace: kube-system +data: + # Typha is disabled. + typha_service_name: "none" + # Configure the backend to use. + calico_backend: "bird" + + # Configure the MTU to use for workload interfaces and tunnels. + # By default, MTU is auto-detected, and explicitly setting this field should not be required. + # You can override auto-detection by providing a non-zero value. + veth_mtu: "0" + + # The CNI network configuration to install on each node. The special + # values in this config will be automatically populated. + cni_network_config: |- + { + "name": "k8s-pod-network", + "cniVersion": "0.3.1", + "plugins": [ + { + "type": "calico", + "log_level": "info", + "log_file_path": "/var/log/calico/cni/cni.log", + "datastore_type": "kubernetes", + "nodename": "__KUBERNETES_NODE_NAME__", + "mtu": __CNI_MTU__, + "ipam": { + "type": "calico-ipam" + }, + "policy": { + "type": "k8s" + }, + "kubernetes": { + "kubeconfig": "__KUBECONFIG_FILEPATH__" + } + }, + { + "type": "portmap", + "snat": true, + "capabilities": {"portMappings": true} + }, + { + "type": "bandwidth", + "capabilities": {"bandwidth": true} + } + ] + } + +--- +# Source: calico/templates/kdd-crds.yaml + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: bgpconfigurations.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: BGPConfiguration + listKind: BGPConfigurationList + plural: bgpconfigurations + singular: bgpconfiguration + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + description: BGPConfiguration contains the configuration for any BGP routing. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: BGPConfigurationSpec contains the values of the BGP configuration. + properties: + asNumber: + description: 'ASNumber is the default AS number used by a node. [Default: + 64512]' + format: int32 + type: integer + communities: + description: Communities is a list of BGP community values and their + arbitrary names for tagging routes. + items: + description: Community contains standard or large community value + and its name. + properties: + name: + description: Name given to community value. + type: string + value: + description: Value must be of format `aa:nn` or `aa:nn:mm`. + For standard community use `aa:nn` format, where `aa` and + `nn` are 16 bit number. For large community use `aa:nn:mm` + format, where `aa`, `nn` and `mm` are 32 bit number. Where, + `aa` is an AS Number, `nn` and `mm` are per-AS identifier. + pattern: ^(\d+):(\d+)$|^(\d+):(\d+):(\d+)$ + type: string + type: object + type: array + listenPort: + description: ListenPort is the port where BGP protocol should listen. + Defaults to 179 + maximum: 65535 + minimum: 1 + type: integer + logSeverityScreen: + description: 'LogSeverityScreen is the log severity above which logs + are sent to the stdout. [Default: INFO]' + type: string + nodeToNodeMeshEnabled: + description: 'NodeToNodeMeshEnabled sets whether full node to node + BGP mesh is enabled. [Default: true]' + type: boolean + prefixAdvertisements: + description: PrefixAdvertisements contains per-prefix advertisement + configuration. + items: + description: PrefixAdvertisement configures advertisement properties + for the specified CIDR. + properties: + cidr: + description: CIDR for which properties should be advertised. + type: string + communities: + description: Communities can be list of either community names + already defined in `Specs.Communities` or community value + of format `aa:nn` or `aa:nn:mm`. For standard community use + `aa:nn` format, where `aa` and `nn` are 16 bit number. For + large community use `aa:nn:mm` format, where `aa`, `nn` and + `mm` are 32 bit number. Where,`aa` is an AS Number, `nn` and + `mm` are per-AS identifier. + items: + type: string + type: array + type: object + type: array + serviceClusterIPs: + description: ServiceClusterIPs are the CIDR blocks from which service + cluster IPs are allocated. If specified, Calico will advertise these + blocks, as well as any cluster IPs within them. + items: + description: ServiceClusterIPBlock represents a single allowed ClusterIP + CIDR block. + properties: + cidr: + type: string + type: object + type: array + serviceExternalIPs: + description: ServiceExternalIPs are the CIDR blocks for Kubernetes + Service External IPs. Kubernetes Service ExternalIPs will only be + advertised if they are within one of these blocks. + items: + description: ServiceExternalIPBlock represents a single allowed + External IP CIDR block. + properties: + cidr: + type: string + type: object + type: array + serviceLoadBalancerIPs: + description: ServiceLoadBalancerIPs are the CIDR blocks for Kubernetes + Service LoadBalancer IPs. Kubernetes Service status.LoadBalancer.Ingress + IPs will only be advertised if they are within one of these blocks. + items: + description: ServiceLoadBalancerIPBlock represents a single allowed + LoadBalancer IP CIDR block. + properties: + cidr: + type: string + type: object + type: array + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: bgppeers.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: BGPPeer + listKind: BGPPeerList + plural: bgppeers + singular: bgppeer + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: BGPPeerSpec contains the specification for a BGPPeer resource. + properties: + asNumber: + description: The AS Number of the peer. + format: int32 + type: integer + keepOriginalNextHop: + description: Option to keep the original nexthop field when routes + are sent to a BGP Peer. Setting "true" configures the selected BGP + Peers node to use the "next hop keep;" instead of "next hop self;"(default) + in the specific branch of the Node on "bird.cfg". + type: boolean + maxRestartTime: + description: Time to allow for software restart. When specified, this + is configured as the graceful restart timeout. When not specified, + the BIRD default of 120s is used. + type: string + node: + description: The node name identifying the Calico node instance that + is targeted by this peer. If this is not set, and no nodeSelector + is specified, then this BGP peer selects all nodes in the cluster. + type: string + nodeSelector: + description: Selector for the nodes that should have this peering. When + this is set, the Node field must be empty. + type: string + password: + description: Optional BGP password for the peerings generated by this + BGPPeer resource. + properties: + secretKeyRef: + description: Selects a key of a secret in the node pod's namespace. + properties: + key: + description: The key of the secret to select from. Must be + a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must be + defined + type: boolean + required: + - key + type: object + type: object + peerIP: + description: The IP address of the peer followed by an optional port + number to peer with. If port number is given, format should be `[]:port` + or `:` for IPv4. If optional port number is not set, + and this peer IP and ASNumber belongs to a calico/node with ListenPort + set in BGPConfiguration, then we use that port to peer. + type: string + peerSelector: + description: Selector for the remote nodes to peer with. When this + is set, the PeerIP and ASNumber fields must be empty. For each + peering between the local node and selected remote nodes, we configure + an IPv4 peering if both ends have NodeBGPSpec.IPv4Address specified, + and an IPv6 peering if both ends have NodeBGPSpec.IPv6Address specified. The + remote AS number comes from the remote node's NodeBGPSpec.ASNumber, + or the global default if that is not set. + type: string + sourceAddress: + description: Specifies whether and how to configure a source address + for the peerings generated by this BGPPeer resource. Default value + "UseNodeIP" means to configure the node IP as the source address. "None" + means not to configure a source address. + type: string + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: blockaffinities.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: BlockAffinity + listKind: BlockAffinityList + plural: blockaffinities + singular: blockaffinity + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: BlockAffinitySpec contains the specification for a BlockAffinity + resource. + properties: + cidr: + type: string + deleted: + description: Deleted indicates that this block affinity is being deleted. + This field is a string for compatibility with older releases that + mistakenly treat this field as a string. + type: string + node: + type: string + state: + type: string + required: + - cidr + - deleted + - node + - state + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: clusterinformations.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: ClusterInformation + listKind: ClusterInformationList + plural: clusterinformations + singular: clusterinformation + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + description: ClusterInformation contains the cluster specific information. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ClusterInformationSpec contains the values of describing + the cluster. + properties: + calicoVersion: + description: CalicoVersion is the version of Calico that the cluster + is running + type: string + clusterGUID: + description: ClusterGUID is the GUID of the cluster + type: string + clusterType: + description: ClusterType describes the type of the cluster + type: string + datastoreReady: + description: DatastoreReady is used during significant datastore migrations + to signal to components such as Felix that it should wait before + accessing the datastore. + type: boolean + variant: + description: Variant declares which variant of Calico should be active. + type: string + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: felixconfigurations.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: FelixConfiguration + listKind: FelixConfigurationList + plural: felixconfigurations + singular: felixconfiguration + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + description: Felix Configuration contains the configuration for Felix. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: FelixConfigurationSpec contains the values of the Felix configuration. + properties: + allowIPIPPacketsFromWorkloads: + description: 'AllowIPIPPacketsFromWorkloads controls whether Felix + will add a rule to drop IPIP encapsulated traffic from workloads + [Default: false]' + type: boolean + allowVXLANPacketsFromWorkloads: + description: 'AllowVXLANPacketsFromWorkloads controls whether Felix + will add a rule to drop VXLAN encapsulated traffic from workloads + [Default: false]' + type: boolean + awsSrcDstCheck: + description: 'Set source-destination-check on AWS EC2 instances. Accepted + value must be one of "DoNothing", "Enabled" or "Disabled". [Default: + DoNothing]' + enum: + - DoNothing + - Enable + - Disable + type: string + bpfConnectTimeLoadBalancingEnabled: + description: 'BPFConnectTimeLoadBalancingEnabled when in BPF mode, + controls whether Felix installs the connection-time load balancer. The + connect-time load balancer is required for the host to be able to + reach Kubernetes services and it improves the performance of pod-to-service + connections. The only reason to disable it is for debugging purposes. [Default: + true]' + type: boolean + bpfDataIfacePattern: + description: BPFDataIfacePattern is a regular expression that controls + which interfaces Felix should attach BPF programs to in order to + catch traffic to/from the network. This needs to match the interfaces + that Calico workload traffic flows over as well as any interfaces + that handle incoming traffic to nodeports and services from outside + the cluster. It should not match the workload interfaces (usually + named cali...). + type: string + bpfDisableUnprivileged: + description: 'BPFDisableUnprivileged, if enabled, Felix sets the kernel.unprivileged_bpf_disabled + sysctl to disable unprivileged use of BPF. This ensures that unprivileged + users cannot access Calico''s BPF maps and cannot insert their own + BPF programs to interfere with Calico''s. [Default: true]' + type: boolean + bpfEnabled: + description: 'BPFEnabled, if enabled Felix will use the BPF dataplane. + [Default: false]' + type: boolean + bpfExternalServiceMode: + description: 'BPFExternalServiceMode in BPF mode, controls how connections + from outside the cluster to services (node ports and cluster IPs) + are forwarded to remote workloads. If set to "Tunnel" then both + request and response traffic is tunneled to the remote node. If + set to "DSR", the request traffic is tunneled but the response traffic + is sent directly from the remote node. In "DSR" mode, the remote + node appears to use the IP of the ingress node; this requires a + permissive L2 network. [Default: Tunnel]' + type: string + bpfExtToServiceConnmark: + description: 'BPFExtToServiceConnmark in BPF mode, controls a + 32bit mark that is set on connections from an external client to + a local service. This mark allows us to control how packets of + that connection are routed within the host and how is routing + intepreted by RPF check. [Default: 0]' + type: integer + + bpfKubeProxyEndpointSlicesEnabled: + description: BPFKubeProxyEndpointSlicesEnabled in BPF mode, controls + whether Felix's embedded kube-proxy accepts EndpointSlices or not. + type: boolean + bpfKubeProxyIptablesCleanupEnabled: + description: 'BPFKubeProxyIptablesCleanupEnabled, if enabled in BPF + mode, Felix will proactively clean up the upstream Kubernetes kube-proxy''s + iptables chains. Should only be enabled if kube-proxy is not running. [Default: + true]' + type: boolean + bpfKubeProxyMinSyncPeriod: + description: 'BPFKubeProxyMinSyncPeriod, in BPF mode, controls the + minimum time between updates to the dataplane for Felix''s embedded + kube-proxy. Lower values give reduced set-up latency. Higher values + reduce Felix CPU usage by batching up more work. [Default: 1s]' + type: string + bpfLogLevel: + description: 'BPFLogLevel controls the log level of the BPF programs + when in BPF dataplane mode. One of "Off", "Info", or "Debug". The + logs are emitted to the BPF trace pipe, accessible with the command + `tc exec bpf debug`. [Default: Off].' + type: string + chainInsertMode: + description: 'ChainInsertMode controls whether Felix hooks the kernel''s + top-level iptables chains by inserting a rule at the top of the + chain or by appending a rule at the bottom. insert is the safe default + since it prevents Calico''s rules from being bypassed. If you switch + to append mode, be sure that the other rules in the chains signal + acceptance by falling through to the Calico rules, otherwise the + Calico policy will be bypassed. [Default: insert]' + type: string + dataplaneDriver: + type: string + debugDisableLogDropping: + type: boolean + debugMemoryProfilePath: + type: string + debugSimulateCalcGraphHangAfter: + type: string + debugSimulateDataplaneHangAfter: + type: string + defaultEndpointToHostAction: + description: 'DefaultEndpointToHostAction controls what happens to + traffic that goes from a workload endpoint to the host itself (after + the traffic hits the endpoint egress policy). By default Calico + blocks traffic from workload endpoints to the host itself with an + iptables "DROP" action. If you want to allow some or all traffic + from endpoint to host, set this parameter to RETURN or ACCEPT. Use + RETURN if you have your own rules in the iptables "INPUT" chain; + Calico will insert its rules at the top of that chain, then "RETURN" + packets to the "INPUT" chain once it has completed processing workload + endpoint egress policy. Use ACCEPT to unconditionally accept packets + from workloads after processing workload endpoint egress policy. + [Default: Drop]' + type: string + deviceRouteProtocol: + description: This defines the route protocol added to programmed device + routes, by default this will be RTPROT_BOOT when left blank. + type: integer + deviceRouteSourceAddress: + description: This is the source address to use on programmed device + routes. By default the source address is left blank, leaving the + kernel to choose the source address used. + type: string + disableConntrackInvalidCheck: + type: boolean + endpointReportingDelay: + type: string + endpointReportingEnabled: + type: boolean + externalNodesList: + description: ExternalNodesCIDRList is a list of CIDR's of external-non-calico-nodes + which may source tunnel traffic and have the tunneled traffic be + accepted at calico nodes. + items: + type: string + type: array + failsafeInboundHostPorts: + description: 'FailsafeInboundHostPorts is a list of UDP/TCP ports + and CIDRs that Felix will allow incoming traffic to host endpoints + on irrespective of the security policy. This is useful to avoid + accidentally cutting off a host with incorrect configuration. For + back-compatibility, if the protocol is not specified, it defaults + to "tcp". If a CIDR is not specified, it will allow traffic from + all addresses. To disable all inbound host ports, use the value + none. The default value allows ssh access and DHCP. [Default: tcp:22, + udp:68, tcp:179, tcp:2379, tcp:2380, tcp:6443, tcp:6666, tcp:6667]' + items: + description: ProtoPort is combination of protocol, port, and CIDR. + Protocol and port must be specified. + properties: + net: + type: string + port: + type: integer + protocol: + type: string + required: + - port + - protocol + type: object + type: array + failsafeOutboundHostPorts: + description: 'FailsafeOutboundHostPorts is a list of UDP/TCP ports + and CIDRs that Felix will allow outgoing traffic from host endpoints + to irrespective of the security policy. This is useful to avoid + accidentally cutting off a host with incorrect configuration. For + back-compatibility, if the protocol is not specified, it defaults + to "tcp". If a CIDR is not specified, it will allow traffic from + all addresses. To disable all outbound host ports, use the value + none. The default value opens etcd''s standard ports to ensure that + Felix does not get cut off from etcd as well as allowing DHCP and + DNS. [Default: tcp:179, tcp:2379, tcp:2380, tcp:6443, tcp:6666, + tcp:6667, udp:53, udp:67]' + items: + description: ProtoPort is combination of protocol, port, and CIDR. + Protocol and port must be specified. + properties: + net: + type: string + port: + type: integer + protocol: + type: string + required: + - port + - protocol + type: object + type: array + featureDetectOverride: + description: FeatureDetectOverride is used to override the feature + detection. Values are specified in a comma separated list with no + spaces, example; "SNATFullyRandom=true,MASQFullyRandom=false,RestoreSupportsLock=". + "true" or "false" will force the feature, empty or omitted values + are auto-detected. + type: string + genericXDPEnabled: + description: 'GenericXDPEnabled enables Generic XDP so network cards + that don''t support XDP offload or driver modes can use XDP. This + is not recommended since it doesn''t provide better performance + than iptables. [Default: false]' + type: boolean + healthEnabled: + type: boolean + healthHost: + type: string + healthPort: + type: integer + interfaceExclude: + description: 'InterfaceExclude is a comma-separated list of interfaces + that Felix should exclude when monitoring for host endpoints. The + default value ensures that Felix ignores Kubernetes'' IPVS dummy + interface, which is used internally by kube-proxy. If you want to + exclude multiple interface names using a single value, the list + supports regular expressions. For regular expressions you must wrap + the value with ''/''. For example having values ''/^kube/,veth1'' + will exclude all interfaces that begin with ''kube'' and also the + interface ''veth1''. [Default: kube-ipvs0]' + type: string + interfacePrefix: + description: 'InterfacePrefix is the interface name prefix that identifies + workload endpoints and so distinguishes them from host endpoint + interfaces. Note: in environments other than bare metal, the orchestrators + configure this appropriately. For example our Kubernetes and Docker + integrations set the ''cali'' value, and our OpenStack integration + sets the ''tap'' value. [Default: cali]' + type: string + interfaceRefreshInterval: + description: InterfaceRefreshInterval is the period at which Felix + rescans local interfaces to verify their state. The rescan can be + disabled by setting the interval to 0. + type: string + ipipEnabled: + type: boolean + ipipMTU: + description: 'IPIPMTU is the MTU to set on the tunnel device. See + Configuring MTU [Default: 1440]' + type: integer + ipsetsRefreshInterval: + description: 'IpsetsRefreshInterval is the period at which Felix re-checks + all iptables state to ensure that no other process has accidentally + broken Calico''s rules. Set to 0 to disable iptables refresh. [Default: + 90s]' + type: string + iptablesBackend: + description: IptablesBackend specifies which backend of iptables will + be used. The default is legacy. + type: string + iptablesFilterAllowAction: + type: string + iptablesLockFilePath: + description: 'IptablesLockFilePath is the location of the iptables + lock file. You may need to change this if the lock file is not in + its standard location (for example if you have mapped it into Felix''s + container at a different path). [Default: /run/xtables.lock]' + type: string + iptablesLockProbeInterval: + description: 'IptablesLockProbeInterval is the time that Felix will + wait between attempts to acquire the iptables lock if it is not + available. Lower values make Felix more responsive when the lock + is contended, but use more CPU. [Default: 50ms]' + type: string + iptablesLockTimeout: + description: 'IptablesLockTimeout is the time that Felix will wait + for the iptables lock, or 0, to disable. To use this feature, Felix + must share the iptables lock file with all other processes that + also take the lock. When running Felix inside a container, this + requires the /run directory of the host to be mounted into the calico/node + or calico/felix container. [Default: 0s disabled]' + type: string + iptablesMangleAllowAction: + type: string + iptablesMarkMask: + description: 'IptablesMarkMask is the mask that Felix selects its + IPTables Mark bits from. Should be a 32 bit hexadecimal number with + at least 8 bits set, none of which clash with any other mark bits + in use on the system. [Default: 0xff000000]' + format: int32 + type: integer + iptablesNATOutgoingInterfaceFilter: + type: string + iptablesPostWriteCheckInterval: + description: 'IptablesPostWriteCheckInterval is the period after Felix + has done a write to the dataplane that it schedules an extra read + back in order to check the write was not clobbered by another process. + This should only occur if another application on the system doesn''t + respect the iptables lock. [Default: 1s]' + type: string + iptablesRefreshInterval: + description: 'IptablesRefreshInterval is the period at which Felix + re-checks the IP sets in the dataplane to ensure that no other process + has accidentally broken Calico''s rules. Set to 0 to disable IP + sets refresh. Note: the default for this value is lower than the + other refresh intervals as a workaround for a Linux kernel bug that + was fixed in kernel version 4.11. If you are using v4.11 or greater + you may want to set this to, a higher value to reduce Felix CPU + usage. [Default: 10s]' + type: string + ipv6Support: + type: boolean + kubeNodePortRanges: + description: 'KubeNodePortRanges holds list of port ranges used for + service node ports. Only used if felix detects kube-proxy running + in ipvs mode. Felix uses these ranges to separate host and workload + traffic. [Default: 30000:32767].' + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + logFilePath: + description: 'LogFilePath is the full path to the Felix log. Set to + none to disable file logging. [Default: /var/log/calico/felix.log]' + type: string + logPrefix: + description: 'LogPrefix is the log prefix that Felix uses when rendering + LOG rules. [Default: calico-packet]' + type: string + logSeverityFile: + description: 'LogSeverityFile is the log severity above which logs + are sent to the log file. [Default: Info]' + type: string + logSeverityScreen: + description: 'LogSeverityScreen is the log severity above which logs + are sent to the stdout. [Default: Info]' + type: string + logSeveritySys: + description: 'LogSeveritySys is the log severity above which logs + are sent to the syslog. Set to None for no logging to syslog. [Default: + Info]' + type: string + maxIpsetSize: + type: integer + metadataAddr: + description: 'MetadataAddr is the IP address or domain name of the + server that can answer VM queries for cloud-init metadata. In OpenStack, + this corresponds to the machine running nova-api (or in Ubuntu, + nova-api-metadata). A value of none (case insensitive) means that + Felix should not set up any NAT rule for the metadata path. [Default: + 127.0.0.1]' + type: string + metadataPort: + description: 'MetadataPort is the port of the metadata server. This, + combined with global.MetadataAddr (if not ''None''), is used to + set up a NAT rule, from 169.254.169.254:80 to MetadataAddr:MetadataPort. + In most cases this should not need to be changed [Default: 8775].' + type: integer + mtuIfacePattern: + description: MTUIfacePattern is a regular expression that controls + which interfaces Felix should scan in order to calculate the host's + MTU. This should not match workload interfaces (usually named cali...). + type: string + natOutgoingAddress: + description: NATOutgoingAddress specifies an address to use when performing + source NAT for traffic in a natOutgoing pool that is leaving the + network. By default the address used is an address on the interface + the traffic is leaving on (ie it uses the iptables MASQUERADE target) + type: string + natPortRange: + anyOf: + - type: integer + - type: string + description: NATPortRange specifies the range of ports that is used + for port mapping when doing outgoing NAT. When unset the default + behavior of the network stack is used. + pattern: ^.* + x-kubernetes-int-or-string: true + netlinkTimeout: + type: string + openstackRegion: + description: 'OpenstackRegion is the name of the region that a particular + Felix belongs to. In a multi-region Calico/OpenStack deployment, + this must be configured somehow for each Felix (here in the datamodel, + or in felix.cfg or the environment on each compute node), and must + match the [calico] openstack_region value configured in neutron.conf + on each node. [Default: Empty]' + type: string + policySyncPathPrefix: + description: 'PolicySyncPathPrefix is used to by Felix to communicate + policy changes to external services, like Application layer policy. + [Default: Empty]' + type: string + prometheusGoMetricsEnabled: + description: 'PrometheusGoMetricsEnabled disables Go runtime metrics + collection, which the Prometheus client does by default, when set + to false. This reduces the number of metrics reported, reducing + Prometheus load. [Default: true]' + type: boolean + prometheusMetricsEnabled: + description: 'PrometheusMetricsEnabled enables the Prometheus metrics + server in Felix if set to true. [Default: false]' + type: boolean + prometheusMetricsHost: + description: 'PrometheusMetricsHost is the host that the Prometheus + metrics server should bind to. [Default: empty]' + type: string + prometheusMetricsPort: + description: 'PrometheusMetricsPort is the TCP port that the Prometheus + metrics server should bind to. [Default: 9091]' + type: integer + prometheusProcessMetricsEnabled: + description: 'PrometheusProcessMetricsEnabled disables process metrics + collection, which the Prometheus client does by default, when set + to false. This reduces the number of metrics reported, reducing + Prometheus load. [Default: true]' + type: boolean + removeExternalRoutes: + description: Whether or not to remove device routes that have not + been programmed by Felix. Disabling this will allow external applications + to also add device routes. This is enabled by default which means + we will remove externally added routes. + type: boolean + reportingInterval: + description: 'ReportingInterval is the interval at which Felix reports + its status into the datastore or 0 to disable. Must be non-zero + in OpenStack deployments. [Default: 30s]' + type: string + reportingTTL: + description: 'ReportingTTL is the time-to-live setting for process-wide + status reports. [Default: 90s]' + type: string + routeRefreshInterval: + description: 'RouteRefreshInterval is the period at which Felix re-checks + the routes in the dataplane to ensure that no other process has + accidentally broken Calico''s rules. Set to 0 to disable route refresh. + [Default: 90s]' + type: string + routeSource: + description: 'RouteSource configures where Felix gets its routing + information. - WorkloadIPs: use workload endpoints to construct + routes. - CalicoIPAM: the default - use IPAM data to construct routes.' + type: string + routeTableRange: + description: Calico programs additional Linux route tables for various + purposes. RouteTableRange specifies the indices of the route tables + that Calico should use. + properties: + max: + type: integer + min: + type: integer + required: + - max + - min + type: object + serviceLoopPrevention: + description: 'When service IP advertisement is enabled, prevent routing + loops to service IPs that are not in use, by dropping or rejecting + packets that do not get DNAT''d by kube-proxy. Unless set to "Disabled", + in which case such routing loops continue to be allowed. [Default: + Drop]' + type: string + sidecarAccelerationEnabled: + description: 'SidecarAccelerationEnabled enables experimental sidecar + acceleration [Default: false]' + type: boolean + usageReportingEnabled: + description: 'UsageReportingEnabled reports anonymous Calico version + number and cluster size to projectcalico.org. Logs warnings returned + by the usage server. For example, if a significant security vulnerability + has been discovered in the version of Calico being used. [Default: + true]' + type: boolean + usageReportingInitialDelay: + description: 'UsageReportingInitialDelay controls the minimum delay + before Felix makes a report. [Default: 300s]' + type: string + usageReportingInterval: + description: 'UsageReportingInterval controls the interval at which + Felix makes reports. [Default: 86400s]' + type: string + useInternalDataplaneDriver: + type: boolean + vxlanEnabled: + type: boolean + vxlanMTU: + description: 'VXLANMTU is the MTU to set on the tunnel device. See + Configuring MTU [Default: 1440]' + type: integer + vxlanPort: + type: integer + vxlanVNI: + type: integer + wireguardEnabled: + description: 'WireguardEnabled controls whether Wireguard is enabled. + [Default: false]' + type: boolean + wireguardInterfaceName: + description: 'WireguardInterfaceName specifies the name to use for + the Wireguard interface. [Default: wg.calico]' + type: string + wireguardListeningPort: + description: 'WireguardListeningPort controls the listening port used + by Wireguard. [Default: 51820]' + type: integer + wireguardMTU: + description: 'WireguardMTU controls the MTU on the Wireguard interface. + See Configuring MTU [Default: 1420]' + type: integer + wireguardRoutingRulePriority: + description: 'WireguardRoutingRulePriority controls the priority value + to use for the Wireguard routing rule. [Default: 99]' + type: integer + xdpEnabled: + description: 'XDPEnabled enables XDP acceleration for suitable untracked + incoming deny rules. [Default: true]' + type: boolean + xdpRefreshInterval: + description: 'XDPRefreshInterval is the period at which Felix re-checks + all XDP state to ensure that no other process has accidentally broken + Calico''s BPF maps or attached programs. Set to 0 to disable XDP + refresh. [Default: 90s]' + type: string + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: globalnetworkpolicies.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: GlobalNetworkPolicy + listKind: GlobalNetworkPolicyList + plural: globalnetworkpolicies + singular: globalnetworkpolicy + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + applyOnForward: + description: ApplyOnForward indicates to apply the rules in this policy + on forward traffic. + type: boolean + doNotTrack: + description: DoNotTrack indicates whether packets matched by the rules + in this policy should go through the data plane's connection tracking, + such as Linux conntrack. If True, the rules in this policy are + applied before any data plane connection tracking, and packets allowed + by this policy are marked as not to be tracked. + type: boolean + egress: + description: The ordered set of egress rules. Each rule contains + a set of packet match criteria and a corresponding action to apply. + items: + description: "A Rule encapsulates a set of match criteria and an + action. Both selector-based security Policy and security Profiles + reference rules - separated out as a list of rules for both ingress + and egress packet matching. \n Each positive match criteria has + a negated version, prefixed with \"Not\". All the match criteria + within a rule must be satisfied for a packet to match. A single + rule can contain the positive and negative version of a match + and both must be satisfied for the rule to match." + properties: + action: + type: string + destination: + description: Destination contains the match criteria that apply + to destination entity. + properties: + namespaceSelector: + description: "NamespaceSelector is an optional field that + contains a selector expression. Only traffic that originates + from (or terminates at) endpoints within the selected + namespaces will be matched. When both NamespaceSelector + and another selector are defined on the same rule, then + only workload endpoints that are matched by both selectors + will be selected by the rule. \n For NetworkPolicy, an + empty NamespaceSelector implies that the Selector is limited + to selecting only workload endpoints in the same namespace + as the NetworkPolicy. \n For NetworkPolicy, `global()` + NamespaceSelector implies that the Selector is limited + to selecting only GlobalNetworkSet or HostEndpoint. \n + For GlobalNetworkPolicy, an empty NamespaceSelector implies + the Selector applies to workload endpoints across all + namespaces." + type: string + nets: + description: Nets is an optional field that restricts the + rule to only apply to traffic that originates from (or + terminates at) IP addresses in any of the given subnets. + items: + type: string + type: array + notNets: + description: NotNets is the negated version of the Nets + field. + items: + type: string + type: array + notPorts: + description: NotPorts is the negated version of the Ports + field. Since only some protocols have ports, if any ports + are specified it requires the Protocol match in the Rule + to be set to "TCP" or "UDP". + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + notSelector: + description: NotSelector is the negated version of the Selector + field. See Selector field for subtleties with negated + selectors. + type: string + ports: + description: "Ports is an optional field that restricts + the rule to only apply to traffic that has a source (destination) + port that matches one of these ranges/values. This value + is a list of integers or strings that represent ranges + of ports. \n Since only some protocols have ports, if + any ports are specified it requires the Protocol match + in the Rule to be set to \"TCP\" or \"UDP\"." + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + selector: + description: "Selector is an optional field that contains + a selector expression (see Policy for sample syntax). + \ Only traffic that originates from (terminates at) endpoints + matching the selector will be matched. \n Note that: in + addition to the negated version of the Selector (see NotSelector + below), the selector expression syntax itself supports + negation. The two types of negation are subtly different. + One negates the set of matched endpoints, the other negates + the whole match: \n \tSelector = \"!has(my_label)\" matches + packets that are from other Calico-controlled \tendpoints + that do not have the label \"my_label\". \n \tNotSelector + = \"has(my_label)\" matches packets that are not from + Calico-controlled \tendpoints that do have the label \"my_label\". + \n The effect is that the latter will accept packets from + non-Calico sources whereas the former is limited to packets + from Calico-controlled endpoints." + type: string + serviceAccounts: + description: ServiceAccounts is an optional field that restricts + the rule to only apply to traffic that originates from + (or terminates at) a pod running as a matching service + account. + properties: + names: + description: Names is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account whose name is in the list. + items: + type: string + type: array + selector: + description: Selector is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account that matches the given label selector. If + both Names and Selector are specified then they are + AND'ed. + type: string + type: object + services: + description: "Services is an optional field that contains + options for matching Kubernetes Services. If specified, + only traffic that originates from or terminates at endpoints + within the selected service(s) will be matched, and only + to/from each endpoint's port. \n Services cannot be specified + on the same rule as Selector, NotSelector, NamespaceSelector, + Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n + Only valid on egress rules." + properties: + name: + description: Name specifies the name of a Kubernetes + Service to match. + type: string + namespace: + description: Namespace specifies the namespace of the + given Service. If left empty, the rule will match + within this policy's namespace. + type: string + type: object + type: object + http: + description: HTTP contains match criteria that apply to HTTP + requests. + properties: + methods: + description: Methods is an optional field that restricts + the rule to apply only to HTTP requests that use one of + the listed HTTP Methods (e.g. GET, PUT, etc.) Multiple + methods are OR'd together. + items: + type: string + type: array + paths: + description: 'Paths is an optional field that restricts + the rule to apply to HTTP requests that use one of the + listed HTTP Paths. Multiple paths are OR''d together. + e.g: - exact: /foo - prefix: /bar NOTE: Each entry may + ONLY specify either a `exact` or a `prefix` match. The + validator will check for it.' + items: + description: 'HTTPPath specifies an HTTP path to match. + It may be either of the form: exact: : which matches + the path exactly or prefix: : which matches + the path prefix' + properties: + exact: + type: string + prefix: + type: string + type: object + type: array + type: object + icmp: + description: ICMP is an optional field that restricts the rule + to apply to a specific type and code of ICMP traffic. This + should only be specified if the Protocol field is set to "ICMP" + or "ICMPv6". + properties: + code: + description: Match on a specific ICMP code. If specified, + the Type value must also be specified. This is a technical + limitation imposed by the kernel's iptables firewall, + which Calico uses to enforce the rule. + type: integer + type: + description: Match on a specific ICMP type. For example + a value of 8 refers to ICMP Echo Request (i.e. pings). + type: integer + type: object + ipVersion: + description: IPVersion is an optional field that restricts the + rule to only match a specific IP version. + type: integer + metadata: + description: Metadata contains additional information for this + rule + properties: + annotations: + additionalProperties: + type: string + description: Annotations is a set of key value pairs that + give extra information about the rule + type: object + type: object + notICMP: + description: NotICMP is the negated version of the ICMP field. + properties: + code: + description: Match on a specific ICMP code. If specified, + the Type value must also be specified. This is a technical + limitation imposed by the kernel's iptables firewall, + which Calico uses to enforce the rule. + type: integer + type: + description: Match on a specific ICMP type. For example + a value of 8 refers to ICMP Echo Request (i.e. pings). + type: integer + type: object + notProtocol: + anyOf: + - type: integer + - type: string + description: NotProtocol is the negated version of the Protocol + field. + pattern: ^.* + x-kubernetes-int-or-string: true + protocol: + anyOf: + - type: integer + - type: string + description: "Protocol is an optional field that restricts the + rule to only apply to traffic of a specific IP protocol. Required + if any of the EntityRules contain Ports (because ports only + apply to certain protocols). \n Must be one of these string + values: \"TCP\", \"UDP\", \"ICMP\", \"ICMPv6\", \"SCTP\", + \"UDPLite\" or an integer in the range 1-255." + pattern: ^.* + x-kubernetes-int-or-string: true + source: + description: Source contains the match criteria that apply to + source entity. + properties: + namespaceSelector: + description: "NamespaceSelector is an optional field that + contains a selector expression. Only traffic that originates + from (or terminates at) endpoints within the selected + namespaces will be matched. When both NamespaceSelector + and another selector are defined on the same rule, then + only workload endpoints that are matched by both selectors + will be selected by the rule. \n For NetworkPolicy, an + empty NamespaceSelector implies that the Selector is limited + to selecting only workload endpoints in the same namespace + as the NetworkPolicy. \n For NetworkPolicy, `global()` + NamespaceSelector implies that the Selector is limited + to selecting only GlobalNetworkSet or HostEndpoint. \n + For GlobalNetworkPolicy, an empty NamespaceSelector implies + the Selector applies to workload endpoints across all + namespaces." + type: string + nets: + description: Nets is an optional field that restricts the + rule to only apply to traffic that originates from (or + terminates at) IP addresses in any of the given subnets. + items: + type: string + type: array + notNets: + description: NotNets is the negated version of the Nets + field. + items: + type: string + type: array + notPorts: + description: NotPorts is the negated version of the Ports + field. Since only some protocols have ports, if any ports + are specified it requires the Protocol match in the Rule + to be set to "TCP" or "UDP". + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + notSelector: + description: NotSelector is the negated version of the Selector + field. See Selector field for subtleties with negated + selectors. + type: string + ports: + description: "Ports is an optional field that restricts + the rule to only apply to traffic that has a source (destination) + port that matches one of these ranges/values. This value + is a list of integers or strings that represent ranges + of ports. \n Since only some protocols have ports, if + any ports are specified it requires the Protocol match + in the Rule to be set to \"TCP\" or \"UDP\"." + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + selector: + description: "Selector is an optional field that contains + a selector expression (see Policy for sample syntax). + \ Only traffic that originates from (terminates at) endpoints + matching the selector will be matched. \n Note that: in + addition to the negated version of the Selector (see NotSelector + below), the selector expression syntax itself supports + negation. The two types of negation are subtly different. + One negates the set of matched endpoints, the other negates + the whole match: \n \tSelector = \"!has(my_label)\" matches + packets that are from other Calico-controlled \tendpoints + that do not have the label \"my_label\". \n \tNotSelector + = \"has(my_label)\" matches packets that are not from + Calico-controlled \tendpoints that do have the label \"my_label\". + \n The effect is that the latter will accept packets from + non-Calico sources whereas the former is limited to packets + from Calico-controlled endpoints." + type: string + serviceAccounts: + description: ServiceAccounts is an optional field that restricts + the rule to only apply to traffic that originates from + (or terminates at) a pod running as a matching service + account. + properties: + names: + description: Names is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account whose name is in the list. + items: + type: string + type: array + selector: + description: Selector is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account that matches the given label selector. If + both Names and Selector are specified then they are + AND'ed. + type: string + type: object + services: + description: "Services is an optional field that contains + options for matching Kubernetes Services. If specified, + only traffic that originates from or terminates at endpoints + within the selected service(s) will be matched, and only + to/from each endpoint's port. \n Services cannot be specified + on the same rule as Selector, NotSelector, NamespaceSelector, + Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n + Only valid on egress rules." + properties: + name: + description: Name specifies the name of a Kubernetes + Service to match. + type: string + namespace: + description: Namespace specifies the namespace of the + given Service. If left empty, the rule will match + within this policy's namespace. + type: string + type: object + type: object + required: + - action + type: object + type: array + ingress: + description: The ordered set of ingress rules. Each rule contains + a set of packet match criteria and a corresponding action to apply. + items: + description: "A Rule encapsulates a set of match criteria and an + action. Both selector-based security Policy and security Profiles + reference rules - separated out as a list of rules for both ingress + and egress packet matching. \n Each positive match criteria has + a negated version, prefixed with \"Not\". All the match criteria + within a rule must be satisfied for a packet to match. A single + rule can contain the positive and negative version of a match + and both must be satisfied for the rule to match." + properties: + action: + type: string + destination: + description: Destination contains the match criteria that apply + to destination entity. + properties: + namespaceSelector: + description: "NamespaceSelector is an optional field that + contains a selector expression. Only traffic that originates + from (or terminates at) endpoints within the selected + namespaces will be matched. When both NamespaceSelector + and another selector are defined on the same rule, then + only workload endpoints that are matched by both selectors + will be selected by the rule. \n For NetworkPolicy, an + empty NamespaceSelector implies that the Selector is limited + to selecting only workload endpoints in the same namespace + as the NetworkPolicy. \n For NetworkPolicy, `global()` + NamespaceSelector implies that the Selector is limited + to selecting only GlobalNetworkSet or HostEndpoint. \n + For GlobalNetworkPolicy, an empty NamespaceSelector implies + the Selector applies to workload endpoints across all + namespaces." + type: string + nets: + description: Nets is an optional field that restricts the + rule to only apply to traffic that originates from (or + terminates at) IP addresses in any of the given subnets. + items: + type: string + type: array + notNets: + description: NotNets is the negated version of the Nets + field. + items: + type: string + type: array + notPorts: + description: NotPorts is the negated version of the Ports + field. Since only some protocols have ports, if any ports + are specified it requires the Protocol match in the Rule + to be set to "TCP" or "UDP". + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + notSelector: + description: NotSelector is the negated version of the Selector + field. See Selector field for subtleties with negated + selectors. + type: string + ports: + description: "Ports is an optional field that restricts + the rule to only apply to traffic that has a source (destination) + port that matches one of these ranges/values. This value + is a list of integers or strings that represent ranges + of ports. \n Since only some protocols have ports, if + any ports are specified it requires the Protocol match + in the Rule to be set to \"TCP\" or \"UDP\"." + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + selector: + description: "Selector is an optional field that contains + a selector expression (see Policy for sample syntax). + \ Only traffic that originates from (terminates at) endpoints + matching the selector will be matched. \n Note that: in + addition to the negated version of the Selector (see NotSelector + below), the selector expression syntax itself supports + negation. The two types of negation are subtly different. + One negates the set of matched endpoints, the other negates + the whole match: \n \tSelector = \"!has(my_label)\" matches + packets that are from other Calico-controlled \tendpoints + that do not have the label \"my_label\". \n \tNotSelector + = \"has(my_label)\" matches packets that are not from + Calico-controlled \tendpoints that do have the label \"my_label\". + \n The effect is that the latter will accept packets from + non-Calico sources whereas the former is limited to packets + from Calico-controlled endpoints." + type: string + serviceAccounts: + description: ServiceAccounts is an optional field that restricts + the rule to only apply to traffic that originates from + (or terminates at) a pod running as a matching service + account. + properties: + names: + description: Names is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account whose name is in the list. + items: + type: string + type: array + selector: + description: Selector is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account that matches the given label selector. If + both Names and Selector are specified then they are + AND'ed. + type: string + type: object + services: + description: "Services is an optional field that contains + options for matching Kubernetes Services. If specified, + only traffic that originates from or terminates at endpoints + within the selected service(s) will be matched, and only + to/from each endpoint's port. \n Services cannot be specified + on the same rule as Selector, NotSelector, NamespaceSelector, + Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n + Only valid on egress rules." + properties: + name: + description: Name specifies the name of a Kubernetes + Service to match. + type: string + namespace: + description: Namespace specifies the namespace of the + given Service. If left empty, the rule will match + within this policy's namespace. + type: string + type: object + type: object + http: + description: HTTP contains match criteria that apply to HTTP + requests. + properties: + methods: + description: Methods is an optional field that restricts + the rule to apply only to HTTP requests that use one of + the listed HTTP Methods (e.g. GET, PUT, etc.) Multiple + methods are OR'd together. + items: + type: string + type: array + paths: + description: 'Paths is an optional field that restricts + the rule to apply to HTTP requests that use one of the + listed HTTP Paths. Multiple paths are OR''d together. + e.g: - exact: /foo - prefix: /bar NOTE: Each entry may + ONLY specify either a `exact` or a `prefix` match. The + validator will check for it.' + items: + description: 'HTTPPath specifies an HTTP path to match. + It may be either of the form: exact: : which matches + the path exactly or prefix: : which matches + the path prefix' + properties: + exact: + type: string + prefix: + type: string + type: object + type: array + type: object + icmp: + description: ICMP is an optional field that restricts the rule + to apply to a specific type and code of ICMP traffic. This + should only be specified if the Protocol field is set to "ICMP" + or "ICMPv6". + properties: + code: + description: Match on a specific ICMP code. If specified, + the Type value must also be specified. This is a technical + limitation imposed by the kernel's iptables firewall, + which Calico uses to enforce the rule. + type: integer + type: + description: Match on a specific ICMP type. For example + a value of 8 refers to ICMP Echo Request (i.e. pings). + type: integer + type: object + ipVersion: + description: IPVersion is an optional field that restricts the + rule to only match a specific IP version. + type: integer + metadata: + description: Metadata contains additional information for this + rule + properties: + annotations: + additionalProperties: + type: string + description: Annotations is a set of key value pairs that + give extra information about the rule + type: object + type: object + notICMP: + description: NotICMP is the negated version of the ICMP field. + properties: + code: + description: Match on a specific ICMP code. If specified, + the Type value must also be specified. This is a technical + limitation imposed by the kernel's iptables firewall, + which Calico uses to enforce the rule. + type: integer + type: + description: Match on a specific ICMP type. For example + a value of 8 refers to ICMP Echo Request (i.e. pings). + type: integer + type: object + notProtocol: + anyOf: + - type: integer + - type: string + description: NotProtocol is the negated version of the Protocol + field. + pattern: ^.* + x-kubernetes-int-or-string: true + protocol: + anyOf: + - type: integer + - type: string + description: "Protocol is an optional field that restricts the + rule to only apply to traffic of a specific IP protocol. Required + if any of the EntityRules contain Ports (because ports only + apply to certain protocols). \n Must be one of these string + values: \"TCP\", \"UDP\", \"ICMP\", \"ICMPv6\", \"SCTP\", + \"UDPLite\" or an integer in the range 1-255." + pattern: ^.* + x-kubernetes-int-or-string: true + source: + description: Source contains the match criteria that apply to + source entity. + properties: + namespaceSelector: + description: "NamespaceSelector is an optional field that + contains a selector expression. Only traffic that originates + from (or terminates at) endpoints within the selected + namespaces will be matched. When both NamespaceSelector + and another selector are defined on the same rule, then + only workload endpoints that are matched by both selectors + will be selected by the rule. \n For NetworkPolicy, an + empty NamespaceSelector implies that the Selector is limited + to selecting only workload endpoints in the same namespace + as the NetworkPolicy. \n For NetworkPolicy, `global()` + NamespaceSelector implies that the Selector is limited + to selecting only GlobalNetworkSet or HostEndpoint. \n + For GlobalNetworkPolicy, an empty NamespaceSelector implies + the Selector applies to workload endpoints across all + namespaces." + type: string + nets: + description: Nets is an optional field that restricts the + rule to only apply to traffic that originates from (or + terminates at) IP addresses in any of the given subnets. + items: + type: string + type: array + notNets: + description: NotNets is the negated version of the Nets + field. + items: + type: string + type: array + notPorts: + description: NotPorts is the negated version of the Ports + field. Since only some protocols have ports, if any ports + are specified it requires the Protocol match in the Rule + to be set to "TCP" or "UDP". + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + notSelector: + description: NotSelector is the negated version of the Selector + field. See Selector field for subtleties with negated + selectors. + type: string + ports: + description: "Ports is an optional field that restricts + the rule to only apply to traffic that has a source (destination) + port that matches one of these ranges/values. This value + is a list of integers or strings that represent ranges + of ports. \n Since only some protocols have ports, if + any ports are specified it requires the Protocol match + in the Rule to be set to \"TCP\" or \"UDP\"." + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + selector: + description: "Selector is an optional field that contains + a selector expression (see Policy for sample syntax). + \ Only traffic that originates from (terminates at) endpoints + matching the selector will be matched. \n Note that: in + addition to the negated version of the Selector (see NotSelector + below), the selector expression syntax itself supports + negation. The two types of negation are subtly different. + One negates the set of matched endpoints, the other negates + the whole match: \n \tSelector = \"!has(my_label)\" matches + packets that are from other Calico-controlled \tendpoints + that do not have the label \"my_label\". \n \tNotSelector + = \"has(my_label)\" matches packets that are not from + Calico-controlled \tendpoints that do have the label \"my_label\". + \n The effect is that the latter will accept packets from + non-Calico sources whereas the former is limited to packets + from Calico-controlled endpoints." + type: string + serviceAccounts: + description: ServiceAccounts is an optional field that restricts + the rule to only apply to traffic that originates from + (or terminates at) a pod running as a matching service + account. + properties: + names: + description: Names is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account whose name is in the list. + items: + type: string + type: array + selector: + description: Selector is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account that matches the given label selector. If + both Names and Selector are specified then they are + AND'ed. + type: string + type: object + services: + description: "Services is an optional field that contains + options for matching Kubernetes Services. If specified, + only traffic that originates from or terminates at endpoints + within the selected service(s) will be matched, and only + to/from each endpoint's port. \n Services cannot be specified + on the same rule as Selector, NotSelector, NamespaceSelector, + Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n + Only valid on egress rules." + properties: + name: + description: Name specifies the name of a Kubernetes + Service to match. + type: string + namespace: + description: Namespace specifies the namespace of the + given Service. If left empty, the rule will match + within this policy's namespace. + type: string + type: object + type: object + required: + - action + type: object + type: array + namespaceSelector: + description: NamespaceSelector is an optional field for an expression + used to select a pod based on namespaces. + type: string + order: + description: Order is an optional field that specifies the order in + which the policy is applied. Policies with higher "order" are applied + after those with lower order. If the order is omitted, it may be + considered to be "infinite" - i.e. the policy will be applied last. Policies + with identical order will be applied in alphanumerical order based + on the Policy "Name". + type: number + preDNAT: + description: PreDNAT indicates to apply the rules in this policy before + any DNAT. + type: boolean + selector: + description: "The selector is an expression used to pick pick out + the endpoints that the policy should be applied to. \n Selector + expressions follow this syntax: \n \tlabel == \"string_literal\" + \ -> comparison, e.g. my_label == \"foo bar\" \tlabel != \"string_literal\" + \ -> not equal; also matches if label is not present \tlabel in + { \"a\", \"b\", \"c\", ... } -> true if the value of label X is + one of \"a\", \"b\", \"c\" \tlabel not in { \"a\", \"b\", \"c\", + ... } -> true if the value of label X is not one of \"a\", \"b\", + \"c\" \thas(label_name) -> True if that label is present \t! expr + -> negation of expr \texpr && expr -> Short-circuit and \texpr + || expr -> Short-circuit or \t( expr ) -> parens for grouping \tall() + or the empty selector -> matches all endpoints. \n Label names are + allowed to contain alphanumerics, -, _ and /. String literals are + more permissive but they do not support escape characters. \n Examples + (with made-up labels): \n \ttype == \"webserver\" && deployment + == \"prod\" \ttype in {\"frontend\", \"backend\"} \tdeployment != + \"dev\" \t! has(label_name)" + type: string + serviceAccountSelector: + description: ServiceAccountSelector is an optional field for an expression + used to select a pod based on service accounts. + type: string + types: + description: "Types indicates whether this policy applies to ingress, + or to egress, or to both. When not explicitly specified (and so + the value on creation is empty or nil), Calico defaults Types according + to what Ingress and Egress rules are present in the policy. The + default is: \n - [ PolicyTypeIngress ], if there are no Egress rules + (including the case where there are also no Ingress rules) \n + - [ PolicyTypeEgress ], if there are Egress rules but no Ingress + rules \n - [ PolicyTypeIngress, PolicyTypeEgress ], if there are + both Ingress and Egress rules. \n When the policy is read back again, + Types will always be one of these values, never empty or nil." + items: + description: PolicyType enumerates the possible values of the PolicySpec + Types field. + type: string + type: array + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: globalnetworksets.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: GlobalNetworkSet + listKind: GlobalNetworkSetList + plural: globalnetworksets + singular: globalnetworkset + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + description: GlobalNetworkSet contains a set of arbitrary IP sub-networks/CIDRs + that share labels to allow rules to refer to them via selectors. The labels + of GlobalNetworkSet are not namespaced. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: GlobalNetworkSetSpec contains the specification for a NetworkSet + resource. + properties: + nets: + description: The list of IP networks that belong to this set. + items: + type: string + type: array + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: hostendpoints.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: HostEndpoint + listKind: HostEndpointList + plural: hostendpoints + singular: hostendpoint + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: HostEndpointSpec contains the specification for a HostEndpoint + resource. + properties: + expectedIPs: + description: "The expected IP addresses (IPv4 and IPv6) of the endpoint. + If \"InterfaceName\" is not present, Calico will look for an interface + matching any of the IPs in the list and apply policy to that. Note: + \tWhen using the selector match criteria in an ingress or egress + security Policy \tor Profile, Calico converts the selector into + a set of IP addresses. For host \tendpoints, the ExpectedIPs field + is used for that purpose. (If only the interface \tname is specified, + Calico does not learn the IPs of the interface for use in match + \tcriteria.)" + items: + type: string + type: array + interfaceName: + description: "Either \"*\", or the name of a specific Linux interface + to apply policy to; or empty. \"*\" indicates that this HostEndpoint + governs all traffic to, from or through the default network namespace + of the host named by the \"Node\" field; entering and leaving that + namespace via any interface, including those from/to non-host-networked + local workloads. \n If InterfaceName is not \"*\", this HostEndpoint + only governs traffic that enters or leaves the host through the + specific interface named by InterfaceName, or - when InterfaceName + is empty - through the specific interface that has one of the IPs + in ExpectedIPs. Therefore, when InterfaceName is empty, at least + one expected IP must be specified. Only external interfaces (such + as \"eth0\") are supported here; it isn't possible for a HostEndpoint + to protect traffic through a specific local workload interface. + \n Note: Only some kinds of policy are implemented for \"*\" HostEndpoints; + initially just pre-DNAT policy. Please check Calico documentation + for the latest position." + type: string + node: + description: The node name identifying the Calico node instance. + type: string + ports: + description: Ports contains the endpoint's named ports, which may + be referenced in security policy rules. + items: + properties: + name: + type: string + port: + type: integer + protocol: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + required: + - name + - port + - protocol + type: object + type: array + profiles: + description: A list of identifiers of security Profile objects that + apply to this endpoint. Each profile is applied in the order that + they appear in this list. Profile rules are applied after the selector-based + security policy. + items: + type: string + type: array + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: ipamblocks.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: IPAMBlock + listKind: IPAMBlockList + plural: ipamblocks + singular: ipamblock + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: IPAMBlockSpec contains the specification for an IPAMBlock + resource. + properties: + affinity: + type: string + allocations: + items: + type: integer + # TODO: This nullable is manually added in. We should update controller-gen + # to handle []*int properly itself. + nullable: true + type: array + attributes: + items: + properties: + handle_id: + type: string + secondary: + additionalProperties: + type: string + type: object + type: object + type: array + cidr: + type: string + deleted: + type: boolean + strictAffinity: + type: boolean + unallocated: + items: + type: integer + type: array + required: + - allocations + - attributes + - cidr + - strictAffinity + - unallocated + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: ipamconfigs.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: IPAMConfig + listKind: IPAMConfigList + plural: ipamconfigs + singular: ipamconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: IPAMConfigSpec contains the specification for an IPAMConfig + resource. + properties: + autoAllocateBlocks: + type: boolean + maxBlocksPerHost: + description: MaxBlocksPerHost, if non-zero, is the max number of blocks + that can be affine to each host. + type: integer + strictAffinity: + type: boolean + required: + - autoAllocateBlocks + - strictAffinity + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: ipamhandles.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: IPAMHandle + listKind: IPAMHandleList + plural: ipamhandles + singular: ipamhandle + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: IPAMHandleSpec contains the specification for an IPAMHandle + resource. + properties: + block: + additionalProperties: + type: integer + type: object + deleted: + type: boolean + handleID: + type: string + required: + - block + - handleID + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: ippools.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: IPPool + listKind: IPPoolList + plural: ippools + singular: ippool + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: IPPoolSpec contains the specification for an IPPool resource. + properties: + blockSize: + description: The block size to use for IP address assignments from + this pool. Defaults to 26 for IPv4 and 112 for IPv6. + type: integer + cidr: + description: The pool CIDR. + type: string + disabled: + description: When disabled is true, Calico IPAM will not assign addresses + from this pool. + type: boolean + ipip: + description: 'Deprecated: this field is only used for APIv1 backwards + compatibility. Setting this field is not allowed, this field is + for internal use only.' + properties: + enabled: + description: When enabled is true, ipip tunneling will be used + to deliver packets to destinations within this pool. + type: boolean + mode: + description: The IPIP mode. This can be one of "always" or "cross-subnet". A + mode of "always" will also use IPIP tunneling for routing to + destination IP addresses within this pool. A mode of "cross-subnet" + will only use IPIP tunneling when the destination node is on + a different subnet to the originating node. The default value + (if not specified) is "always". + type: string + type: object + ipipMode: + description: Contains configuration for IPIP tunneling for this pool. + If not specified, then this is defaulted to "Never" (i.e. IPIP tunneling + is disabled). + type: string + nat-outgoing: + description: 'Deprecated: this field is only used for APIv1 backwards + compatibility. Setting this field is not allowed, this field is + for internal use only.' + type: boolean + natOutgoing: + description: When nat-outgoing is true, packets sent from Calico networked + containers in this pool to destinations outside of this pool will + be masqueraded. + type: boolean + nodeSelector: + description: Allows IPPool to allocate for a specific node by label + selector. + type: string + vxlanMode: + description: Contains configuration for VXLAN tunneling for this pool. + If not specified, then this is defaulted to "Never" (i.e. VXLAN + tunneling is disabled). + type: string + required: + - cidr + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: kubecontrollersconfigurations.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: KubeControllersConfiguration + listKind: KubeControllersConfigurationList + plural: kubecontrollersconfigurations + singular: kubecontrollersconfiguration + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: KubeControllersConfigurationSpec contains the values of the + Kubernetes controllers configuration. + properties: + controllers: + description: Controllers enables and configures individual Kubernetes + controllers + properties: + namespace: + description: Namespace enables and configures the namespace controller. + Enabled by default, set to nil to disable. + properties: + reconcilerPeriod: + description: 'ReconcilerPeriod is the period to perform reconciliation + with the Calico datastore. [Default: 5m]' + type: string + type: object + node: + description: Node enables and configures the node controller. + Enabled by default, set to nil to disable. + properties: + hostEndpoint: + description: HostEndpoint controls syncing nodes to host endpoints. + Disabled by default, set to nil to disable. + properties: + autoCreate: + description: 'AutoCreate enables automatic creation of + host endpoints for every node. [Default: Disabled]' + type: string + type: object + leakGracePeriod: + description: 'LeakGracePeriod is the period used by the controller + to determine if an IP address has been leaked. Set to 0 + to disable IP garbage collection. [Default: 15m]' + type: string + reconcilerPeriod: + description: 'ReconcilerPeriod is the period to perform reconciliation + with the Calico datastore. [Default: 5m]' + type: string + syncLabels: + description: 'SyncLabels controls whether to copy Kubernetes + node labels to Calico nodes. [Default: Enabled]' + type: string + type: object + policy: + description: Policy enables and configures the policy controller. + Enabled by default, set to nil to disable. + properties: + reconcilerPeriod: + description: 'ReconcilerPeriod is the period to perform reconciliation + with the Calico datastore. [Default: 5m]' + type: string + type: object + serviceAccount: + description: ServiceAccount enables and configures the service + account controller. Enabled by default, set to nil to disable. + properties: + reconcilerPeriod: + description: 'ReconcilerPeriod is the period to perform reconciliation + with the Calico datastore. [Default: 5m]' + type: string + type: object + workloadEndpoint: + description: WorkloadEndpoint enables and configures the workload + endpoint controller. Enabled by default, set to nil to disable. + properties: + reconcilerPeriod: + description: 'ReconcilerPeriod is the period to perform reconciliation + with the Calico datastore. [Default: 5m]' + type: string + type: object + type: object + etcdV3CompactionPeriod: + description: 'EtcdV3CompactionPeriod is the period between etcdv3 + compaction requests. Set to 0 to disable. [Default: 10m]' + type: string + healthChecks: + description: 'HealthChecks enables or disables support for health + checks [Default: Enabled]' + type: string + logSeverityScreen: + description: 'LogSeverityScreen is the log severity above which logs + are sent to the stdout. [Default: Info]' + type: string + prometheusMetricsPort: + description: 'PrometheusMetricsPort is the TCP port that the Prometheus + metrics server should bind to. Set to 0 to disable. [Default: 9094]' + type: integer + required: + - controllers + type: object + status: + description: KubeControllersConfigurationStatus represents the status + of the configuration. It's useful for admins to be able to see the actual + config that was applied, which can be modified by environment variables + on the kube-controllers process. + properties: + environmentVars: + additionalProperties: + type: string + description: EnvironmentVars contains the environment variables on + the kube-controllers that influenced the RunningConfig. + type: object + runningConfig: + description: RunningConfig contains the effective config that is running + in the kube-controllers pod, after merging the API resource with + any environment variables. + properties: + controllers: + description: Controllers enables and configures individual Kubernetes + controllers + properties: + namespace: + description: Namespace enables and configures the namespace + controller. Enabled by default, set to nil to disable. + properties: + reconcilerPeriod: + description: 'ReconcilerPeriod is the period to perform + reconciliation with the Calico datastore. [Default: + 5m]' + type: string + type: object + node: + description: Node enables and configures the node controller. + Enabled by default, set to nil to disable. + properties: + hostEndpoint: + description: HostEndpoint controls syncing nodes to host + endpoints. Disabled by default, set to nil to disable. + properties: + autoCreate: + description: 'AutoCreate enables automatic creation + of host endpoints for every node. [Default: Disabled]' + type: string + type: object + leakGracePeriod: + description: 'LeakGracePeriod is the period used by the + controller to determine if an IP address has been leaked. + Set to 0 to disable IP garbage collection. [Default: + 15m]' + type: string + reconcilerPeriod: + description: 'ReconcilerPeriod is the period to perform + reconciliation with the Calico datastore. [Default: + 5m]' + type: string + syncLabels: + description: 'SyncLabels controls whether to copy Kubernetes + node labels to Calico nodes. [Default: Enabled]' + type: string + type: object + policy: + description: Policy enables and configures the policy controller. + Enabled by default, set to nil to disable. + properties: + reconcilerPeriod: + description: 'ReconcilerPeriod is the period to perform + reconciliation with the Calico datastore. [Default: + 5m]' + type: string + type: object + serviceAccount: + description: ServiceAccount enables and configures the service + account controller. Enabled by default, set to nil to disable. + properties: + reconcilerPeriod: + description: 'ReconcilerPeriod is the period to perform + reconciliation with the Calico datastore. [Default: + 5m]' + type: string + type: object + workloadEndpoint: + description: WorkloadEndpoint enables and configures the workload + endpoint controller. Enabled by default, set to nil to disable. + properties: + reconcilerPeriod: + description: 'ReconcilerPeriod is the period to perform + reconciliation with the Calico datastore. [Default: + 5m]' + type: string + type: object + type: object + etcdV3CompactionPeriod: + description: 'EtcdV3CompactionPeriod is the period between etcdv3 + compaction requests. Set to 0 to disable. [Default: 10m]' + type: string + healthChecks: + description: 'HealthChecks enables or disables support for health + checks [Default: Enabled]' + type: string + logSeverityScreen: + description: 'LogSeverityScreen is the log severity above which + logs are sent to the stdout. [Default: Info]' + type: string + prometheusMetricsPort: + description: 'PrometheusMetricsPort is the TCP port that the Prometheus + metrics server should bind to. Set to 0 to disable. [Default: + 9094]' + type: integer + required: + - controllers + type: object + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: networkpolicies.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: NetworkPolicy + listKind: NetworkPolicyList + plural: networkpolicies + singular: networkpolicy + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + egress: + description: The ordered set of egress rules. Each rule contains + a set of packet match criteria and a corresponding action to apply. + items: + description: "A Rule encapsulates a set of match criteria and an + action. Both selector-based security Policy and security Profiles + reference rules - separated out as a list of rules for both ingress + and egress packet matching. \n Each positive match criteria has + a negated version, prefixed with \"Not\". All the match criteria + within a rule must be satisfied for a packet to match. A single + rule can contain the positive and negative version of a match + and both must be satisfied for the rule to match." + properties: + action: + type: string + destination: + description: Destination contains the match criteria that apply + to destination entity. + properties: + namespaceSelector: + description: "NamespaceSelector is an optional field that + contains a selector expression. Only traffic that originates + from (or terminates at) endpoints within the selected + namespaces will be matched. When both NamespaceSelector + and another selector are defined on the same rule, then + only workload endpoints that are matched by both selectors + will be selected by the rule. \n For NetworkPolicy, an + empty NamespaceSelector implies that the Selector is limited + to selecting only workload endpoints in the same namespace + as the NetworkPolicy. \n For NetworkPolicy, `global()` + NamespaceSelector implies that the Selector is limited + to selecting only GlobalNetworkSet or HostEndpoint. \n + For GlobalNetworkPolicy, an empty NamespaceSelector implies + the Selector applies to workload endpoints across all + namespaces." + type: string + nets: + description: Nets is an optional field that restricts the + rule to only apply to traffic that originates from (or + terminates at) IP addresses in any of the given subnets. + items: + type: string + type: array + notNets: + description: NotNets is the negated version of the Nets + field. + items: + type: string + type: array + notPorts: + description: NotPorts is the negated version of the Ports + field. Since only some protocols have ports, if any ports + are specified it requires the Protocol match in the Rule + to be set to "TCP" or "UDP". + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + notSelector: + description: NotSelector is the negated version of the Selector + field. See Selector field for subtleties with negated + selectors. + type: string + ports: + description: "Ports is an optional field that restricts + the rule to only apply to traffic that has a source (destination) + port that matches one of these ranges/values. This value + is a list of integers or strings that represent ranges + of ports. \n Since only some protocols have ports, if + any ports are specified it requires the Protocol match + in the Rule to be set to \"TCP\" or \"UDP\"." + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + selector: + description: "Selector is an optional field that contains + a selector expression (see Policy for sample syntax). + \ Only traffic that originates from (terminates at) endpoints + matching the selector will be matched. \n Note that: in + addition to the negated version of the Selector (see NotSelector + below), the selector expression syntax itself supports + negation. The two types of negation are subtly different. + One negates the set of matched endpoints, the other negates + the whole match: \n \tSelector = \"!has(my_label)\" matches + packets that are from other Calico-controlled \tendpoints + that do not have the label \"my_label\". \n \tNotSelector + = \"has(my_label)\" matches packets that are not from + Calico-controlled \tendpoints that do have the label \"my_label\". + \n The effect is that the latter will accept packets from + non-Calico sources whereas the former is limited to packets + from Calico-controlled endpoints." + type: string + serviceAccounts: + description: ServiceAccounts is an optional field that restricts + the rule to only apply to traffic that originates from + (or terminates at) a pod running as a matching service + account. + properties: + names: + description: Names is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account whose name is in the list. + items: + type: string + type: array + selector: + description: Selector is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account that matches the given label selector. If + both Names and Selector are specified then they are + AND'ed. + type: string + type: object + services: + description: "Services is an optional field that contains + options for matching Kubernetes Services. If specified, + only traffic that originates from or terminates at endpoints + within the selected service(s) will be matched, and only + to/from each endpoint's port. \n Services cannot be specified + on the same rule as Selector, NotSelector, NamespaceSelector, + Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n + Only valid on egress rules." + properties: + name: + description: Name specifies the name of a Kubernetes + Service to match. + type: string + namespace: + description: Namespace specifies the namespace of the + given Service. If left empty, the rule will match + within this policy's namespace. + type: string + type: object + type: object + http: + description: HTTP contains match criteria that apply to HTTP + requests. + properties: + methods: + description: Methods is an optional field that restricts + the rule to apply only to HTTP requests that use one of + the listed HTTP Methods (e.g. GET, PUT, etc.) Multiple + methods are OR'd together. + items: + type: string + type: array + paths: + description: 'Paths is an optional field that restricts + the rule to apply to HTTP requests that use one of the + listed HTTP Paths. Multiple paths are OR''d together. + e.g: - exact: /foo - prefix: /bar NOTE: Each entry may + ONLY specify either a `exact` or a `prefix` match. The + validator will check for it.' + items: + description: 'HTTPPath specifies an HTTP path to match. + It may be either of the form: exact: : which matches + the path exactly or prefix: : which matches + the path prefix' + properties: + exact: + type: string + prefix: + type: string + type: object + type: array + type: object + icmp: + description: ICMP is an optional field that restricts the rule + to apply to a specific type and code of ICMP traffic. This + should only be specified if the Protocol field is set to "ICMP" + or "ICMPv6". + properties: + code: + description: Match on a specific ICMP code. If specified, + the Type value must also be specified. This is a technical + limitation imposed by the kernel's iptables firewall, + which Calico uses to enforce the rule. + type: integer + type: + description: Match on a specific ICMP type. For example + a value of 8 refers to ICMP Echo Request (i.e. pings). + type: integer + type: object + ipVersion: + description: IPVersion is an optional field that restricts the + rule to only match a specific IP version. + type: integer + metadata: + description: Metadata contains additional information for this + rule + properties: + annotations: + additionalProperties: + type: string + description: Annotations is a set of key value pairs that + give extra information about the rule + type: object + type: object + notICMP: + description: NotICMP is the negated version of the ICMP field. + properties: + code: + description: Match on a specific ICMP code. If specified, + the Type value must also be specified. This is a technical + limitation imposed by the kernel's iptables firewall, + which Calico uses to enforce the rule. + type: integer + type: + description: Match on a specific ICMP type. For example + a value of 8 refers to ICMP Echo Request (i.e. pings). + type: integer + type: object + notProtocol: + anyOf: + - type: integer + - type: string + description: NotProtocol is the negated version of the Protocol + field. + pattern: ^.* + x-kubernetes-int-or-string: true + protocol: + anyOf: + - type: integer + - type: string + description: "Protocol is an optional field that restricts the + rule to only apply to traffic of a specific IP protocol. Required + if any of the EntityRules contain Ports (because ports only + apply to certain protocols). \n Must be one of these string + values: \"TCP\", \"UDP\", \"ICMP\", \"ICMPv6\", \"SCTP\", + \"UDPLite\" or an integer in the range 1-255." + pattern: ^.* + x-kubernetes-int-or-string: true + source: + description: Source contains the match criteria that apply to + source entity. + properties: + namespaceSelector: + description: "NamespaceSelector is an optional field that + contains a selector expression. Only traffic that originates + from (or terminates at) endpoints within the selected + namespaces will be matched. When both NamespaceSelector + and another selector are defined on the same rule, then + only workload endpoints that are matched by both selectors + will be selected by the rule. \n For NetworkPolicy, an + empty NamespaceSelector implies that the Selector is limited + to selecting only workload endpoints in the same namespace + as the NetworkPolicy. \n For NetworkPolicy, `global()` + NamespaceSelector implies that the Selector is limited + to selecting only GlobalNetworkSet or HostEndpoint. \n + For GlobalNetworkPolicy, an empty NamespaceSelector implies + the Selector applies to workload endpoints across all + namespaces." + type: string + nets: + description: Nets is an optional field that restricts the + rule to only apply to traffic that originates from (or + terminates at) IP addresses in any of the given subnets. + items: + type: string + type: array + notNets: + description: NotNets is the negated version of the Nets + field. + items: + type: string + type: array + notPorts: + description: NotPorts is the negated version of the Ports + field. Since only some protocols have ports, if any ports + are specified it requires the Protocol match in the Rule + to be set to "TCP" or "UDP". + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + notSelector: + description: NotSelector is the negated version of the Selector + field. See Selector field for subtleties with negated + selectors. + type: string + ports: + description: "Ports is an optional field that restricts + the rule to only apply to traffic that has a source (destination) + port that matches one of these ranges/values. This value + is a list of integers or strings that represent ranges + of ports. \n Since only some protocols have ports, if + any ports are specified it requires the Protocol match + in the Rule to be set to \"TCP\" or \"UDP\"." + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + selector: + description: "Selector is an optional field that contains + a selector expression (see Policy for sample syntax). + \ Only traffic that originates from (terminates at) endpoints + matching the selector will be matched. \n Note that: in + addition to the negated version of the Selector (see NotSelector + below), the selector expression syntax itself supports + negation. The two types of negation are subtly different. + One negates the set of matched endpoints, the other negates + the whole match: \n \tSelector = \"!has(my_label)\" matches + packets that are from other Calico-controlled \tendpoints + that do not have the label \"my_label\". \n \tNotSelector + = \"has(my_label)\" matches packets that are not from + Calico-controlled \tendpoints that do have the label \"my_label\". + \n The effect is that the latter will accept packets from + non-Calico sources whereas the former is limited to packets + from Calico-controlled endpoints." + type: string + serviceAccounts: + description: ServiceAccounts is an optional field that restricts + the rule to only apply to traffic that originates from + (or terminates at) a pod running as a matching service + account. + properties: + names: + description: Names is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account whose name is in the list. + items: + type: string + type: array + selector: + description: Selector is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account that matches the given label selector. If + both Names and Selector are specified then they are + AND'ed. + type: string + type: object + services: + description: "Services is an optional field that contains + options for matching Kubernetes Services. If specified, + only traffic that originates from or terminates at endpoints + within the selected service(s) will be matched, and only + to/from each endpoint's port. \n Services cannot be specified + on the same rule as Selector, NotSelector, NamespaceSelector, + Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n + Only valid on egress rules." + properties: + name: + description: Name specifies the name of a Kubernetes + Service to match. + type: string + namespace: + description: Namespace specifies the namespace of the + given Service. If left empty, the rule will match + within this policy's namespace. + type: string + type: object + type: object + required: + - action + type: object + type: array + ingress: + description: The ordered set of ingress rules. Each rule contains + a set of packet match criteria and a corresponding action to apply. + items: + description: "A Rule encapsulates a set of match criteria and an + action. Both selector-based security Policy and security Profiles + reference rules - separated out as a list of rules for both ingress + and egress packet matching. \n Each positive match criteria has + a negated version, prefixed with \"Not\". All the match criteria + within a rule must be satisfied for a packet to match. A single + rule can contain the positive and negative version of a match + and both must be satisfied for the rule to match." + properties: + action: + type: string + destination: + description: Destination contains the match criteria that apply + to destination entity. + properties: + namespaceSelector: + description: "NamespaceSelector is an optional field that + contains a selector expression. Only traffic that originates + from (or terminates at) endpoints within the selected + namespaces will be matched. When both NamespaceSelector + and another selector are defined on the same rule, then + only workload endpoints that are matched by both selectors + will be selected by the rule. \n For NetworkPolicy, an + empty NamespaceSelector implies that the Selector is limited + to selecting only workload endpoints in the same namespace + as the NetworkPolicy. \n For NetworkPolicy, `global()` + NamespaceSelector implies that the Selector is limited + to selecting only GlobalNetworkSet or HostEndpoint. \n + For GlobalNetworkPolicy, an empty NamespaceSelector implies + the Selector applies to workload endpoints across all + namespaces." + type: string + nets: + description: Nets is an optional field that restricts the + rule to only apply to traffic that originates from (or + terminates at) IP addresses in any of the given subnets. + items: + type: string + type: array + notNets: + description: NotNets is the negated version of the Nets + field. + items: + type: string + type: array + notPorts: + description: NotPorts is the negated version of the Ports + field. Since only some protocols have ports, if any ports + are specified it requires the Protocol match in the Rule + to be set to "TCP" or "UDP". + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + notSelector: + description: NotSelector is the negated version of the Selector + field. See Selector field for subtleties with negated + selectors. + type: string + ports: + description: "Ports is an optional field that restricts + the rule to only apply to traffic that has a source (destination) + port that matches one of these ranges/values. This value + is a list of integers or strings that represent ranges + of ports. \n Since only some protocols have ports, if + any ports are specified it requires the Protocol match + in the Rule to be set to \"TCP\" or \"UDP\"." + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + selector: + description: "Selector is an optional field that contains + a selector expression (see Policy for sample syntax). + \ Only traffic that originates from (terminates at) endpoints + matching the selector will be matched. \n Note that: in + addition to the negated version of the Selector (see NotSelector + below), the selector expression syntax itself supports + negation. The two types of negation are subtly different. + One negates the set of matched endpoints, the other negates + the whole match: \n \tSelector = \"!has(my_label)\" matches + packets that are from other Calico-controlled \tendpoints + that do not have the label \"my_label\". \n \tNotSelector + = \"has(my_label)\" matches packets that are not from + Calico-controlled \tendpoints that do have the label \"my_label\". + \n The effect is that the latter will accept packets from + non-Calico sources whereas the former is limited to packets + from Calico-controlled endpoints." + type: string + serviceAccounts: + description: ServiceAccounts is an optional field that restricts + the rule to only apply to traffic that originates from + (or terminates at) a pod running as a matching service + account. + properties: + names: + description: Names is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account whose name is in the list. + items: + type: string + type: array + selector: + description: Selector is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account that matches the given label selector. If + both Names and Selector are specified then they are + AND'ed. + type: string + type: object + services: + description: "Services is an optional field that contains + options for matching Kubernetes Services. If specified, + only traffic that originates from or terminates at endpoints + within the selected service(s) will be matched, and only + to/from each endpoint's port. \n Services cannot be specified + on the same rule as Selector, NotSelector, NamespaceSelector, + Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n + Only valid on egress rules." + properties: + name: + description: Name specifies the name of a Kubernetes + Service to match. + type: string + namespace: + description: Namespace specifies the namespace of the + given Service. If left empty, the rule will match + within this policy's namespace. + type: string + type: object + type: object + http: + description: HTTP contains match criteria that apply to HTTP + requests. + properties: + methods: + description: Methods is an optional field that restricts + the rule to apply only to HTTP requests that use one of + the listed HTTP Methods (e.g. GET, PUT, etc.) Multiple + methods are OR'd together. + items: + type: string + type: array + paths: + description: 'Paths is an optional field that restricts + the rule to apply to HTTP requests that use one of the + listed HTTP Paths. Multiple paths are OR''d together. + e.g: - exact: /foo - prefix: /bar NOTE: Each entry may + ONLY specify either a `exact` or a `prefix` match. The + validator will check for it.' + items: + description: 'HTTPPath specifies an HTTP path to match. + It may be either of the form: exact: : which matches + the path exactly or prefix: : which matches + the path prefix' + properties: + exact: + type: string + prefix: + type: string + type: object + type: array + type: object + icmp: + description: ICMP is an optional field that restricts the rule + to apply to a specific type and code of ICMP traffic. This + should only be specified if the Protocol field is set to "ICMP" + or "ICMPv6". + properties: + code: + description: Match on a specific ICMP code. If specified, + the Type value must also be specified. This is a technical + limitation imposed by the kernel's iptables firewall, + which Calico uses to enforce the rule. + type: integer + type: + description: Match on a specific ICMP type. For example + a value of 8 refers to ICMP Echo Request (i.e. pings). + type: integer + type: object + ipVersion: + description: IPVersion is an optional field that restricts the + rule to only match a specific IP version. + type: integer + metadata: + description: Metadata contains additional information for this + rule + properties: + annotations: + additionalProperties: + type: string + description: Annotations is a set of key value pairs that + give extra information about the rule + type: object + type: object + notICMP: + description: NotICMP is the negated version of the ICMP field. + properties: + code: + description: Match on a specific ICMP code. If specified, + the Type value must also be specified. This is a technical + limitation imposed by the kernel's iptables firewall, + which Calico uses to enforce the rule. + type: integer + type: + description: Match on a specific ICMP type. For example + a value of 8 refers to ICMP Echo Request (i.e. pings). + type: integer + type: object + notProtocol: + anyOf: + - type: integer + - type: string + description: NotProtocol is the negated version of the Protocol + field. + pattern: ^.* + x-kubernetes-int-or-string: true + protocol: + anyOf: + - type: integer + - type: string + description: "Protocol is an optional field that restricts the + rule to only apply to traffic of a specific IP protocol. Required + if any of the EntityRules contain Ports (because ports only + apply to certain protocols). \n Must be one of these string + values: \"TCP\", \"UDP\", \"ICMP\", \"ICMPv6\", \"SCTP\", + \"UDPLite\" or an integer in the range 1-255." + pattern: ^.* + x-kubernetes-int-or-string: true + source: + description: Source contains the match criteria that apply to + source entity. + properties: + namespaceSelector: + description: "NamespaceSelector is an optional field that + contains a selector expression. Only traffic that originates + from (or terminates at) endpoints within the selected + namespaces will be matched. When both NamespaceSelector + and another selector are defined on the same rule, then + only workload endpoints that are matched by both selectors + will be selected by the rule. \n For NetworkPolicy, an + empty NamespaceSelector implies that the Selector is limited + to selecting only workload endpoints in the same namespace + as the NetworkPolicy. \n For NetworkPolicy, `global()` + NamespaceSelector implies that the Selector is limited + to selecting only GlobalNetworkSet or HostEndpoint. \n + For GlobalNetworkPolicy, an empty NamespaceSelector implies + the Selector applies to workload endpoints across all + namespaces." + type: string + nets: + description: Nets is an optional field that restricts the + rule to only apply to traffic that originates from (or + terminates at) IP addresses in any of the given subnets. + items: + type: string + type: array + notNets: + description: NotNets is the negated version of the Nets + field. + items: + type: string + type: array + notPorts: + description: NotPorts is the negated version of the Ports + field. Since only some protocols have ports, if any ports + are specified it requires the Protocol match in the Rule + to be set to "TCP" or "UDP". + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + notSelector: + description: NotSelector is the negated version of the Selector + field. See Selector field for subtleties with negated + selectors. + type: string + ports: + description: "Ports is an optional field that restricts + the rule to only apply to traffic that has a source (destination) + port that matches one of these ranges/values. This value + is a list of integers or strings that represent ranges + of ports. \n Since only some protocols have ports, if + any ports are specified it requires the Protocol match + in the Rule to be set to \"TCP\" or \"UDP\"." + items: + anyOf: + - type: integer + - type: string + pattern: ^.* + x-kubernetes-int-or-string: true + type: array + selector: + description: "Selector is an optional field that contains + a selector expression (see Policy for sample syntax). + \ Only traffic that originates from (terminates at) endpoints + matching the selector will be matched. \n Note that: in + addition to the negated version of the Selector (see NotSelector + below), the selector expression syntax itself supports + negation. The two types of negation are subtly different. + One negates the set of matched endpoints, the other negates + the whole match: \n \tSelector = \"!has(my_label)\" matches + packets that are from other Calico-controlled \tendpoints + that do not have the label \"my_label\". \n \tNotSelector + = \"has(my_label)\" matches packets that are not from + Calico-controlled \tendpoints that do have the label \"my_label\". + \n The effect is that the latter will accept packets from + non-Calico sources whereas the former is limited to packets + from Calico-controlled endpoints." + type: string + serviceAccounts: + description: ServiceAccounts is an optional field that restricts + the rule to only apply to traffic that originates from + (or terminates at) a pod running as a matching service + account. + properties: + names: + description: Names is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account whose name is in the list. + items: + type: string + type: array + selector: + description: Selector is an optional field that restricts + the rule to only apply to traffic that originates + from (or terminates at) a pod running as a service + account that matches the given label selector. If + both Names and Selector are specified then they are + AND'ed. + type: string + type: object + services: + description: "Services is an optional field that contains + options for matching Kubernetes Services. If specified, + only traffic that originates from or terminates at endpoints + within the selected service(s) will be matched, and only + to/from each endpoint's port. \n Services cannot be specified + on the same rule as Selector, NotSelector, NamespaceSelector, + Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n + Only valid on egress rules." + properties: + name: + description: Name specifies the name of a Kubernetes + Service to match. + type: string + namespace: + description: Namespace specifies the namespace of the + given Service. If left empty, the rule will match + within this policy's namespace. + type: string + type: object + type: object + required: + - action + type: object + type: array + order: + description: Order is an optional field that specifies the order in + which the policy is applied. Policies with higher "order" are applied + after those with lower order. If the order is omitted, it may be + considered to be "infinite" - i.e. the policy will be applied last. Policies + with identical order will be applied in alphanumerical order based + on the Policy "Name". + type: number + selector: + description: "The selector is an expression used to pick pick out + the endpoints that the policy should be applied to. \n Selector + expressions follow this syntax: \n \tlabel == \"string_literal\" + \ -> comparison, e.g. my_label == \"foo bar\" \tlabel != \"string_literal\" + \ -> not equal; also matches if label is not present \tlabel in + { \"a\", \"b\", \"c\", ... } -> true if the value of label X is + one of \"a\", \"b\", \"c\" \tlabel not in { \"a\", \"b\", \"c\", + ... } -> true if the value of label X is not one of \"a\", \"b\", + \"c\" \thas(label_name) -> True if that label is present \t! expr + -> negation of expr \texpr && expr -> Short-circuit and \texpr + || expr -> Short-circuit or \t( expr ) -> parens for grouping \tall() + or the empty selector -> matches all endpoints. \n Label names are + allowed to contain alphanumerics, -, _ and /. String literals are + more permissive but they do not support escape characters. \n Examples + (with made-up labels): \n \ttype == \"webserver\" && deployment + == \"prod\" \ttype in {\"frontend\", \"backend\"} \tdeployment != + \"dev\" \t! has(label_name)" + type: string + serviceAccountSelector: + description: ServiceAccountSelector is an optional field for an expression + used to select a pod based on service accounts. + type: string + types: + description: "Types indicates whether this policy applies to ingress, + or to egress, or to both. When not explicitly specified (and so + the value on creation is empty or nil), Calico defaults Types according + to what Ingress and Egress are present in the policy. The default + is: \n - [ PolicyTypeIngress ], if there are no Egress rules (including + the case where there are also no Ingress rules) \n - [ PolicyTypeEgress + ], if there are Egress rules but no Ingress rules \n - [ PolicyTypeIngress, + PolicyTypeEgress ], if there are both Ingress and Egress rules. + \n When the policy is read back again, Types will always be one + of these values, never empty or nil." + items: + description: PolicyType enumerates the possible values of the PolicySpec + Types field. + type: string + type: array + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: networksets.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: NetworkSet + listKind: NetworkSetList + plural: networksets + singular: networkset + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: NetworkSet is the Namespaced-equivalent of the GlobalNetworkSet. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: NetworkSetSpec contains the specification for a NetworkSet + resource. + properties: + nets: + description: The list of IP networks that belong to this set. + items: + type: string + type: array + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +--- +# Source: calico/templates/calico-kube-controllers-rbac.yaml + +# Include a clusterrole for the kube-controllers component, +# and bind it to the calico-kube-controllers serviceaccount. +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: calico-kube-controllers +rules: + # Nodes are watched to monitor for deletions. + - apiGroups: [""] + resources: + - nodes + verbs: + - watch + - list + - get + # Pods are watched to check for existence as part of IPAM controller. + - apiGroups: [""] + resources: + - pods + verbs: + - get + - list + - watch + # IPAM resources are manipulated when nodes are deleted. + - apiGroups: ["crd.projectcalico.org"] + resources: + - ippools + verbs: + - list + - apiGroups: ["crd.projectcalico.org"] + resources: + - blockaffinities + - ipamblocks + - ipamhandles + verbs: + - get + - list + - create + - update + - delete + - watch + # kube-controllers manages hostendpoints. + - apiGroups: ["crd.projectcalico.org"] + resources: + - hostendpoints + verbs: + - get + - list + - create + - update + - delete + # Needs access to update clusterinformations. + - apiGroups: ["crd.projectcalico.org"] + resources: + - clusterinformations + verbs: + - get + - create + - update + # KubeControllersConfiguration is where it gets its config + - apiGroups: ["crd.projectcalico.org"] + resources: + - kubecontrollersconfigurations + verbs: + # read its own config + - get + # create a default if none exists + - create + # update status + - update + # watch for changes + - watch +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: calico-kube-controllers +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: calico-kube-controllers +subjects: +- kind: ServiceAccount + name: calico-kube-controllers + namespace: kube-system +--- + +--- +# Source: calico/templates/calico-node-rbac.yaml +# Include a clusterrole for the calico-node DaemonSet, +# and bind it to the calico-node serviceaccount. +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: calico-node +rules: + # The CNI plugin needs to get pods, nodes, and namespaces. + - apiGroups: [""] + resources: + - pods + - nodes + - namespaces + verbs: + - get + # EndpointSlices are used for Service-based network policy rule + # enforcement. + - apiGroups: ["discovery.k8s.io"] + resources: + - endpointslices + verbs: + - watch + - list + - apiGroups: [""] + resources: + - endpoints + - services + verbs: + # Used to discover service IPs for advertisement. + - watch + - list + # Used to discover Typhas. + - get + # Pod CIDR auto-detection on kubeadm needs access to config maps. + - apiGroups: [""] + resources: + - configmaps + verbs: + - get + - apiGroups: [""] + resources: + - nodes/status + verbs: + # Needed for clearing NodeNetworkUnavailable flag. + - patch + # Calico stores some configuration information in node annotations. + - update + # Watch for changes to Kubernetes NetworkPolicies. + - apiGroups: ["networking.k8s.io"] + resources: + - networkpolicies + verbs: + - watch + - list + # Used by Calico for policy information. + - apiGroups: [""] + resources: + - pods + - namespaces + - serviceaccounts + verbs: + - list + - watch + # The CNI plugin patches pods/status. + - apiGroups: [""] + resources: + - pods/status + verbs: + - patch + # Calico monitors various CRDs for config. + - apiGroups: ["crd.projectcalico.org"] + resources: + - globalfelixconfigs + - felixconfigurations + - bgppeers + - globalbgpconfigs + - bgpconfigurations + - ippools + - ipamblocks + - globalnetworkpolicies + - globalnetworksets + - networkpolicies + - networksets + - clusterinformations + - hostendpoints + - blockaffinities + verbs: + - get + - list + - watch + # Calico must create and update some CRDs on startup. + - apiGroups: ["crd.projectcalico.org"] + resources: + - ippools + - felixconfigurations + - clusterinformations + verbs: + - create + - update + # Calico stores some configuration information on the node. + - apiGroups: [""] + resources: + - nodes + verbs: + - get + - list + - watch + # These permissions are only required for upgrade from v2.6, and can + # be removed after upgrade or on fresh installations. + - apiGroups: ["crd.projectcalico.org"] + resources: + - bgpconfigurations + - bgppeers + verbs: + - create + - update + # These permissions are required for Calico CNI to perform IPAM allocations. + - apiGroups: ["crd.projectcalico.org"] + resources: + - blockaffinities + - ipamblocks + - ipamhandles + verbs: + - get + - list + - create + - update + - delete + - apiGroups: ["crd.projectcalico.org"] + resources: + - ipamconfigs + verbs: + - get + # Block affinities must also be watchable by confd for route aggregation. + - apiGroups: ["crd.projectcalico.org"] + resources: + - blockaffinities + verbs: + - watch + # The Calico IPAM migration needs to get daemonsets. These permissions can be + # removed if not upgrading from an installation using host-local IPAM. + - apiGroups: ["apps"] + resources: + - daemonsets + verbs: + - get + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: calico-node +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: calico-node +subjects: +- kind: ServiceAccount + name: calico-node + namespace: kube-system + +--- +# Source: calico/templates/calico-node.yaml +# This manifest installs the calico-node container, as well +# as the CNI plugins and network config on +# each master and worker node in a Kubernetes cluster. +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: calico-node + namespace: kube-system + labels: + k8s-app: calico-node +spec: + selector: + matchLabels: + k8s-app: calico-node + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 1 + template: + metadata: + labels: + k8s-app: calico-node + spec: + nodeSelector: + kubernetes.io/os: linux + hostNetwork: true + tolerations: + # Make sure calico-node gets scheduled on all nodes. + - effect: NoSchedule + operator: Exists + # Mark the pod as a critical add-on for rescheduling. + - key: CriticalAddonsOnly + operator: Exists + - effect: NoExecute + operator: Exists + serviceAccountName: calico-node + # Minimize downtime during a rolling upgrade or deletion; tell Kubernetes to do a "force + # deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods. + terminationGracePeriodSeconds: 0 + priorityClassName: system-node-critical + initContainers: + # This container performs upgrade from host-local IPAM to calico-ipam. + # It can be deleted if this is a fresh installation, or if you have already + # upgraded to use calico-ipam. + - name: upgrade-ipam + image: {{ .BinaryImageName }} + command: ["/opt/cni/bin/calico-ipam", "-upgrade"] + envFrom: + - configMapRef: + # Allow KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT to be overridden for eBPF mode. + name: kubernetes-services-endpoint + optional: true + env: + - name: KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: CALICO_NETWORKING_BACKEND + valueFrom: + configMapKeyRef: + name: calico-config + key: calico_backend + volumeMounts: + - mountPath: /var/lib/cni/networks + name: host-local-net-dir + - mountPath: /host/opt/cni/bin + name: cni-bin-dir + securityContext: + privileged: true + # This container installs the CNI binaries + # and CNI network config file on each node. + - name: install-cni + image: {{ .BinaryImageName }} + command: ["/opt/cni/bin/install"] + envFrom: + - configMapRef: + # Allow KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT to be overridden for eBPF mode. + name: kubernetes-services-endpoint + optional: true + env: + # Name of the CNI config file to create. + - name: CNI_CONF_NAME + value: "10-calico.conflist" + # The CNI network config to install on each node. + - name: CNI_NETWORK_CONFIG + valueFrom: + configMapKeyRef: + name: calico-config + key: cni_network_config + # Set the hostname based on the k8s node name. + - name: KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + # CNI MTU Config variable + - name: CNI_MTU + valueFrom: + configMapKeyRef: + name: calico-config + key: veth_mtu + # Prevents the container from sleeping forever. + - name: SLEEP + value: "false" + volumeMounts: + - mountPath: /host/opt/cni/bin + name: cni-bin-dir + - mountPath: /host/etc/cni/net.d + name: cni-net-dir + securityContext: + privileged: true + # Adds a Flex Volume Driver that creates a per-pod Unix Domain Socket to allow Dikastes + # to communicate with Felix over the Policy Sync API. + - name: flexvol-driver + image: {{ .FelixDriverImageName }} + volumeMounts: + - name: flexvol-driver-host + mountPath: /host/driver + securityContext: + privileged: true + containers: + # Runs calico-node container on each Kubernetes node. This + # container programs network policy and routes on each + # host. + - name: calico-node + image: {{ .DaemonSetImageName }} + envFrom: + - configMapRef: + # Allow KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT to be overridden for eBPF mode. + name: kubernetes-services-endpoint + optional: true + env: + # Use Kubernetes API as the backing datastore. + - name: DATASTORE_TYPE + value: "kubernetes" + # Wait for the datastore. + - name: WAIT_FOR_DATASTORE + value: "true" + # Set based on the k8s node name. + - name: NODENAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + # Choose the backend to use. + - name: CALICO_NETWORKING_BACKEND + valueFrom: + configMapKeyRef: + name: calico-config + key: calico_backend + # Cluster type to identify the deployment type + - name: CLUSTER_TYPE + value: "k8s,bgp" + # Auto-detect the BGP IP address. + - name: IP + value: "autodetect" + # Enable IPIP + - name: CALICO_IPV4POOL_IPIP + value: "Always" + # Enable or Disable VXLAN on the default IP pool. + - name: CALICO_IPV4POOL_VXLAN + value: "Never" + # Set MTU for tunnel device used if ipip is enabled + - name: FELIX_IPINIPMTU + valueFrom: + configMapKeyRef: + name: calico-config + key: veth_mtu + # Set MTU for the VXLAN tunnel device. + - name: FELIX_VXLANMTU + valueFrom: + configMapKeyRef: + name: calico-config + key: veth_mtu + # Set MTU for the Wireguard tunnel device. + - name: FELIX_WIREGUARDMTU + valueFrom: + configMapKeyRef: + name: calico-config + key: veth_mtu + # The default IPv4 pool to create on startup if none exists. Pod IPs will be + # chosen from this range. Changing this value after installation will have + # no effect. This should fall within `--cluster-cidr`. + # - name: CALICO_IPV4POOL_CIDR + # value: "192.168.0.0/16" + # Disable file logging so `kubectl logs` works. + - name: CALICO_DISABLE_FILE_LOGGING + value: "true" + # Set Felix endpoint to host default action to ACCEPT. + - name: FELIX_DEFAULTENDPOINTTOHOSTACTION + value: "ACCEPT" + # Disable IPv6 on Kubernetes. + - name: FELIX_IPV6SUPPORT + value: "false" + - name: FELIX_HEALTHENABLED + value: "true" + securityContext: + privileged: true + resources: + requests: + cpu: 250m + livenessProbe: + exec: + command: + - /bin/calico-node + - -felix-live + - -bird-live + periodSeconds: 10 + initialDelaySeconds: 10 + failureThreshold: 6 + timeoutSeconds: 10 + readinessProbe: + exec: + command: + - /bin/calico-node + - -felix-ready + - -bird-ready + periodSeconds: 10 + timeoutSeconds: 10 + volumeMounts: + # For maintaining CNI plugin API credentials. + - mountPath: /host/etc/cni/net.d + name: cni-net-dir + readOnly: false + - mountPath: /lib/modules + name: lib-modules + readOnly: true + - mountPath: /run/xtables.lock + name: xtables-lock + readOnly: false + - mountPath: /var/run/calico + name: var-run-calico + readOnly: false + - mountPath: /var/lib/calico + name: var-lib-calico + readOnly: false + - name: policysync + mountPath: /var/run/nodeagent + # For eBPF mode, we need to be able to mount the BPF filesystem at /sys/fs/bpf so we mount in the + # parent directory. + - name: sysfs + mountPath: /sys/fs/ + # Bidirectional means that, if we mount the BPF filesystem at /sys/fs/bpf it will propagate to the host. + # If the host is known to mount that filesystem already then Bidirectional can be omitted. + mountPropagation: Bidirectional + - name: cni-log-dir + mountPath: /var/log/calico/cni + readOnly: true + volumes: + # Used by calico-node. + - name: lib-modules + hostPath: + path: /lib/modules + - name: var-run-calico + hostPath: + path: /var/run/calico + - name: var-lib-calico + hostPath: + path: /var/lib/calico + - name: xtables-lock + hostPath: + path: /run/xtables.lock + type: FileOrCreate + - name: sysfs + hostPath: + path: /sys/fs/ + type: DirectoryOrCreate + # Used to install CNI. + - name: cni-bin-dir + hostPath: + path: /opt/cni/bin + - name: cni-net-dir + hostPath: + path: /etc/cni/net.d + # Used to access CNI logs. + - name: cni-log-dir + hostPath: + path: /var/log/calico/cni + # Mount in the directory for host-local IPAM allocations. This is + # used when upgrading from host-local to calico-ipam, and can be removed + # if not using the upgrade-ipam init container. + - name: host-local-net-dir + hostPath: + path: /var/lib/cni/networks + # Used to create per-pod Unix Domain Sockets + - name: policysync + hostPath: + type: DirectoryOrCreate + path: /var/run/nodeagent + # Used to install Flex Volume Driver + - name: flexvol-driver-host + hostPath: + type: DirectoryOrCreate + path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/nodeagent~uds +--- + +apiVersion: v1 +kind: ServiceAccount +metadata: + name: calico-node + namespace: kube-system + +--- +# Source: calico/templates/calico-kube-controllers.yaml +# See https://github.com/projectcalico/kube-controllers +apiVersion: apps/v1 +kind: Deployment +metadata: + name: calico-kube-controllers + namespace: kube-system + labels: + k8s-app: calico-kube-controllers +spec: + # The controllers can only have a single active instance. + replicas: 1 + selector: + matchLabels: + k8s-app: calico-kube-controllers + strategy: + type: Recreate + template: + metadata: + name: calico-kube-controllers + namespace: kube-system + labels: + k8s-app: calico-kube-controllers + spec: + nodeSelector: + kubernetes.io/os: linux + tolerations: + # Mark the pod as a critical add-on for rescheduling. + - key: CriticalAddonsOnly + operator: Exists + - key: node-role.kubernetes.io/master + effect: NoSchedule + serviceAccountName: calico-kube-controllers + priorityClassName: system-cluster-critical + containers: + - name: calico-kube-controllers + image: {{ .DeploymentImageName }} + env: + # Choose which controllers to run. + - name: ENABLED_CONTROLLERS + value: node + - name: DATASTORE_TYPE + value: kubernetes + livenessProbe: + exec: + command: + - /usr/bin/check-status + - -l + periodSeconds: 10 + initialDelaySeconds: 10 + failureThreshold: 6 + timeoutSeconds: 10 + readinessProbe: + exec: + command: + - /usr/bin/check-status + - -r + periodSeconds: 10 + +--- + +apiVersion: v1 +kind: ServiceAccount +metadata: + name: calico-kube-controllers + namespace: kube-system + +--- + +# This manifest creates a Pod Disruption Budget for Controller to allow K8s Cluster Autoscaler to evict + +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: calico-kube-controllers + namespace: kube-system + labels: + k8s-app: calico-kube-controllers +spec: + maxUnavailable: 1 + selector: + matchLabels: + k8s-app: calico-kube-controllers + +--- +# Source: calico/templates/calico-etcd-secrets.yaml + +--- +# Source: calico/templates/calico-typha.yaml + +--- +# Source: calico/templates/configure-canal.yaml + From 1c76ff5cea01605c2d985c010644edf1e689d34b Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Thu, 12 Aug 2021 15:29:54 -0700 Subject: [PATCH 06/53] lint --- pkg/minikube/cni/calico.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/minikube/cni/calico.go b/pkg/minikube/cni/calico.go index 11c03a233e..9d5ec46287 100644 --- a/pkg/minikube/cni/calico.go +++ b/pkg/minikube/cni/calico.go @@ -18,6 +18,7 @@ package cni import ( "bytes" + // goembed needs this _ "embed" "text/template" From 2a1693655a89e90cdaf34e15ec069316b605a196 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Fri, 13 Aug 2021 12:30:24 -0700 Subject: [PATCH 07/53] add space for aesthetics --- hack/jenkins/cloud_shell_functional_tests_docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/jenkins/cloud_shell_functional_tests_docker.sh b/hack/jenkins/cloud_shell_functional_tests_docker.sh index 8f743dcc3e..6a229375c6 100755 --- a/hack/jenkins/cloud_shell_functional_tests_docker.sh +++ b/hack/jenkins/cloud_shell_functional_tests_docker.sh @@ -30,7 +30,7 @@ gcloud cloud-shell ssh --authorize-session << EOF DRIVER="docker" JOB_NAME="Docker_Cloud_Shell" CONTAINER_RUNTIME="docker" -EXTRA_TEST_ARGS="-test.run (TestFunctional|TestAddons|TestStartStop)" + EXTRA_TEST_ARGS="-test.run (TestFunctional|TestAddons|TestStartStop)" # Need to set these in cloud-shell or will not be present in common.sh MINIKUBE_LOCATION=$MINIKUBE_LOCATION From 098adff14f97e55ded5626b0a90c858c09622337 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Fri, 13 Aug 2021 12:55:06 -0700 Subject: [PATCH 08/53] fix image name --- pkg/minikube/bootstrapper/images/images.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/minikube/bootstrapper/images/images.go b/pkg/minikube/bootstrapper/images/images.go index 6d8fcf4b07..319983e7f9 100644 --- a/pkg/minikube/bootstrapper/images/images.go +++ b/pkg/minikube/bootstrapper/images/images.go @@ -179,7 +179,7 @@ func CalicoDeployment(repo string) string { if repo == "" { repo = "docker.io/calico" } - return path.Join(repo, "kube-controllers::"+calicoVersion) + return path.Join(repo, "kube-controllers:"+calicoVersion) } // CalicoFelixDriver returns image used for felix driver @@ -187,7 +187,7 @@ func CalicoFelixDriver(repo string) string { if repo == "" { repo = "docker.io/calico" } - return path.Join(repo, "pod2daemon-flexvol::"+calicoVersion) + return path.Join(repo, "pod2daemon-flexvol:"+calicoVersion) } // CalicoBin returns image used for calico binary image @@ -195,5 +195,5 @@ func CalicoBin(repo string) string { if repo == "" { repo = "docker.io/calico" } - return path.Join(repo, "cni::"+calicoVersion) + return path.Join(repo, "cni:"+calicoVersion) } From 6f608d3704693ec5594d54c9464b5d87b2aaac20 Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Thu, 12 Aug 2021 09:19:51 -0700 Subject: [PATCH 09/53] Fix TestStoppedBinaryUpgrade structure so most of the potentially broken code is in a leaf subtest. --- test/integration/version_upgrade_test.go | 76 ++++++++++++------------ 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/test/integration/version_upgrade_test.go b/test/integration/version_upgrade_test.go index 27311475fb..928cadb643 100644 --- a/test/integration/version_upgrade_test.go +++ b/test/integration/version_upgrade_test.go @@ -161,51 +161,53 @@ func TestStoppedBinaryUpgrade(t *testing.T) { } defer os.Remove(tf.Name()) - args := append([]string{"start", "-p", profile, "--memory=2200"}, legacyStartArgs()...) - rr := &RunResult{} - r := func() error { - c := exec.CommandContext(ctx, tf.Name(), args...) - var legacyEnv []string - // replace the global KUBECONFIG with a fresh kubeconfig - // because for minikube<1.17.0 it can not read the new kubeconfigs that have extra "Extenions" block - // see: https://github.com/kubernetes/minikube/issues/10210 - for _, e := range os.Environ() { - if !strings.Contains(e, "KUBECONFIG") { // get all global envs except the Kubeconfig which is used by new versions of minikubes - legacyEnv = append(legacyEnv, e) + t.Run("Upgrade", func(t *testing.T) { + args := append([]string{"start", "-p", profile, "--memory=2200"}, legacyStartArgs()...) + rr := &RunResult{} + r := func() error { + c := exec.CommandContext(ctx, tf.Name(), args...) + var legacyEnv []string + // replace the global KUBECONFIG with a fresh kubeconfig + // because for minikube<1.17.0 it can not read the new kubeconfigs that have extra "Extenions" block + // see: https://github.com/kubernetes/minikube/issues/10210 + for _, e := range os.Environ() { + if !strings.Contains(e, "KUBECONFIG") { // get all global envs except the Kubeconfig which is used by new versions of minikubes + legacyEnv = append(legacyEnv, e) + } } + // using a fresh kubeconfig for this test + legacyKubeConfig, err := ioutil.TempFile("", "legacy_kubeconfig") + if err != nil { + t.Fatalf("failed to create temp file for legacy kubeconfig %v", err) + } + + defer os.Remove(legacyKubeConfig.Name()) // clean up + legacyEnv = append(legacyEnv, fmt.Sprintf("KUBECONFIG=%s", legacyKubeConfig.Name())) + c.Env = legacyEnv + rr, err = Run(t, c) + return err } - // using a fresh kubeconfig for this test - legacyKubeConfig, err := ioutil.TempFile("", "legacy_kubeconfig") + + // Retry up to two times, to allow flakiness for the legacy release + if err := retry.Expo(r, 1*time.Second, Minutes(30), 2); err != nil { + t.Fatalf("legacy %s start failed: %v", desiredLegacyVersion, err) + } + + rr, err = Run(t, exec.CommandContext(ctx, tf.Name(), "-p", profile, "stop")) if err != nil { - t.Fatalf("failed to create temp file for legacy kubeconfig %v", err) + t.Errorf("failed to stop cluster: %s: %v", rr.Command(), err) } - defer os.Remove(legacyKubeConfig.Name()) // clean up - legacyEnv = append(legacyEnv, fmt.Sprintf("KUBECONFIG=%s", legacyKubeConfig.Name())) - c.Env = legacyEnv - rr, err = Run(t, c) - return err - } - - // Retry up to two times, to allow flakiness for the legacy release - if err := retry.Expo(r, 1*time.Second, Minutes(30), 2); err != nil { - t.Fatalf("legacy %s start failed: %v", desiredLegacyVersion, err) - } - - rr, err = Run(t, exec.CommandContext(ctx, tf.Name(), "-p", profile, "stop")) - if err != nil { - t.Errorf("failed to stop cluster: %s: %v", rr.Command(), err) - } - - args = append([]string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", "-v=1"}, StartArgs()...) - rr, err = Run(t, exec.CommandContext(ctx, Target(), args...)) - if err != nil { - t.Fatalf("upgrade from %s to HEAD failed: %s: %v", desiredLegacyVersion, rr.Command(), err) - } + args = append([]string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", "-v=1"}, StartArgs()...) + rr, err = Run(t, exec.CommandContext(ctx, Target(), args...)) + if err != nil { + t.Fatalf("upgrade from %s to HEAD failed: %s: %v", desiredLegacyVersion, rr.Command(), err) + } + }) t.Run("MinikubeLogs", func(t *testing.T) { args := []string{"logs", "-p", profile} - rr, err = Run(t, exec.CommandContext(ctx, Target(), args...)) + _, err := Run(t, exec.CommandContext(ctx, Target(), args...)) if err != nil { t.Fatalf("`minikube logs` after upgrade to HEAD from %s failed: %v", desiredLegacyVersion, err) } From e7c190b3267f842ab4dba32c204af003f2a98e3c Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Thu, 12 Aug 2021 09:25:27 -0700 Subject: [PATCH 10/53] Fix TestJSONOutput tests when failing on the specific command. --- test/integration/json_output_test.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/test/integration/json_output_test.go b/test/integration/json_output_test.go index 1505f95dd8..72eda4bb5c 100644 --- a/test/integration/json_output_test.go +++ b/test/integration/json_output_test.go @@ -55,18 +55,21 @@ func TestJSONOutput(t *testing.T) { for _, test := range tests { t.Run(test.command, func(t *testing.T) { - args := []string{test.command, "-p", profile, "--output=json", "--user=testUser"} - args = append(args, test.args...) + var ces []*cloudEvent + t.Run("Command", func(t *testing.T) { + args := []string{test.command, "-p", profile, "--output=json", "--user=testUser"} + args = append(args, test.args...) - rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) - if err != nil { - t.Errorf("failed to clean up: args %q: %v", rr.Command(), err) - } + rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) + if err != nil { + t.Errorf("failed to clean up: args %q: %v", rr.Command(), err) + } - ces, err := cloudEvents(t, rr) - if err != nil { - t.Fatalf("converting to cloud events: %v\n", err) - } + ces, err = cloudEvents(t, rr) + if err != nil { + t.Fatalf("converting to cloud events: %v\n", err) + } + }) t.Run("Audit", func(t *testing.T) { got, err := auditContains("testUser") From 1d2b78197beffde561e271fd3ac888f1f6aaf729 Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Thu, 12 Aug 2021 09:34:29 -0700 Subject: [PATCH 11/53] Fix TestAddons to perform setup in a subtest and final checks in another subtest. --- test/integration/addons_test.go | 118 +++++++++++++++++--------------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index 59025f671f..7cea83a66c 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -46,58 +46,60 @@ func TestAddons(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) defer Cleanup(t, profile, cancel) - // We don't need a dummy file is we're on GCE - if !detect.IsOnGCE() || detect.IsCloudShell() { - // Set an env var to point to our dummy credentials file - err := os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", filepath.Join(*testdataDir, "gcp-creds.json")) - defer os.Unsetenv("GOOGLE_APPLICATION_CREDENTIALS") - if err != nil { - t.Fatalf("Failed setting GOOGLE_APPLICATION_CREDENTIALS env var: %v", err) + t.Run("Setup", func(t *testing.T) { + // We don't need a dummy file is we're on GCE + if !detect.IsOnGCE() || detect.IsCloudShell() { + // Set an env var to point to our dummy credentials file + err := os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", filepath.Join(*testdataDir, "gcp-creds.json")) + defer os.Unsetenv("GOOGLE_APPLICATION_CREDENTIALS") + if err != nil { + t.Fatalf("Failed setting GOOGLE_APPLICATION_CREDENTIALS env var: %v", err) + } + + err = os.Setenv("GOOGLE_CLOUD_PROJECT", "this_is_fake") + defer os.Unsetenv("GOOGLE_CLOUD_PROJECT") + if err != nil { + t.Fatalf("Failed setting GOOGLE_CLOUD_PROJECT env var: %v", err) + } } - err = os.Setenv("GOOGLE_CLOUD_PROJECT", "this_is_fake") - defer os.Unsetenv("GOOGLE_CLOUD_PROJECT") - if err != nil { - t.Fatalf("Failed setting GOOGLE_CLOUD_PROJECT env var: %v", err) + args := append([]string{"start", "-p", profile, "--wait=true", "--memory=4000", "--alsologtostderr", "--addons=registry", "--addons=metrics-server", "--addons=olm", "--addons=volumesnapshots", "--addons=csi-hostpath-driver"}, StartArgs()...) + if !NoneDriver() && !(runtime.GOOS == "darwin" && KicDriver()) { // none driver and macos docker driver does not support ingress + args = append(args, "--addons=ingress") + } + if !arm64Platform() { + args = append(args, "--addons=helm-tiller") + } + if !detect.IsOnGCE() { + args = append(args, "--addons=gcp-auth") } - } - - args := append([]string{"start", "-p", profile, "--wait=true", "--memory=4000", "--alsologtostderr", "--addons=registry", "--addons=metrics-server", "--addons=olm", "--addons=volumesnapshots", "--addons=csi-hostpath-driver"}, StartArgs()...) - if !NoneDriver() && !(runtime.GOOS == "darwin" && KicDriver()) { // none driver and macos docker driver does not support ingress - args = append(args, "--addons=ingress") - } - if !arm64Platform() { - args = append(args, "--addons=helm-tiller") - } - if !detect.IsOnGCE() { - args = append(args, "--addons=gcp-auth") - } - rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) - if err != nil { - t.Fatalf("%s failed: %v", rr.Command(), err) - } - - // If we're running the integration tests on GCE, which is frequently the case, first check to make sure we exit out properly, - // then use force to actually test using creds. - if detect.IsOnGCE() { - args = []string{"-p", profile, "addons", "enable", "gcp-auth"} rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) - if err == nil { - t.Errorf("Expected error but didn't get one. command %v, output %v", rr.Command(), rr.Output()) - } else { - if !strings.Contains(rr.Output(), "It seems that you are running in GCE") { - t.Errorf("Unexpected error message: %v", rr.Output()) + if err != nil { + t.Fatalf("%s failed: %v", rr.Command(), err) + } + + // If we're running the integration tests on GCE, which is frequently the case, first check to make sure we exit out properly, + // then use force to actually test using creds. + if detect.IsOnGCE() { + args = []string{"-p", profile, "addons", "enable", "gcp-auth"} + rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) + if err == nil { + t.Errorf("Expected error but didn't get one. command %v, output %v", rr.Command(), rr.Output()) } else { - // ok, use force here since we are in GCE - // do not use --force unless absolutely necessary - args = append(args, "--force") - rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) - if err != nil { - t.Errorf("%s failed: %v", rr.Command(), err) + if !strings.Contains(rr.Output(), "It seems that you are running in GCE") { + t.Errorf("Unexpected error message: %v", rr.Output()) + } else { + // ok, use force here since we are in GCE + // do not use --force unless absolutely necessary + args = append(args, "--force") + rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) + if err != nil { + t.Errorf("%s failed: %v", rr.Command(), err) + } } } } - } + }) // Parallelized tests t.Run("parallel", func(t *testing.T) { @@ -125,19 +127,21 @@ func TestAddons(t *testing.T) { } }) - // Assert that disable/enable works offline - rr, err = Run(t, exec.CommandContext(ctx, Target(), "stop", "-p", profile)) - if err != nil { - t.Errorf("failed to stop minikube. args %q : %v", rr.Command(), err) - } - rr, err = Run(t, exec.CommandContext(ctx, Target(), "addons", "enable", "dashboard", "-p", profile)) - if err != nil { - t.Errorf("failed to enable dashboard addon: args %q : %v", rr.Command(), err) - } - rr, err = Run(t, exec.CommandContext(ctx, Target(), "addons", "disable", "dashboard", "-p", profile)) - if err != nil { - t.Errorf("failed to disable dashboard addon: args %q : %v", rr.Command(), err) - } + t.Run("StoppedEnableDisable", func(t *testing.T) { + // Assert that disable/enable works offline + rr, err := Run(t, exec.CommandContext(ctx, Target(), "stop", "-p", profile)) + if err != nil { + t.Errorf("failed to stop minikube. args %q : %v", rr.Command(), err) + } + rr, err = Run(t, exec.CommandContext(ctx, Target(), "addons", "enable", "dashboard", "-p", profile)) + if err != nil { + t.Errorf("failed to enable dashboard addon: args %q : %v", rr.Command(), err) + } + rr, err = Run(t, exec.CommandContext(ctx, Target(), "addons", "disable", "dashboard", "-p", profile)) + if err != nil { + t.Errorf("failed to disable dashboard addon: args %q : %v", rr.Command(), err) + } + }) } // validateIngressAddon tests the ingress addon by deploying a default nginx pod From 58ab8876b5b2bd686f90dff61555389b0d3460bc Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Thu, 12 Aug 2021 13:22:08 -0700 Subject: [PATCH 12/53] Fix TestGuestEnvironment structure. --- test/integration/guest_env_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/integration/guest_env_test.go b/test/integration/guest_env_test.go index a55f95cccb..21f274b477 100644 --- a/test/integration/guest_env_test.go +++ b/test/integration/guest_env_test.go @@ -35,11 +35,13 @@ func TestGuestEnvironment(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), Minutes(15)) defer CleanupWithLogs(t, profile, cancel) - args := append([]string{"start", "-p", profile, "--install-addons=false", "--memory=2048", "--wait=false"}, StartArgs()...) - rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) - if err != nil { - t.Errorf("failed to start minikube: args %q: %v", rr.Command(), err) - } + t.Run("Setup", func(t *testing.T) { + args := append([]string{"start", "-p", profile, "--install-addons=false", "--memory=2048", "--wait=false"}, StartArgs()...) + rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) + if err != nil { + t.Errorf("failed to start minikube: args %q: %v", rr.Command(), err) + } + }) // Run as a group so that our defer doesn't happen as tests are runnings t.Run("Binaries", func(t *testing.T) { From c67ceaabee6c00837e11f5eb57f02a6554a8e8a3 Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Thu, 12 Aug 2021 13:28:31 -0700 Subject: [PATCH 13/53] Fix tunnel test. --- .../functional_test_tunnel_test.go | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/test/integration/functional_test_tunnel_test.go b/test/integration/functional_test_tunnel_test.go index 299d2c1c32..2b3d89b578 100644 --- a/test/integration/functional_test_tunnel_test.go +++ b/test/integration/functional_test_tunnel_test.go @@ -135,24 +135,29 @@ func validateServiceStable(ctx context.Context, t *testing.T, profile string) { if GithubActionRunner() && runtime.GOOS == "darwin" { t.Skip("The test WaitService is broken on github actions in macos https://github.com/kubernetes/minikube/issues/8434") } - checkRoutePassword(t) + setupFailed := t.Run("Setup", func(t *testing.T) { + checkRoutePassword(t) - client, err := kapi.Client(profile) - if err != nil { - t.Fatalf("failed to get Kubernetes client for %q: %v", profile, err) - } + client, err := kapi.Client(profile) + if err != nil { + t.Fatalf("failed to get Kubernetes client for %q: %v", profile, err) + } - // Start the "nginx" pod. - rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "apply", "-f", filepath.Join(*testdataDir, "testsvc.yaml"))) - if err != nil { - t.Fatalf("%s failed: %v", rr.Command(), err) - } - if _, err := PodWait(ctx, t, profile, "default", "run=nginx-svc", Minutes(4)); err != nil { - t.Fatalf("wait: %v", err) - } + // Start the "nginx" pod. + rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "apply", "-f", filepath.Join(*testdataDir, "testsvc.yaml"))) + if err != nil { + t.Fatalf("%s failed: %v", rr.Command(), err) + } + if _, err := PodWait(ctx, t, profile, "default", "run=nginx-svc", Minutes(4)); err != nil { + t.Fatalf("wait: %v", err) + } - if err := kapi.WaitForService(client, "default", "nginx-svc", true, 1*time.Second, Minutes(2)); err != nil { - t.Fatal(errors.Wrap(err, "Error waiting for nginx service to be up")) + if err := kapi.WaitForService(client, "default", "nginx-svc", true, 1*time.Second, Minutes(2)); err != nil { + t.Fatal(errors.Wrap(err, "Error waiting for nginx service to be up")) + } + }) + if setupFailed { + t.Fatal("Failed setup") } t.Run("IngressIP", func(t *testing.T) { @@ -160,7 +165,7 @@ func validateServiceStable(ctx context.Context, t *testing.T, profile string) { t.Skip("The test WaitService/IngressIP is broken on hyperv https://github.com/kubernetes/minikube/issues/8381") } // Wait until the nginx-svc has a loadbalancer ingress IP - err = wait.PollImmediate(5*time.Second, Minutes(3), func() (bool, error) { + err := wait.PollImmediate(5*time.Second, Minutes(3), func() (bool, error) { rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "get", "svc", "nginx-svc", "-o", "jsonpath={.status.loadBalancer.ingress[0].ip}")) if err != nil { return false, err From 486e475929114671a41c0ba3c622faadee10794e Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Thu, 12 Aug 2021 13:49:08 -0700 Subject: [PATCH 14/53] Propagate t.Fatalf on setup failure and ensure cleanup is done correctly for TestAddons. --- test/integration/addons_test.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index 7cea83a66c..513b78ec8f 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -46,18 +46,22 @@ func TestAddons(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) defer Cleanup(t, profile, cancel) - t.Run("Setup", func(t *testing.T) { + setupFailed := t.Run("Setup", func(t *testing.T) { // We don't need a dummy file is we're on GCE if !detect.IsOnGCE() || detect.IsCloudShell() { // Set an env var to point to our dummy credentials file err := os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", filepath.Join(*testdataDir, "gcp-creds.json")) - defer os.Unsetenv("GOOGLE_APPLICATION_CREDENTIALS") + t.Cleanup(func() { + os.Unsetenv("GOOGLE_APPLICATION_CREDENTIALS") + }) if err != nil { t.Fatalf("Failed setting GOOGLE_APPLICATION_CREDENTIALS env var: %v", err) } err = os.Setenv("GOOGLE_CLOUD_PROJECT", "this_is_fake") - defer os.Unsetenv("GOOGLE_CLOUD_PROJECT") + t.Cleanup(func() { + os.Unsetenv("GOOGLE_CLOUD_PROJECT") + }) if err != nil { t.Fatalf("Failed setting GOOGLE_CLOUD_PROJECT env var: %v", err) } @@ -101,6 +105,10 @@ func TestAddons(t *testing.T) { } }) + if setupFailed { + t.Fatalf("Failed setup for addon tests") + } + // Parallelized tests t.Run("parallel", func(t *testing.T) { tests := []struct { From 7697b41c738e64d7c4b3f65f12fa72a7f2e87bdf Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Fri, 13 Aug 2021 13:53:56 -0700 Subject: [PATCH 15/53] Move test skipping to start of TunnelTest. --- test/integration/functional_test_tunnel_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/integration/functional_test_tunnel_test.go b/test/integration/functional_test_tunnel_test.go index 2b3d89b578..1d2d9c7ca5 100644 --- a/test/integration/functional_test_tunnel_test.go +++ b/test/integration/functional_test_tunnel_test.go @@ -135,9 +135,8 @@ func validateServiceStable(ctx context.Context, t *testing.T, profile string) { if GithubActionRunner() && runtime.GOOS == "darwin" { t.Skip("The test WaitService is broken on github actions in macos https://github.com/kubernetes/minikube/issues/8434") } + checkRoutePassword(t) setupFailed := t.Run("Setup", func(t *testing.T) { - checkRoutePassword(t) - client, err := kapi.Client(profile) if err != nil { t.Fatalf("failed to get Kubernetes client for %q: %v", profile, err) From 4f8adb6f6d47fbc41e9d2113c7dd561acd52c5cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Fri, 13 Aug 2021 23:30:12 +0200 Subject: [PATCH 16/53] Add output parameter to the docker-env none shell Allows structured output as json and yaml, in addition to the previous text output format. Note that keys might not be sorted. --- cmd/minikube/cmd/docker-env.go | 85 +++++++++++++++++++++ site/content/en/docs/commands/docker-env.md | 11 +-- 2 files changed, 91 insertions(+), 5 deletions(-) diff --git a/cmd/minikube/cmd/docker-env.go b/cmd/minikube/cmd/docker-env.go index 83858724b6..f9dc625308 100644 --- a/cmd/minikube/cmd/docker-env.go +++ b/cmd/minikube/cmd/docker-env.go @@ -20,6 +20,7 @@ limitations under the License. package cmd import ( + "encoding/json" "fmt" "io" "net" @@ -33,6 +34,7 @@ import ( apiWait "k8s.io/apimachinery/pkg/util/wait" "github.com/spf13/cobra" + "gopkg.in/yaml.v2" "k8s.io/klog/v2" kconst "k8s.io/kubernetes/cmd/kubeadm/app/constants" @@ -384,12 +386,94 @@ func dockerSetScript(ec DockerEnvConfig, w io.Writer) error { dockerSetEnvTmpl = dockerEnvTCPTmpl } envVars := dockerEnvVars(ec) + if ec.Shell == "none" { + switch outputFormat { + case "": + // shell "none" + break + case "text": + for k, v := range envVars { + _, err := fmt.Fprintf(w, "%s=%s\n", k, v) + if err != nil { + return err + } + } + return nil + case "json": + json, err := json.Marshal(envVars) + if err != nil { + return err + } + _, err = w.Write(json) + if err != nil { + return err + } + _, err = w.Write([]byte{'\n'}) + if err != nil { + return err + } + return nil + case "yaml": + yaml, err := yaml.Marshal(envVars) + if err != nil { + return err + } + _, err = w.Write(yaml) + if err != nil { + return err + } + return nil + default: + exit.Message(reason.InternalOutputUsage, "error: --output must be 'text', 'yaml' or 'json'") + } + } return shell.SetScript(ec.EnvConfig, w, dockerSetEnvTmpl, dockerShellCfgSet(ec, envVars)) } // dockerSetScript writes out a shell-compatible 'docker-env unset' script func dockerUnsetScript(ec DockerEnvConfig, w io.Writer) error { vars := dockerEnvNames(ec) + if ec.Shell == "none" { + switch outputFormat { + case "": + // shell "none" + break + case "text": + for _, n := range vars { + _, err := fmt.Fprintf(w, "%s\n", n) + if err != nil { + return err + } + } + return nil + case "json": + json, err := json.Marshal(vars) + if err != nil { + return err + } + _, err = w.Write(json) + if err != nil { + return err + } + _, err = w.Write([]byte{'\n'}) + if err != nil { + return err + } + return nil + case "yaml": + yaml, err := yaml.Marshal(vars) + if err != nil { + return err + } + _, err = w.Write(yaml) + if err != nil { + return err + } + return nil + default: + exit.Message(reason.InternalOutputUsage, "error: --output must be 'text', 'yaml' or 'json'") + } + } return shell.UnsetScript(ec.EnvConfig, w, vars) } @@ -508,5 +592,6 @@ func init() { dockerEnvCmd.Flags().BoolVar(&sshHost, "ssh-host", false, "Use SSH connection instead of HTTPS (port 2376)") dockerEnvCmd.Flags().BoolVar(&sshAdd, "ssh-add", false, "Add SSH identity key to SSH authentication agent") dockerEnvCmd.Flags().StringVar(&shell.ForceShell, "shell", "", "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect") + dockerEnvCmd.Flags().StringVarP(&outputFormat, "output", "o", "", "One of 'text', 'yaml' or 'json'.") dockerEnvCmd.Flags().BoolVarP(&dockerUnset, "unset", "u", false, "Unset variables instead of setting them") } diff --git a/site/content/en/docs/commands/docker-env.md b/site/content/en/docs/commands/docker-env.md index bfecfc5730..ebd62060a5 100644 --- a/site/content/en/docs/commands/docker-env.md +++ b/site/content/en/docs/commands/docker-env.md @@ -20,11 +20,12 @@ minikube docker-env [flags] ### Options ``` - --no-proxy Add machine IP to NO_PROXY environment variable - --shell string Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect - --ssh-add Add SSH identity key to SSH authentication agent - --ssh-host Use SSH connection instead of HTTPS (port 2376) - -u, --unset Unset variables instead of setting them + --no-proxy Add machine IP to NO_PROXY environment variable + -o, --output string One of 'text', 'yaml' or 'json'. + --shell string Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect + --ssh-add Add SSH identity key to SSH authentication agent + --ssh-host Use SSH connection instead of HTTPS (port 2376) + -u, --unset Unset variables instead of setting them ``` ### Options inherited from parent commands From 5bd3f9a79c7087ec58ab15db813c58b859370355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Fri, 13 Aug 2021 23:31:53 +0200 Subject: [PATCH 17/53] Add tests for the new docker-env output formats --- cmd/minikube/cmd/docker-env_test.go | 115 +++++++++++++++++++++++++++- 1 file changed, 113 insertions(+), 2 deletions(-) diff --git a/cmd/minikube/cmd/docker-env_test.go b/cmd/minikube/cmd/docker-env_test.go index 915b3da622..e0fbb6780a 100644 --- a/cmd/minikube/cmd/docker-env_test.go +++ b/cmd/minikube/cmd/docker-env_test.go @@ -18,10 +18,14 @@ package cmd import ( "bytes" + "encoding/json" "os" + "strings" "testing" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "gopkg.in/yaml.v2" ) type FakeNoProxyGetter struct { @@ -36,13 +40,16 @@ func (f FakeNoProxyGetter) GetNoProxyVar() (string, string) { func TestGenerateDockerScripts(t *testing.T) { var tests = []struct { shell string + output string config DockerEnvConfig noProxyGetter *FakeNoProxyGetter wantSet string wantUnset string + diffOpts []cmp.Option }{ { "bash", + "", DockerEnvConfig{profile: "dockerdriver", driver: "docker", hostIP: "127.0.0.1", port: 32842, certsDir: "/certs"}, nil, `export DOCKER_TLS_VERIFY="1" @@ -58,9 +65,11 @@ unset DOCKER_HOST; unset DOCKER_CERT_PATH; unset MINIKUBE_ACTIVE_DOCKERD; `, + nil, }, { "bash", + "", DockerEnvConfig{profile: "dockerdriver", driver: "docker", ssh: true, username: "root", hostname: "host", sshport: 22}, nil, `export DOCKER_HOST="ssh://root@host:22" @@ -74,9 +83,11 @@ unset DOCKER_HOST; unset DOCKER_CERT_PATH; unset MINIKUBE_ACTIVE_DOCKERD; `, + nil, }, { "bash", + "", DockerEnvConfig{profile: "bash", driver: "kvm2", hostIP: "127.0.0.1", port: 2376, certsDir: "/certs"}, nil, `export DOCKER_TLS_VERIFY="1" @@ -92,9 +103,11 @@ unset DOCKER_HOST; unset DOCKER_CERT_PATH; unset MINIKUBE_ACTIVE_DOCKERD; `, + nil, }, { "bash", + "", DockerEnvConfig{profile: "ipv6", driver: "kvm2", hostIP: "fe80::215:5dff:fe00:a903", port: 2376, certsDir: "/certs"}, nil, `export DOCKER_TLS_VERIFY="1" @@ -110,9 +123,11 @@ unset DOCKER_HOST; unset DOCKER_CERT_PATH; unset MINIKUBE_ACTIVE_DOCKERD; `, + nil, }, { "fish", + "", DockerEnvConfig{profile: "fish", driver: "kvm2", hostIP: "127.0.0.1", port: 2376, certsDir: "/certs"}, nil, `set -gx DOCKER_TLS_VERIFY "1"; @@ -128,9 +143,11 @@ set -e DOCKER_HOST; set -e DOCKER_CERT_PATH; set -e MINIKUBE_ACTIVE_DOCKERD; `, + nil, }, { "powershell", + "", DockerEnvConfig{profile: "powershell", driver: "hyperv", hostIP: "192.168.0.1", port: 2376, certsDir: "/certs"}, nil, `$Env:DOCKER_TLS_VERIFY = "1" @@ -146,9 +163,11 @@ Remove-Item Env:\\DOCKER_HOST Remove-Item Env:\\DOCKER_CERT_PATH Remove-Item Env:\\MINIKUBE_ACTIVE_DOCKERD `, + nil, }, { "cmd", + "", DockerEnvConfig{profile: "cmd", driver: "hyperv", hostIP: "192.168.0.1", port: 2376, certsDir: "/certs"}, nil, `SET DOCKER_TLS_VERIFY=1 @@ -164,9 +183,11 @@ SET DOCKER_HOST= SET DOCKER_CERT_PATH= SET MINIKUBE_ACTIVE_DOCKERD= `, + nil, }, { "emacs", + "", DockerEnvConfig{profile: "emacs", driver: "hyperv", hostIP: "192.168.0.1", port: 2376, certsDir: "/certs"}, nil, `(setenv "DOCKER_TLS_VERIFY" "1") @@ -181,9 +202,11 @@ SET MINIKUBE_ACTIVE_DOCKERD= (setenv "DOCKER_CERT_PATH" nil) (setenv "MINIKUBE_ACTIVE_DOCKERD" nil) `, + nil, }, { "bash", + "", DockerEnvConfig{profile: "bash-no-proxy", driver: "kvm2", hostIP: "127.0.0.1", port: 2376, certsDir: "/certs", noProxy: true}, &FakeNoProxyGetter{"NO_PROXY", "127.0.0.1"}, `export DOCKER_TLS_VERIFY="1" @@ -202,9 +225,11 @@ unset DOCKER_CERT_PATH; unset MINIKUBE_ACTIVE_DOCKERD; unset NO_PROXY; `, + nil, }, { "bash", + "", DockerEnvConfig{profile: "bash-no-proxy-lower", driver: "kvm2", hostIP: "127.0.0.1", port: 2376, certsDir: "/certs", noProxy: true}, &FakeNoProxyGetter{"no_proxy", "127.0.0.1"}, `export DOCKER_TLS_VERIFY="1" @@ -223,9 +248,11 @@ unset DOCKER_CERT_PATH; unset MINIKUBE_ACTIVE_DOCKERD; unset no_proxy; `, + nil, }, { "powershell", + "", DockerEnvConfig{profile: "powershell-no-proxy-idempotent", driver: "hyperv", hostIP: "192.168.0.1", port: 2376, certsDir: "/certs", noProxy: true}, &FakeNoProxyGetter{"no_proxy", "192.168.0.1"}, `$Env:DOCKER_TLS_VERIFY = "1" @@ -243,9 +270,11 @@ Remove-Item Env:\\DOCKER_CERT_PATH Remove-Item Env:\\MINIKUBE_ACTIVE_DOCKERD Remove-Item Env:\\no_proxy `, + nil, }, { "bash", + "", DockerEnvConfig{profile: "sh-no-proxy-add", driver: "kvm2", hostIP: "127.0.0.1", port: 2376, certsDir: "/certs", noProxy: true}, &FakeNoProxyGetter{"NO_PROXY", "192.168.0.1,10.0.0.4"}, `export DOCKER_TLS_VERIFY="1" @@ -264,9 +293,11 @@ unset DOCKER_CERT_PATH; unset MINIKUBE_ACTIVE_DOCKERD; unset NO_PROXY; `, + nil, }, { "none", + "", DockerEnvConfig{profile: "noneshell", driver: "docker", hostIP: "127.0.0.1", port: 32842, certsDir: "/certs"}, nil, `DOCKER_TLS_VERIFY=1 @@ -279,11 +310,91 @@ DOCKER_HOST DOCKER_CERT_PATH MINIKUBE_ACTIVE_DOCKERD `, + nil, + }, + { + "none", + "text", + DockerEnvConfig{profile: "nonetext", driver: "docker", hostIP: "127.0.0.1", port: 32842, certsDir: "/certs"}, + nil, + `DOCKER_TLS_VERIFY=1 +DOCKER_HOST=tcp://127.0.0.1:32842 +DOCKER_CERT_PATH=/certs +MINIKUBE_ACTIVE_DOCKERD=nonetext +`, + `DOCKER_TLS_VERIFY +DOCKER_HOST +DOCKER_CERT_PATH +MINIKUBE_ACTIVE_DOCKERD +`, + []cmp.Option{ + cmpopts.AcyclicTransformer("SplitLines", func(s string) []string { + return strings.Split(s, "\n") + }), + cmpopts.SortSlices(func(a, b string) bool { + return a < b + }), + }, + }, + { + "none", + "json", + DockerEnvConfig{profile: "nonejson", driver: "docker", hostIP: "127.0.0.1", port: 32842, certsDir: "/certs"}, + nil, + `{ + "DOCKER_TLS_VERIFY": "1", + "DOCKER_HOST": "tcp://127.0.0.1:32842", + "DOCKER_CERT_PATH": "/certs", + "MINIKUBE_ACTIVE_DOCKERD": "nonejson" + }`, + `[ + "DOCKER_TLS_VERIFY", + "DOCKER_HOST", + "DOCKER_CERT_PATH", + "MINIKUBE_ACTIVE_DOCKERD" + ]`, + []cmp.Option{ + cmp.FilterValues(func(x, y string) bool { + return json.Valid([]byte(x)) && json.Valid([]byte(y)) + }, + cmp.Transformer("ParseJSON", func(in string) (out interface{}) { + if err := json.Unmarshal([]byte(in), &out); err != nil { + panic(err) // should never occur given previous filter to ensure valid JSON + } + return out + })), + }, + }, + { + "none", + "yaml", + DockerEnvConfig{profile: "noneyaml", driver: "docker", hostIP: "127.0.0.1", port: 32842, certsDir: "/certs"}, + nil, + `DOCKER_TLS_VERIFY: "1" +DOCKER_HOST: tcp://127.0.0.1:32842 +DOCKER_CERT_PATH: /certs +MINIKUBE_ACTIVE_DOCKERD: noneyaml +`, + `- DOCKER_TLS_VERIFY +- DOCKER_HOST +- DOCKER_CERT_PATH +- MINIKUBE_ACTIVE_DOCKERD +`, + []cmp.Option{ + cmpopts.AcyclicTransformer("ParseYAML", func(in string) (out interface{}) { + if err := yaml.Unmarshal([]byte(in), &out); err != nil { + return nil + } + return out + }), + }, }, } for _, tc := range tests { t.Run(tc.config.profile, func(t *testing.T) { tc.config.EnvConfig.Shell = tc.shell + // set global variable + outputFormat = tc.output defaultNoProxyGetter = tc.noProxyGetter var b []byte buf := bytes.NewBuffer(b) @@ -291,7 +402,7 @@ MINIKUBE_ACTIVE_DOCKERD t.Errorf("setScript(%+v) error: %v", tc.config, err) } got := buf.String() - if diff := cmp.Diff(tc.wantSet, got); diff != "" { + if diff := cmp.Diff(tc.wantSet, got, tc.diffOpts...); diff != "" { t.Errorf("setScript(%+v) mismatch (-want +got):\n%s\n\nraw output:\n%s\nquoted: %q", tc.config, diff, got, got) } @@ -300,7 +411,7 @@ MINIKUBE_ACTIVE_DOCKERD t.Errorf("unsetScript(%+v) error: %v", tc.config, err) } got = buf.String() - if diff := cmp.Diff(tc.wantUnset, got); diff != "" { + if diff := cmp.Diff(tc.wantUnset, got, tc.diffOpts...); diff != "" { t.Errorf("unsetScript(%+v) mismatch (-want +got):\n%s\n\nraw output:\n%s\nquoted: %q", tc.config, diff, got, got) } From 2b6295b36d4526c80356b7ac2762da52c72a6212 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 21:36:13 +0000 Subject: [PATCH 18/53] Bump golang.org/x/mod from 0.4.2 to 0.5.0 Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.4.2 to 0.5.0. - [Release notes](https://github.com/golang/mod/releases) - [Commits](https://github.com/golang/mod/compare/v0.4.2...v0.5.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index b1ff90f4d4..4cc289fa1a 100644 --- a/go.mod +++ b/go.mod @@ -80,7 +80,7 @@ require ( golang.org/x/build v0.0.0-20190927031335-2835ba2e683f golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 golang.org/x/exp v0.0.0-20210220032938-85be41e4509f - golang.org/x/mod v0.4.2 + golang.org/x/mod v0.5.0 golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c diff --git a/go.sum b/go.sum index 74e1c91024..bb863f8cac 100644 --- a/go.sum +++ b/go.sum @@ -1256,8 +1256,9 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0 h1:UG21uOlmZabA4fW5i7ZX6bjw1xELEGg/ZLgZq9auk/Q= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= From c732c05044c2691fbbd11612ce320709681f94f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 21:36:56 +0000 Subject: [PATCH 19/53] Bump github.com/cloudevents/sdk-go/v2 from 2.3.1 to 2.5.0 Bumps [github.com/cloudevents/sdk-go/v2](https://github.com/cloudevents/sdk-go) from 2.3.1 to 2.5.0. - [Release notes](https://github.com/cloudevents/sdk-go/releases) - [Commits](https://github.com/cloudevents/sdk-go/compare/v2.3.1...v2.5.0) --- updated-dependencies: - dependency-name: github.com/cloudevents/sdk-go/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 3 ++- go.sum | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index b1ff90f4d4..141520643e 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/c4milo/gotoolkit v0.0.0-20190525173301-67483a18c17a // indirect github.com/cenkalti/backoff/v4 v4.1.1 github.com/cheggaaa/pb/v3 v3.0.8 - github.com/cloudevents/sdk-go/v2 v2.3.1 + github.com/cloudevents/sdk-go/v2 v2.5.0 github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect github.com/docker/docker v20.10.7+incompatible @@ -32,6 +32,7 @@ require ( github.com/gookit/color v1.4.2 // indirect github.com/hashicorp/go-getter v1.5.7 github.com/hashicorp/go-retryablehttp v0.7.0 + github.com/hashicorp/golang-lru v0.5.3 // indirect github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect github.com/hooklift/assert v0.0.0-20170704181755-9d1defd6d214 // indirect github.com/hooklift/iso9660 v0.0.0-20170318115843-1cf07e5970d8 diff --git a/go.sum b/go.sum index 74e1c91024..5c8449df11 100644 --- a/go.sum +++ b/go.sum @@ -200,8 +200,8 @@ github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.5.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/v2 v2.3.1 h1:QRTu0yRA4FbznjRSds0/4Hy6cVYpWV2wInlNJSHWAtw= -github.com/cloudevents/sdk-go/v2 v2.3.1/go.mod h1:4fO2UjPMYYR1/7KPJQCwTPb0lFA8zYuitkUpAZFSY1Q= +github.com/cloudevents/sdk-go/v2 v2.5.0 h1:Ts6aLHbBUJfcNcZ4ouAfJ4+Np7SE1Yf2w4ADKRCd7Fo= +github.com/cloudevents/sdk-go/v2 v2.5.0/go.mod h1:nlXhgFkf0uTopxmRXalyMwS2LG70cRGPrxzmjJgSG0U= github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:Yg2hDs4b13Evkpj42FU2idX2cVXVFqQSheXYKM86Qsk= github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:MgJyK38wkzZbiZSKeIeFankxxSA8gayko/nr5x5bgBA= github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:tuijfIjZyjZaHq9xDUh0tNitwXshJpbLkqMOJv4H3do= @@ -755,8 +755,6 @@ github.com/libopenstorage/openstorage v1.0.0/go.mod h1:Sp1sIObHjat1BeXhfMqLZ14wn github.com/libvirt/libvirt-go v3.9.0+incompatible h1:tcJOV5bCR8lWsifKnPCEnYSroD5rjuUkCBp/kv1kH/w= github.com/libvirt/libvirt-go v3.9.0+incompatible/go.mod h1:34zsnB4iGeOv7Byj6qotuW8Ya4v4Tr43ttjz/F0wjLE= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= -github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac h1:+2b6iGRJe3hvV/yVXrd41yVEjxuFHxasJqDhkIjS4gk= -github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac/go.mod h1:Frd2bnT3w5FB5q49ENTfVlztJES+1k/7lyWX2+9gq/M= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/lpabon/godbc v0.1.1/go.mod h1:Jo9QV0cf3U6jZABgiJ2skINAXb9j8m51r07g4KI92ZA= github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f/go.mod h1:JpH9J1c9oX6otFSgdUHwUBUizmKlrMjxWnIAjff4m04= @@ -877,7 +875,6 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= From 5c0177aff6e00e226e8206ccb0bca133ca4b2b1d Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Fri, 13 Aug 2021 15:26:39 -0700 Subject: [PATCH 20/53] Replace setupFailed with setupSucceeded because the Go docs lied. --- test/integration/addons_test.go | 4 ++-- test/integration/functional_test_tunnel_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index 513b78ec8f..54c6e30c18 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -46,7 +46,7 @@ func TestAddons(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) defer Cleanup(t, profile, cancel) - setupFailed := t.Run("Setup", func(t *testing.T) { + setupSucceeded := t.Run("Setup", func(t *testing.T) { // We don't need a dummy file is we're on GCE if !detect.IsOnGCE() || detect.IsCloudShell() { // Set an env var to point to our dummy credentials file @@ -105,7 +105,7 @@ func TestAddons(t *testing.T) { } }) - if setupFailed { + if !setupSucceeded { t.Fatalf("Failed setup for addon tests") } diff --git a/test/integration/functional_test_tunnel_test.go b/test/integration/functional_test_tunnel_test.go index 1d2d9c7ca5..8d7b4fcb38 100644 --- a/test/integration/functional_test_tunnel_test.go +++ b/test/integration/functional_test_tunnel_test.go @@ -136,7 +136,7 @@ func validateServiceStable(ctx context.Context, t *testing.T, profile string) { t.Skip("The test WaitService is broken on github actions in macos https://github.com/kubernetes/minikube/issues/8434") } checkRoutePassword(t) - setupFailed := t.Run("Setup", func(t *testing.T) { + setupSucceeded := t.Run("Setup", func(t *testing.T) { client, err := kapi.Client(profile) if err != nil { t.Fatalf("failed to get Kubernetes client for %q: %v", profile, err) @@ -155,7 +155,7 @@ func validateServiceStable(ctx context.Context, t *testing.T, profile string) { t.Fatal(errors.Wrap(err, "Error waiting for nginx service to be up")) } }) - if setupFailed { + if !setupSucceeded { t.Fatal("Failed setup") } From 5efcdf83ab9d60a178594dfcdd5c5bd178f30a19 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Sat, 14 Aug 2021 14:39:49 +0100 Subject: [PATCH 21/53] fix boilerplate for time-to-k8s git submodule --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 7473d2d5b9..911c762ae4 100755 --- a/test.sh +++ b/test.sh @@ -45,7 +45,7 @@ then readonly BDIR="${ROOT_DIR}/hack/boilerplate" pushd . >/dev/null cd ${BDIR} - missing="$(go run boilerplate.go -rootdir ${ROOT_DIR} -boilerplate-dir ${BDIR} | egrep -v '/assets.go|/translations.go|/site/themes/|/site/node_modules|\./out|/hugo/' || true)" + missing="$(go run boilerplate.go -rootdir ${ROOT_DIR} -boilerplate-dir ${BDIR} | egrep -v '/assets.go|/translations.go|/site/themes/|/site/node_modules|\./out|/hugo/|hack/benchmark/time-to-k8s/time-to-k8s-repo' || true)" if [[ -n "${missing}" ]]; then echo "boilerplate missing: $missing" echo "consider running: ${BDIR}/fix.sh" From f91a11192ed1b319ab476434110cc6734107e332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sat, 14 Aug 2021 20:29:15 +0200 Subject: [PATCH 22/53] Upgrade Buildroot to 2021.02 LTS with Linux 4.19 Upgrade kernel minor version to distribution default Add patch to allow building go inside minikube mod Add sysctl override to revert systemd 245+ rp_filter BR2_PACKAGE_LUAJIT Make sure to build lua required for sysdig BR2_PACKAGE_LZ4_PROGS Make sure to build lz4 required for preload BR2_PACKAGE_UTIL_LINUX_BINARIES Make sure to build lsblk required for automount --- Makefile | 6 +- ...dist-generate-stub-go.mod-in-workdir.patch | 78 +++++++++++++++++++ .../etc/sysctl.d/90-cilium-rp_filter.conf | 2 + .../minikube-iso/configs/minikube_defconfig | 8 +- 4 files changed, 88 insertions(+), 6 deletions(-) create mode 100644 deploy/iso/minikube-iso/board/coreos/minikube/patches/go/1.15.15/dist-generate-stub-go.mod-in-workdir.patch create mode 100644 deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/sysctl.d/90-cilium-rp_filter.conf diff --git a/Makefile b/Makefile index b7f4317bd7..818ffdd63b 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ KVM_GO_VERSION ?= $(GO_VERSION:.0=) INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1) -BUILDROOT_BRANCH ?= 2020.02.12 +BUILDROOT_BRANCH ?= 2021.02.4 REGISTRY ?= gcr.io/k8s-minikube # Get git commit id @@ -66,7 +66,7 @@ MINIKUBE_BUCKET ?= minikube/releases MINIKUBE_UPLOAD_LOCATION := gs://${MINIKUBE_BUCKET} MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download -KERNEL_VERSION ?= 4.19.182 +KERNEL_VERSION ?= 4.19.202 # latest from https://github.com/golangci/golangci-lint/releases # update this only by running `make update-golint-version` GOLINT_VERSION ?= v1.41.1 @@ -282,8 +282,6 @@ minikube_iso: deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/usr/b git clone --depth=1 --branch=$(BUILDROOT_BRANCH) https://github.com/buildroot/buildroot $(BUILD_DIR)/buildroot; \ fi; $(MAKE) BR2_EXTERNAL=../../deploy/iso/minikube-iso minikube_defconfig -C $(BUILD_DIR)/buildroot - mkdir -p $(BUILD_DIR)/buildroot/output/build - echo "module buildroot.org/go" > $(BUILD_DIR)/buildroot/output/build/go.mod $(MAKE) -C $(BUILD_DIR)/buildroot host-python $(MAKE) -C $(BUILD_DIR)/buildroot mv $(BUILD_DIR)/buildroot/output/images/rootfs.iso9660 $(BUILD_DIR)/minikube.iso diff --git a/deploy/iso/minikube-iso/board/coreos/minikube/patches/go/1.15.15/dist-generate-stub-go.mod-in-workdir.patch b/deploy/iso/minikube-iso/board/coreos/minikube/patches/go/1.15.15/dist-generate-stub-go.mod-in-workdir.patch new file mode 100644 index 0000000000..1cdd0b5936 --- /dev/null +++ b/deploy/iso/minikube-iso/board/coreos/minikube/patches/go/1.15.15/dist-generate-stub-go.mod-in-workdir.patch @@ -0,0 +1,78 @@ +From 2b512af2ddaae01926fdcc9056b71017cac2a8d2 Mon Sep 17 00:00:00 2001 +From: Tamir Duberstein +Date: Thu, 25 Feb 2021 16:44:46 -0500 +Subject: [PATCH] dist: generate stub go.mod in workdir + +(cherry picked from commit c6374f516206c02b905d0d76ee1a66dab6fcd212) +--- + src/cmd/dist/build.go | 26 ++++++-------------------- + 1 file changed, 6 insertions(+), 20 deletions(-) + +diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go +index 9e2b4f33b8..e5a7f9e9c4 100644 +--- a/src/cmd/dist/build.go ++++ b/src/cmd/dist/build.go +@@ -110,9 +110,6 @@ func xinit() { + fatalf("$GOROOT must be set") + } + goroot = filepath.Clean(b) +- if modRoot := findModuleRoot(goroot); modRoot != "" { +- fatalf("found go.mod file in %s: $GOROOT must not be inside a module", modRoot) +- } + + b = os.Getenv("GOROOT_FINAL") + if b == "" { +@@ -244,6 +241,9 @@ func xinit() { + os.Setenv("LANGUAGE", "en_US.UTF8") + + workdir = xworkdir() ++ if err := ioutil.WriteFile(pathf("%s/go.mod", workdir), []byte("module bootstrap"), 0666); err != nil { ++ fatalf("cannot write stub go.mod: %s", err) ++ } + xatexit(rmworkdir) + + tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) +@@ -1484,11 +1484,11 @@ func goCmd(goBinary string, cmd string, args ...string) { + goCmd = append(goCmd, "-p=1") + } + +- run(goroot, ShowOutput|CheckExit, append(goCmd, args...)...) ++ run(workdir, ShowOutput|CheckExit, append(goCmd, args...)...) + } + + func checkNotStale(goBinary string, targets ...string) { +- out := run(goroot, CheckExit, ++ out := run(workdir, CheckExit, + append([]string{ + goBinary, + "list", "-gcflags=all=" + gogcflags, "-ldflags=all=" + goldflags, +@@ -1498,7 +1498,7 @@ func checkNotStale(goBinary string, targets ...string) { + os.Setenv("GODEBUG", "gocachehash=1") + for _, target := range []string{"runtime/internal/sys", "cmd/dist", "cmd/link"} { + if strings.Contains(out, "STALE "+target) { +- run(goroot, ShowOutput|CheckExit, goBinary, "list", "-f={{.ImportPath}} {{.Stale}}", target) ++ run(workdir, ShowOutput|CheckExit, goBinary, "list", "-f={{.ImportPath}} {{.Stale}}", target) + break + } + } +@@ -1590,20 +1590,6 @@ func checkCC() { + } + } + +-func findModuleRoot(dir string) (root string) { +- for { +- if fi, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil && !fi.IsDir() { +- return dir +- } +- d := filepath.Dir(dir) +- if d == dir { +- break +- } +- dir = d +- } +- return "" +-} +- + func defaulttarg() string { + // xgetwd might return a path with symlinks fully resolved, and if + // there happens to be symlinks in goroot, then the hasprefix test diff --git a/deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/sysctl.d/90-cilium-rp_filter.conf b/deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/sysctl.d/90-cilium-rp_filter.conf new file mode 100644 index 0000000000..aa285916a5 --- /dev/null +++ b/deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/sysctl.d/90-cilium-rp_filter.conf @@ -0,0 +1,2 @@ +net.ipv4.conf.lxc*.rp_filter = 0 +net.ipv4.conf.cilium_*.rp_filter = 0 diff --git a/deploy/iso/minikube-iso/configs/minikube_defconfig b/deploy/iso/minikube-iso/configs/minikube_defconfig index dcae296ff5..9cd682c723 100644 --- a/deploy/iso/minikube-iso/configs/minikube_defconfig +++ b/deploy/iso/minikube-iso/configs/minikube_defconfig @@ -18,13 +18,12 @@ BR2_ROOTFS_USERS_TABLES="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/use BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/rootfs-overlay" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.182" +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.202" BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/linux_defconfig" BR2_LINUX_KERNEL_LZ4=y BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y BR2_PACKAGE_GZIP=y -BR2_PACKAGE_LZ4=y BR2_PACKAGE_XZ=y BR2_PACKAGE_STRACE=y BR2_PACKAGE_SYSDIG=y @@ -37,6 +36,9 @@ BR2_PACKAGE_SSHFS=y BR2_PACKAGE_XFSPROGS=y BR2_PACKAGE_PARTED=y BR2_PACKAGE_SYSSTAT=y +BR2_PACKAGE_LUAJIT=y +BR2_PACKAGE_LZ4=y +BR2_PACKAGE_LZ4_PROGS=y BR2_PACKAGE_CA_CERTIFICATES=y BR2_PACKAGE_LIBOPENSSL_BIN=y BR2_PACKAGE_LIBCURL_CURL=y @@ -58,7 +60,9 @@ BR2_PACKAGE_PSMISC=y BR2_PACKAGE_SYSTEMD_LOGIND=y BR2_PACKAGE_SYSTEMD_MACHINED=y BR2_PACKAGE_TAR=y +BR2_PACKAGE_UTIL_LINUX_BINARIES=y BR2_PACKAGE_UTIL_LINUX_LOSETUP=y +BR2_PACKAGE_UTIL_LINUX_NOLOGIN=y BR2_PACKAGE_UTIL_LINUX_NSENTER=y BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS=y BR2_TARGET_ROOTFS_CPIO_GZIP=y From d7484e41ee9f347cdc1a1774c65e034ab9734c71 Mon Sep 17 00:00:00 2001 From: minikube-bot Date: Sat, 14 Aug 2021 22:13:14 +0000 Subject: [PATCH 23/53] Updating ISO to v1.22.0-1628974786-12268 --- Makefile | 2 +- pkg/minikube/download/iso.go | 2 +- site/content/en/docs/commands/start.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 818ffdd63b..da260e6607 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ KUBERNETES_VERSION ?= $(shell egrep "DefaultKubernetesVersion =" pkg/minikube/co KIC_VERSION ?= $(shell egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f2) # Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions -ISO_VERSION ?= v1.22.0-1628622362-12032 +ISO_VERSION ?= v1.22.0-1628974786-12268 # Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta DEB_VERSION ?= $(subst -,~,$(RAW_VERSION)) DEB_REVISION ?= 0 diff --git a/pkg/minikube/download/iso.go b/pkg/minikube/download/iso.go index 79f618cc09..ca6f42fc4c 100644 --- a/pkg/minikube/download/iso.go +++ b/pkg/minikube/download/iso.go @@ -40,7 +40,7 @@ const fileScheme = "file" // DefaultISOURLs returns a list of ISO URL's to consult by default, in priority order func DefaultISOURLs() []string { v := version.GetISOVersion() - isoBucket := "minikube-builds/iso/12032" + isoBucket := "minikube-builds/iso/12268" return []string{ fmt.Sprintf("https://storage.googleapis.com/%s/minikube-%s.iso", isoBucket, v), fmt.Sprintf("https://github.com/kubernetes/minikube/releases/download/%s/minikube-%s.iso", v, v), diff --git a/site/content/en/docs/commands/start.md b/site/content/en/docs/commands/start.md index cc960f7888..a57cd14c07 100644 --- a/site/content/en/docs/commands/start.md +++ b/site/content/en/docs/commands/start.md @@ -65,7 +65,7 @@ minikube start [flags] --insecure-registry strings Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added. --install-addons If set, install addons. Defaults to true. (default true) --interactive Allow user prompts for more information (default true) - --iso-url strings Locations to fetch the minikube ISO from. (default [https://storage.googleapis.com/minikube-builds/iso/12032/minikube-v1.22.0-1628622362-12032.iso,https://github.com/kubernetes/minikube/releases/download/v1.22.0-1628622362-12032/minikube-v1.22.0-1628622362-12032.iso,https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.22.0-1628622362-12032.iso]) + --iso-url strings Locations to fetch the minikube ISO from. (default [https://storage.googleapis.com/minikube-builds/iso/12268/minikube-v1.22.0-1628974786-12268.iso,https://github.com/kubernetes/minikube/releases/download/v1.22.0-1628974786-12268/minikube-v1.22.0-1628974786-12268.iso,https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.22.0-1628974786-12268.iso]) --keep-context This will keep the existing kubectl context and will create a minikube context. --kubernetes-version string The Kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for v1.21.3, 'latest' for v1.22.0-rc.0). Defaults to 'stable'. --kvm-gpu Enable experimental NVIDIA GPU support in minikube From b85c4fe0fcec6d00161b49ecbfd8182c89122b1a Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Mon, 16 Aug 2021 14:24:48 -0700 Subject: [PATCH 24/53] common calico func --- pkg/minikube/bootstrapper/images/images.go | 29 ++++++++++------------ 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/pkg/minikube/bootstrapper/images/images.go b/pkg/minikube/bootstrapper/images/images.go index 319983e7f9..8c7de8ef64 100644 --- a/pkg/minikube/bootstrapper/images/images.go +++ b/pkg/minikube/bootstrapper/images/images.go @@ -165,35 +165,32 @@ func KindNet(repo string) string { // all calico images are from https://docs.projectcalico.org/manifests/calico.yaml const calicoVersion = "v3.20.0" +const calicoRepo = "docker.io/calico" // CalicoDaemonSet returns the image used for calicoDaemonSet func CalicoDaemonSet(repo string) string { - if repo == "" { - repo = "docker.io/calico" - } - return path.Join(repo, "node:"+calicoVersion) + return calicoCommon(repo, "node") + } // CalicoDeployment returns the image used for calicoDeployment func CalicoDeployment(repo string) string { - if repo == "" { - repo = "docker.io/calico" - } - return path.Join(repo, "kube-controllers:"+calicoVersion) + return calicoCommon(repo, "kube-controllers") } // CalicoFelixDriver returns image used for felix driver func CalicoFelixDriver(repo string) string { - if repo == "" { - repo = "docker.io/calico" - } - return path.Join(repo, "pod2daemon-flexvol:"+calicoVersion) + return calicoCommon(repo, "pod2daemon-flexvol") } // CalicoBin returns image used for calico binary image func CalicoBin(repo string) string { - if repo == "" { - repo = "docker.io/calico" - } - return path.Join(repo, "cni:"+calicoVersion) + return calicoCommon(repo, "cni") +} + +func calicoCommon(repo string, name string) string { + if repo == "" { + repo = calicoRepo + } + return path.Join(repo, fmt.Sprintf("%s:%s", name, calicoVersion)) } From 0167da64358170ccce41cd2bdacb6df6b73985f2 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Mon, 16 Aug 2021 15:50:33 -0700 Subject: [PATCH 25/53] add solution message for cgroup related issues on cloud shell-like environments --- pkg/minikube/reason/known_issues.go | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/pkg/minikube/reason/known_issues.go b/pkg/minikube/reason/known_issues.go index 41bfe18d98..c310f5e9af 100644 --- a/pkg/minikube/reason/known_issues.go +++ b/pkg/minikube/reason/known_issues.go @@ -175,6 +175,37 @@ var hostIssues = []match{ }, Regexp: re(`Container.*is not running.*chown docker:docker`), }, + { + Kind: Kind{ + ID: "HOST_CGROUP_NOT_SUPPORTED", + ExitCode: ExHostUnsupported, + Advice: `CGroup allocation is not available in your environment, You are possibly running minikube in a nested container, try run with these options: + + minikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable="" + + + `, + Issues: []int{12232}, + }, + Regexp: re(`Failed to start ContainerManager" err="Unit kubepods.slice already exists.`), + GOOS: []string{"linux"}, + }, + { + Kind: Kind{ + ID: "HOST_ROOT_CGROUP", + ExitCode: ExHostUnsupported, + Advice: `CGroup allocation is not available in your environment, You are possibly running minikube in a nested container, try run with these options: + + minikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable="" + + + `, + Issues: []int{12232}, + }, + Regexp: re(`Failed to start ContainerManager" err="failed to initialize top level QOS containers: root container [kubepods] doesn't exist`), + GOOS: []string{"linux"}, + }, + { Kind: Kind{ ID: "HOST_PIDS_CGROUP", From 30d55ca7f2dc2412500095fcb7433cb832979696 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Mon, 16 Aug 2021 16:06:28 -0700 Subject: [PATCH 26/53] Update pkg/minikube/reason/known_issues.go Co-authored-by: Sharif Elgamal --- pkg/minikube/reason/known_issues.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/reason/known_issues.go b/pkg/minikube/reason/known_issues.go index c310f5e9af..8e8f70b778 100644 --- a/pkg/minikube/reason/known_issues.go +++ b/pkg/minikube/reason/known_issues.go @@ -179,7 +179,7 @@ var hostIssues = []match{ Kind: Kind{ ID: "HOST_CGROUP_NOT_SUPPORTED", ExitCode: ExHostUnsupported, - Advice: `CGroup allocation is not available in your environment, You are possibly running minikube in a nested container, try run with these options: + Advice: `CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running: minikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable="" From e0e890f7ae42e7411cbdd889bd42dc0d67a65347 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Mon, 16 Aug 2021 16:08:58 -0700 Subject: [PATCH 27/53] update --- pkg/minikube/reason/known_issues.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/reason/known_issues.go b/pkg/minikube/reason/known_issues.go index 8e8f70b778..4df8f740f7 100644 --- a/pkg/minikube/reason/known_issues.go +++ b/pkg/minikube/reason/known_issues.go @@ -194,7 +194,7 @@ var hostIssues = []match{ Kind: Kind{ ID: "HOST_ROOT_CGROUP", ExitCode: ExHostUnsupported, - Advice: `CGroup allocation is not available in your environment, You are possibly running minikube in a nested container, try run with these options: + Advice: `CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running: minikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable="" From f94f9b8dd216decd4120e1a35cf7b157f6c0a49c Mon Sep 17 00:00:00 2001 From: minikube-bot Date: Mon, 16 Aug 2021 23:11:37 +0000 Subject: [PATCH 28/53] Update auto-generated docs and translations --- translations/de.json | 2 ++ translations/es.json | 2 ++ translations/fr.json | 2 ++ translations/ja.json | 2 ++ translations/ko.json | 2 ++ translations/pl.json | 2 ++ translations/strings.txt | 2 ++ translations/zh-CN.json | 2 ++ 8 files changed, 16 insertions(+) diff --git a/translations/de.json b/translations/de.json index 7939370b14..c3840a59d1 100644 --- a/translations/de.json +++ b/translations/de.json @@ -68,6 +68,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "", "Build a container image, using the container runtime.": "", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "", "Cache image from remote registry": "", diff --git a/translations/es.json b/translations/es.json index db2a072f24..e9ddccf717 100644 --- a/translations/es.json +++ b/translations/es.json @@ -69,6 +69,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "", "Build a container image, using the container runtime.": "", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "Plug-in CNI para usar. Opciones validas: auto, bridge, calico, cilium, flannel, kindnet, o ruta a un manifiesto CNI (Por defecto: auto)", "Cache image from docker daemon": "", "Cache image from remote registry": "", diff --git a/translations/fr.json b/translations/fr.json index 82ccf25555..74552a86ac 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -70,6 +70,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "Le pont CNI est incompatible avec les clusters multi-nœuds, utilisez un autre CNI", "Build a container image in minikube": "Construire une image de conteneur dans minikube", "Build a container image, using the container runtime.": "Construire une image de conteneur à l'aide de l'environnement d'exécution du conteneur.", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "Plug-in CNI à utiliser. Options valides : auto, bridge, calico, cilium, flannel, kindnet ou chemin vers un manifeste CNI (par défaut : auto)", "Cache image from docker daemon": "Cacher l'image du démon docker", "Cache image from remote registry": "Cacher l'image du registre distant", diff --git a/translations/ja.json b/translations/ja.json index 1647f09dfc..c65e7a18d5 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -68,6 +68,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "", "Build a container image, using the container runtime.": "", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "", "Cache image from remote registry": "", diff --git a/translations/ko.json b/translations/ko.json index ca9c9a9995..42c0c950e3 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -73,6 +73,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "minikube 내 컨테이너 이미지를 빌드합니다", "Build a container image, using the container runtime.": "컨테이너 런타임을 사용하여 컨테이너 이미지를 빌드합니다.", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "도커 데몬의 캐시 이미지", "Cache image from remote registry": "원격 레지스트리의 캐시 이미지", diff --git a/translations/pl.json b/translations/pl.json index fe3f2b9ee8..8dc41f784b 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -70,6 +70,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "Zbuduj obraz kontenera w minikube", "Build a container image, using the container runtime.": "Zbuduj obraz kontenera używając środowiska uruchomieniowego kontenera", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "", "Cache image from remote registry": "", diff --git a/translations/strings.txt b/translations/strings.txt index 9dfd494451..a1d230cbd6 100644 --- a/translations/strings.txt +++ b/translations/strings.txt @@ -64,6 +64,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "", "Build a container image, using the container runtime.": "", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "", "Cache image from remote registry": "", diff --git a/translations/zh-CN.json b/translations/zh-CN.json index a62527de4b..67988fff6c 100644 --- a/translations/zh-CN.json +++ b/translations/zh-CN.json @@ -84,6 +84,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "", "Build a container image, using the container runtime.": "", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "", "Cache image from remote registry": "", From aa90cfb57ff21741958c8899d3660c88c29eff8b Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Mon, 16 Aug 2021 16:19:47 -0700 Subject: [PATCH 29/53] Replace Math.min with destructuring with custom array min. --- hack/jenkins/test-flake-chart/flake_chart.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hack/jenkins/test-flake-chart/flake_chart.js b/hack/jenkins/test-flake-chart/flake_chart.js index 494d9aee72..330caa7b09 100644 --- a/hack/jenkins/test-flake-chart/flake_chart.js +++ b/hack/jenkins/test-flake-chart/flake_chart.js @@ -158,6 +158,14 @@ async function loadTestData() { return [testData, responseDate]; } +Array.prototype.min = function() { + return this.reduce((acc, val) => Math.min(acc, val), Number.MAX_VALUE) +} + +Array.prototype.max = function() { + return this.reduce((acc, val) => Math.max(acc, val), -Number.MAX_VALUE) +} + Array.prototype.sum = function() { return this.reduce((sum, value) => sum + value, 0); }; @@ -297,8 +305,8 @@ function displayTestAndEnvironmentChart(testData, testName, environmentName) { } { const dates = testRuns.map(run => run.date.getTime()); - const startDate = new Date(Math.min(...dates)); - const endDate = new Date(Math.max(...dates)); + const startDate = new Date(dates.min()); + const endDate = new Date(dates.max()); const weekDates = []; let currentDate = startDate; @@ -502,8 +510,8 @@ function displayEnvironmentChart(testData, environmentName) { } { const dates = testData.map(run => run.date.getTime()); - const startDate = new Date(Math.min(...dates)); - const endDate = new Date(Math.max(...dates)); + const startDate = new Date(dates.min()); + const endDate = new Date(dates.max()); const weekDates = []; let currentDate = startDate; From 9ddf82aa2fefe6a870761f5f6cd9c303fba1e0c3 Mon Sep 17 00:00:00 2001 From: minikube-bot Date: Mon, 16 Aug 2021 23:27:35 +0000 Subject: [PATCH 30/53] Update auto-generated docs and translations --- translations/de.json | 2 ++ translations/es.json | 2 ++ translations/fr.json | 2 ++ translations/ja.json | 2 ++ translations/ko.json | 2 ++ translations/pl.json | 2 ++ translations/strings.txt | 2 ++ translations/zh-CN.json | 2 ++ 8 files changed, 16 insertions(+) diff --git a/translations/de.json b/translations/de.json index 7939370b14..c3840a59d1 100644 --- a/translations/de.json +++ b/translations/de.json @@ -68,6 +68,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "", "Build a container image, using the container runtime.": "", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "", "Cache image from remote registry": "", diff --git a/translations/es.json b/translations/es.json index db2a072f24..e9ddccf717 100644 --- a/translations/es.json +++ b/translations/es.json @@ -69,6 +69,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "", "Build a container image, using the container runtime.": "", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "Plug-in CNI para usar. Opciones validas: auto, bridge, calico, cilium, flannel, kindnet, o ruta a un manifiesto CNI (Por defecto: auto)", "Cache image from docker daemon": "", "Cache image from remote registry": "", diff --git a/translations/fr.json b/translations/fr.json index 82ccf25555..74552a86ac 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -70,6 +70,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "Le pont CNI est incompatible avec les clusters multi-nœuds, utilisez un autre CNI", "Build a container image in minikube": "Construire une image de conteneur dans minikube", "Build a container image, using the container runtime.": "Construire une image de conteneur à l'aide de l'environnement d'exécution du conteneur.", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "Plug-in CNI à utiliser. Options valides : auto, bridge, calico, cilium, flannel, kindnet ou chemin vers un manifeste CNI (par défaut : auto)", "Cache image from docker daemon": "Cacher l'image du démon docker", "Cache image from remote registry": "Cacher l'image du registre distant", diff --git a/translations/ja.json b/translations/ja.json index 1647f09dfc..c65e7a18d5 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -68,6 +68,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "", "Build a container image, using the container runtime.": "", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "", "Cache image from remote registry": "", diff --git a/translations/ko.json b/translations/ko.json index ca9c9a9995..42c0c950e3 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -73,6 +73,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "minikube 내 컨테이너 이미지를 빌드합니다", "Build a container image, using the container runtime.": "컨테이너 런타임을 사용하여 컨테이너 이미지를 빌드합니다.", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "도커 데몬의 캐시 이미지", "Cache image from remote registry": "원격 레지스트리의 캐시 이미지", diff --git a/translations/pl.json b/translations/pl.json index fe3f2b9ee8..8dc41f784b 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -70,6 +70,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "Zbuduj obraz kontenera w minikube", "Build a container image, using the container runtime.": "Zbuduj obraz kontenera używając środowiska uruchomieniowego kontenera", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "", "Cache image from remote registry": "", diff --git a/translations/strings.txt b/translations/strings.txt index 9dfd494451..a1d230cbd6 100644 --- a/translations/strings.txt +++ b/translations/strings.txt @@ -64,6 +64,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "", "Build a container image, using the container runtime.": "", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "", "Cache image from remote registry": "", diff --git a/translations/zh-CN.json b/translations/zh-CN.json index a62527de4b..67988fff6c 100644 --- a/translations/zh-CN.json +++ b/translations/zh-CN.json @@ -84,6 +84,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "", "Build a container image in minikube": "", "Build a container image, using the container runtime.": "", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "", "Cache image from docker daemon": "", "Cache image from remote registry": "", From def3f067a8ee2ea74817e117dc7420e44f1fba49 Mon Sep 17 00:00:00 2001 From: Jack Zhang Date: Sun, 1 Aug 2021 19:23:39 +0800 Subject: [PATCH 31/53] Support Ingress on MacOS, driver docker --- cmd/minikube/cmd/tunnel.go | 2 +- pkg/addons/addons.go | 10 +---- pkg/minikube/out/out.go | 2 +- pkg/minikube/tunnel/kic/ssh_conn.go | 20 ++++----- pkg/minikube/tunnel/kic/ssh_tunnel.go | 58 ++++++++++++++++++++++++++- test/integration/addons_test.go | 5 +-- 6 files changed, 71 insertions(+), 26 deletions(-) diff --git a/cmd/minikube/cmd/tunnel.go b/cmd/minikube/cmd/tunnel.go index ffdd6cd8fb..8986a89f33 100644 --- a/cmd/minikube/cmd/tunnel.go +++ b/cmd/minikube/cmd/tunnel.go @@ -86,7 +86,7 @@ var tunnelCmd = &cobra.Command{ sshPort := strconv.Itoa(port) sshKey := filepath.Join(localpath.MiniPath(), "machines", cname, "id_rsa") - kicSSHTunnel := kic.NewSSHTunnel(ctx, sshPort, sshKey, clientset.CoreV1()) + kicSSHTunnel := kic.NewSSHTunnel(ctx, sshPort, sshKey, clientset.CoreV1(), clientset.NetworkingV1()) err = kicSSHTunnel.Start() if err != nil { exit.Error(reason.SvcTunnelStart, "error starting tunnel", err) diff --git a/pkg/addons/addons.go b/pkg/addons/addons.go index 6a00bb5423..ab39192932 100644 --- a/pkg/addons/addons.go +++ b/pkg/addons/addons.go @@ -153,16 +153,8 @@ func EnableOrDisableAddon(cc *config.ClusterConfig, name string, val string) err // to match both ingress and ingress-dns addons if strings.HasPrefix(name, "ingress") && enable { if driver.IsKIC(cc.Driver) { - if runtime.GOOS == "windows" { + if runtime.GOOS == "windows" || runtime.GOOS == "darwin" { out.Styled(style.Tip, `After the addon is enabled, please run "minikube tunnel" and your ingress resources would be available at "127.0.0.1"`) - } else if runtime.GOOS != "linux" { - exit.Message(reason.Usage, `Due to networking limitations of driver {{.driver_name}} on {{.os_name}}, {{.addon_name}} addon is not supported. -Alternatively to use this addon you can use a vm-based driver: - - 'minikube start --vm=true' - -To track the update on this work in progress feature please check: -https://github.com/kubernetes/minikube/issues/7332`, out.V{"driver_name": cc.Driver, "os_name": runtime.GOOS, "addon_name": name}) } else if driver.BareMetal(cc.Driver) { out.WarningT(`Due to networking limitations of driver {{.driver_name}}, {{.addon_name}} addon is not fully supported. Try using a different driver.`, out.V{"driver_name": cc.Driver, "addon_name": name}) diff --git a/pkg/minikube/out/out.go b/pkg/minikube/out/out.go index 738864c068..4706f9a706 100644 --- a/pkg/minikube/out/out.go +++ b/pkg/minikube/out/out.go @@ -118,7 +118,7 @@ func Styled(st style.Enum, format string, a ...V) { func boxedCommon(printFunc func(format string, a ...interface{}), cfg box.Config, title string, format string, a ...V) { box := box.New(cfg) if !useColor { - box.Config.Color = "" + box.Config.Color = nil } str := Sprintf(style.None, format, a...) printFunc(box.String(title, strings.TrimSpace(str))) diff --git a/pkg/minikube/tunnel/kic/ssh_conn.go b/pkg/minikube/tunnel/kic/ssh_conn.go index 35b1abac02..2dc1c21310 100644 --- a/pkg/minikube/tunnel/kic/ssh_conn.go +++ b/pkg/minikube/tunnel/kic/ssh_conn.go @@ -36,7 +36,7 @@ type sshConn struct { activeConn bool } -func createSSHConn(name, sshPort, sshKey string, svc *v1.Service) *sshConn { +func createSSHConn(name, sshPort, sshKey string, resourcePorts []int32, resourceIP string, resourceName string) *sshConn { // extract sshArgs sshArgs := []string{ // TODO: document the options here @@ -50,17 +50,17 @@ func createSSHConn(name, sshPort, sshKey string, svc *v1.Service) *sshConn { askForSudo := false var privilegedPorts []int32 - for _, port := range svc.Spec.Ports { + for _, port := range resourcePorts { arg := fmt.Sprintf( "-L %d:%s:%d", - port.Port, - svc.Spec.ClusterIP, - port.Port, + port, + resourceIP, + port, ) // check if any port is privileged - if port.Port < 1024 { - privilegedPorts = append(privilegedPorts, port.Port) + if port < 1024 { + privilegedPorts = append(privilegedPorts, port) askForSudo = true } @@ -71,8 +71,8 @@ func createSSHConn(name, sshPort, sshKey string, svc *v1.Service) *sshConn { if askForSudo && runtime.GOOS != "windows" { out.Styled( style.Warning, - "The service {{.service}} requires privileged ports to be exposed: {{.ports}}", - out.V{"service": svc.Name, "ports": fmt.Sprintf("%v", privilegedPorts)}, + "The service/ingress {{.resource}} requires privileged ports to be exposed: {{.ports}}", + out.V{"resource": resourceName, "ports": fmt.Sprintf("%v", privilegedPorts)}, ) out.Styled(style.Permissions, "sudo permission will be asked for it.") @@ -89,7 +89,7 @@ func createSSHConn(name, sshPort, sshKey string, svc *v1.Service) *sshConn { return &sshConn{ name: name, - service: svc.Name, + service: resourceName, cmd: cmd, activeConn: false, } diff --git a/pkg/minikube/tunnel/kic/ssh_tunnel.go b/pkg/minikube/tunnel/kic/ssh_tunnel.go index 9fcd6446a2..dafa3f94a9 100644 --- a/pkg/minikube/tunnel/kic/ssh_tunnel.go +++ b/pkg/minikube/tunnel/kic/ssh_tunnel.go @@ -23,8 +23,10 @@ import ( "time" v1 "k8s.io/api/core/v1" + v1_networking "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" typed_core "k8s.io/client-go/kubernetes/typed/core/v1" + typed_networking "k8s.io/client-go/kubernetes/typed/networking/v1" "k8s.io/klog/v2" "k8s.io/minikube/pkg/minikube/tunnel" @@ -36,19 +38,21 @@ type SSHTunnel struct { sshPort string sshKey string v1Core typed_core.CoreV1Interface + v1Networking typed_networking.NetworkingV1Interface LoadBalancerEmulator tunnel.LoadBalancerEmulator conns map[string]*sshConn connsToStop map[string]*sshConn } // NewSSHTunnel ... -func NewSSHTunnel(ctx context.Context, sshPort, sshKey string, v1Core typed_core.CoreV1Interface) *SSHTunnel { +func NewSSHTunnel(ctx context.Context, sshPort, sshKey string, v1Core typed_core.CoreV1Interface, v1Networking typed_networking.NetworkingV1Interface) *SSHTunnel { return &SSHTunnel{ ctx: ctx, sshPort: sshPort, sshKey: sshKey, v1Core: v1Core, LoadBalancerEmulator: tunnel.NewLoadBalancerEmulator(v1Core), + v1Networking: v1Networking, conns: make(map[string]*sshConn), connsToStop: make(map[string]*sshConn), } @@ -73,6 +77,11 @@ func (t *SSHTunnel) Start() error { klog.Errorf("error listing services: %v", err) } + ingresses, err := t.v1Networking.Ingresses("").List(context.Background(), metav1.ListOptions{}) + if err != nil { + klog.Errorf("error listing ingresses: %v", err) + } + t.markConnectionsToBeStopped() for _, svc := range services.Items { @@ -81,6 +90,10 @@ func (t *SSHTunnel) Start() error { } } + for _, ingress := range ingresses.Items { + t.startConnectionIngress(ingress) + } + t.stopMarkedConnections() // TODO: which time to use? @@ -104,8 +117,14 @@ func (t *SSHTunnel) startConnection(svc v1.Service) { return } + resourcePorts := []int32{} + + for _, port := range svc.Spec.Ports { + resourcePorts = append(resourcePorts, port.Port) + } + // create new ssh conn - newSSHConn := createSSHConn(uniqName, t.sshPort, t.sshKey, &svc) + newSSHConn := createSSHConn(uniqName, t.sshPort, t.sshKey, resourcePorts, svc.Spec.ClusterIP, svc.Name) t.conns[newSSHConn.name] = newSSHConn go func() { @@ -121,6 +140,31 @@ func (t *SSHTunnel) startConnection(svc v1.Service) { } } +func (t *SSHTunnel) startConnectionIngress(ingress v1_networking.Ingress) { + uniqName := sshConnUniqNameIngress(ingress) + existingSSHConn, ok := t.conns[uniqName] + + if ok { + // if the svc still exist we remove the conn from the stopping list + delete(t.connsToStop, existingSSHConn.name) + return + } + + resourcePorts := []int32{80, 443} + resourceIP := "127.0.0.1" + + // create new ssh conn + newSSHConn := createSSHConn(uniqName, t.sshPort, t.sshKey, resourcePorts, resourceIP, ingress.Name) + t.conns[newSSHConn.name] = newSSHConn + + go func() { + err := newSSHConn.startAndWait() + if err != nil { + klog.Errorf("error starting ssh tunnel: %v", err) + } + }() +} + func (t *SSHTunnel) stopActiveConnections() { for _, conn := range t.conns { err := conn.stop() @@ -157,3 +201,13 @@ func sshConnUniqName(service v1.Service) string { return strings.Join(n, "") } + +func sshConnUniqNameIngress(ingress v1_networking.Ingress) string { + n := []string{ingress.Name} + + for _, rule := range ingress.Spec.Rules { + n = append(n, rule.Host) + } + + return strings.Join(n, "") +} diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index 1d3115d229..62dfd5339c 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -29,7 +29,6 @@ import ( "os/exec" "path/filepath" "reflect" - "runtime" "strings" "testing" "time" @@ -68,7 +67,7 @@ func TestAddons(t *testing.T) { } args := append([]string{"start", "-p", profile, "--wait=true", "--memory=4000", "--alsologtostderr", "--addons=registry", "--addons=metrics-server", "--addons=olm", "--addons=volumesnapshots", "--addons=csi-hostpath-driver"}, StartArgs()...) - if !NoneDriver() && !(runtime.GOOS == "darwin" && KicDriver()) { // none driver and macos docker driver does not support ingress + if !NoneDriver() { // none driver does not support ingress args = append(args, "--addons=ingress") } if !arm64Platform() { @@ -155,7 +154,7 @@ func TestAddons(t *testing.T) { // validateIngressAddon tests the ingress addon by deploying a default nginx pod func validateIngressAddon(ctx context.Context, t *testing.T, profile string) { defer PostMortemLogs(t, profile) - if NoneDriver() || (runtime.GOOS == "darwin" && KicDriver()) { + if NoneDriver() { t.Skipf("skipping: ingress not supported ") } From 7e3d874265afbe7c12326d43034e9c83a78387fd Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Tue, 17 Aug 2021 09:37:52 -0700 Subject: [PATCH 32/53] Display date in a better format, since old format reported time of 0:00 am --- hack/jenkins/test-flake-chart/flake_chart.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hack/jenkins/test-flake-chart/flake_chart.js b/hack/jenkins/test-flake-chart/flake_chart.js index 330caa7b09..f044e9fe10 100644 --- a/hack/jenkins/test-flake-chart/flake_chart.js +++ b/hack/jenkins/test-flake-chart/flake_chart.js @@ -264,14 +264,14 @@ function displayTestAndEnvironmentChart(testData, testName, environmentName) { groupData.date, groupData.flakeRate, `
- ${groupData.date.toString()}
+ Date: ${groupData.date.toLocaleString([], {dateStyle: 'medium'})}
Flake Percentage: ${groupData.flakeRate.toFixed(2)}%
Jobs:
${groupData.jobs.map(({ id, status }) => ` - ${id} (${status})`).join("
")}
`, groupData.duration, `
- ${groupData.date.toString()}
+ Date: ${groupData.date.toLocaleString([], {dateStyle: 'medium'})}
Average Duration: ${groupData.duration.toFixed(2)}s
Jobs:
${groupData.jobs.map(({ id, duration }) => ` - ${id} (${duration}s)`).join("
")} @@ -340,14 +340,14 @@ function displayTestAndEnvironmentChart(testData, testName, environmentName) { groupData.date, groupData.flakeRate, `
- ${groupData.date.toString()}
+ Date: ${groupData.date.toLocaleString([], {dateStyle: 'medium'})}
Flake Percentage: ${groupData.flakeRate.toFixed(2)}%
Jobs:
${groupData.jobs.map(({ id, status }) => ` - ${id} (${status})`).join("
")}
`, groupData.duration, `
- ${groupData.date.toString()}
+ Date: ${groupData.date.toLocaleString([], {dateStyle: 'medium'})}
Average Duration: ${groupData.duration.toFixed(2)}s
Jobs:
${groupData.jobs.map(({ id, duration }) => ` - ${id} (${duration}s)`).join("
")} @@ -482,7 +482,7 @@ function displayEnvironmentChart(testData, environmentName) { data.flakeRate, `
${name}
- ${data.date.toString()}
+ Date: ${data.date.toLocaleString([], {dateStyle: 'medium'})}
Flake Percentage: ${data.flakeRate.toFixed(2)}%
Jobs:
${data.jobs.map(({ id, status }) => ` - ${id} (${status})`).join("
")} @@ -559,7 +559,7 @@ function displayEnvironmentChart(testData, environmentName) { data.flakeRate, `
${name}
- ${data.date.toString()}
+ Date: ${data.date.toLocaleString([], {dateStyle: 'medium'})}
Flake Percentage: ${data.flakeRate.toFixed(2)}%
Jobs:
${data.jobs.map(({ id, status }) => ` - ${id} (${status})`).join("
")} @@ -619,14 +619,14 @@ function displayEnvironmentChart(testData, environmentName) { dateInfo.date, dateInfo.testCount, `
- ${dateInfo.date.toString()}
+ Date: ${dateInfo.date.toLocaleString([], {dateStyle: 'medium'})}
Test Count (averaged): ${+dateInfo.testCount.toFixed(2)}
Jobs:
${dateInfo.runInfo.map(job => ` - ${job.rootJob} Test count: ${job.testCount}`).join("
")}
`, dateInfo.totalDuration, `
- ${dateInfo.date.toString()}
+ Date: ${dateInfo.date.toLocaleString([], {dateStyle: 'medium'})}
Total Duration (averaged): ${+dateInfo.totalDuration.toFixed(2)}
Jobs:
${dateInfo.runInfo.map(job => ` - ${job.rootJob} Total Duration: ${+job.totalDuration.toFixed(2)}s`).join("
")} From eebbad09780bb812043b7f43319e01b1f3060919 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Tue, 17 Aug 2021 14:06:52 -0700 Subject: [PATCH 33/53] fix unit tests by comparing json structs --- pkg/minikube/out/out_reason_test.go | 21 +++++++--- pkg/minikube/out/register/json_test.go | 47 +++++++++++++--------- pkg/minikube/out/register/register_test.go | 7 ++-- 3 files changed, 48 insertions(+), 27 deletions(-) diff --git a/pkg/minikube/out/out_reason_test.go b/pkg/minikube/out/out_reason_test.go index 1a327d3a7c..33d47e6a60 100644 --- a/pkg/minikube/out/out_reason_test.go +++ b/pkg/minikube/out/out_reason_test.go @@ -18,7 +18,9 @@ package out import ( "bytes" + "encoding/json" "os" + "reflect" "strings" "testing" @@ -86,7 +88,7 @@ func TestDisplayProblem(t *testing.T) { } } -func TestDisplayJSON(t *testing.T) { +func TestDisplayProblemJSON(t *testing.T) { defer SetJSON(false) SetJSON(true) @@ -96,7 +98,6 @@ func TestDisplayJSON(t *testing.T) { }{ { k: &reason.Kind{ - ID: "BUG", ExitCode: 4, Advice: "fix me!", @@ -117,10 +118,20 @@ func TestDisplayJSON(t *testing.T) { return "random-id" } - JSON = true Error(*tc.k, "my error") - actual := buf.String() - if actual != tc.expected { + actual := buf.Bytes() + + var actualJSON struct{} + var expectedJSON struct{} + err := json.Unmarshal(actual, &actualJSON) + if err != nil { + t.Fatalf("error unmarshalling actual: %v", err) + } + err = json.Unmarshal([]byte(tc.expected), &expectedJSON) + if err != nil { + t.Fatalf("error unmarshalling expected: %v", err) + } + if !reflect.DeepEqual(expectedJSON, actualJSON) { t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", tc.expected, actual) } }) diff --git a/pkg/minikube/out/register/json_test.go b/pkg/minikube/out/register/json_test.go index c1fb1c55ee..e48e1fd564 100644 --- a/pkg/minikube/out/register/json_test.go +++ b/pkg/minikube/out/register/json_test.go @@ -18,8 +18,10 @@ package register import ( "bytes" + "encoding/json" "fmt" "os" + "reflect" "testing" ) @@ -39,11 +41,9 @@ func TestPrintStep(t *testing.T) { } PrintStep("message") - actual := buf.String() + actual := buf.Bytes() - if actual != expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) - } + CompareJSON(t, actual, []byte(expected)) } func TestPrintInfo(t *testing.T) { @@ -59,11 +59,10 @@ func TestPrintInfo(t *testing.T) { } PrintInfo("info") - actual := buf.String() + actual := buf.Bytes() + + CompareJSON(t, actual, []byte(expected)) - if actual != expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) - } } func TestError(t *testing.T) { @@ -79,11 +78,9 @@ func TestError(t *testing.T) { } PrintError("error") - actual := buf.String() + actual := buf.Bytes() - if actual != expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) - } + CompareJSON(t, actual, []byte(expected)) } func TestErrorExitCode(t *testing.T) { @@ -99,10 +96,9 @@ func TestErrorExitCode(t *testing.T) { } PrintErrorExitCode("error", 5, map[string]string{"a": "b"}, map[string]string{"c": "d"}) - actual := buf.String() - if actual != expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) - } + actual := buf.Bytes() + + CompareJSON(t, actual, []byte(expected)) } func TestWarning(t *testing.T) { @@ -118,9 +114,24 @@ func TestWarning(t *testing.T) { } PrintWarning("warning") - actual := buf.String() + actual := buf.Bytes() - if actual != expected { + CompareJSON(t, actual, []byte(expected)) +} + +// CompareJSON compares the structs of actual and expected instead of just the strings +func CompareJSON(t *testing.T, actual []byte, expected []byte) { + var actualJSON struct{} + var expectedJSON struct{} + err := json.Unmarshal(actual, &actualJSON) + if err != nil { + t.Fatalf("error unmarshalling actual: %v", err) + } + err = json.Unmarshal(expected, &expectedJSON) + if err != nil { + t.Fatalf("error unmarshalling expected: %v", err) + } + if !reflect.DeepEqual(expectedJSON, actualJSON) { t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) } } diff --git a/pkg/minikube/out/register/register_test.go b/pkg/minikube/out/register/register_test.go index e9b5a74c7f..9c831e8e58 100644 --- a/pkg/minikube/out/register/register_test.go +++ b/pkg/minikube/out/register/register_test.go @@ -42,9 +42,8 @@ func TestSetCurrentStep(t *testing.T) { } PrintStep("message") - actual := buf.String() + actual := buf.Bytes() - if actual != expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) - } + // Unmarshal both strings to JSON and compare the structs + CompareJSON(t, actual, []byte(expected)) } From 5c2f2c888f33afcc00f0d4f248a1eaa82480e085 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Thu, 19 Aug 2021 16:13:12 -0700 Subject: [PATCH 34/53] fix unit tests by comparing JSON structs --- pkg/minikube/out/out_reason_test.go | 12 +++--- pkg/minikube/out/register/json_test.go | 33 ++++++-------- pkg/minikube/out/register/register_test.go | 8 ++-- pkg/minikube/tests/json_utils.go | 50 ++++++++++++++++++++++ 4 files changed, 72 insertions(+), 31 deletions(-) create mode 100644 pkg/minikube/tests/json_utils.go diff --git a/pkg/minikube/out/out_reason_test.go b/pkg/minikube/out/out_reason_test.go index 1a327d3a7c..8467961fd4 100644 --- a/pkg/minikube/out/out_reason_test.go +++ b/pkg/minikube/out/out_reason_test.go @@ -24,6 +24,7 @@ import ( "k8s.io/minikube/pkg/minikube/out/register" "k8s.io/minikube/pkg/minikube/reason" + "k8s.io/minikube/pkg/minikube/tests" ) type buffFd struct { @@ -86,7 +87,7 @@ func TestDisplayProblem(t *testing.T) { } } -func TestDisplayJSON(t *testing.T) { +func TestDisplayProblemJSON(t *testing.T) { defer SetJSON(false) SetJSON(true) @@ -96,7 +97,6 @@ func TestDisplayJSON(t *testing.T) { }{ { k: &reason.Kind{ - ID: "BUG", ExitCode: 4, Advice: "fix me!", @@ -117,12 +117,10 @@ func TestDisplayJSON(t *testing.T) { return "random-id" } - JSON = true Error(*tc.k, "my error") - actual := buf.String() - if actual != tc.expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", tc.expected, actual) - } + actual := buf.Bytes() + + tests.CompareJSON(t, actual, []byte(tc.expected)) }) } } diff --git a/pkg/minikube/out/register/json_test.go b/pkg/minikube/out/register/json_test.go index c1fb1c55ee..738906673d 100644 --- a/pkg/minikube/out/register/json_test.go +++ b/pkg/minikube/out/register/json_test.go @@ -21,6 +21,8 @@ import ( "fmt" "os" "testing" + + "k8s.io/minikube/pkg/minikube/tests" ) func TestPrintStep(t *testing.T) { @@ -39,11 +41,9 @@ func TestPrintStep(t *testing.T) { } PrintStep("message") - actual := buf.String() + actual := buf.Bytes() - if actual != expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) - } + tests.CompareJSON(t, actual, []byte(expected)) } func TestPrintInfo(t *testing.T) { @@ -59,11 +59,9 @@ func TestPrintInfo(t *testing.T) { } PrintInfo("info") - actual := buf.String() + actual := buf.Bytes() - if actual != expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) - } + tests.CompareJSON(t, actual, []byte(expected)) } func TestError(t *testing.T) { @@ -79,11 +77,9 @@ func TestError(t *testing.T) { } PrintError("error") - actual := buf.String() + actual := buf.Bytes() - if actual != expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) - } + tests.CompareJSON(t, actual, []byte(expected)) } func TestErrorExitCode(t *testing.T) { @@ -99,10 +95,9 @@ func TestErrorExitCode(t *testing.T) { } PrintErrorExitCode("error", 5, map[string]string{"a": "b"}, map[string]string{"c": "d"}) - actual := buf.String() - if actual != expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) - } + actual := buf.Bytes() + + tests.CompareJSON(t, actual, []byte(expected)) } func TestWarning(t *testing.T) { @@ -118,9 +113,7 @@ func TestWarning(t *testing.T) { } PrintWarning("warning") - actual := buf.String() + actual := buf.Bytes() - if actual != expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) - } + tests.CompareJSON(t, actual, []byte(expected)) } diff --git a/pkg/minikube/out/register/register_test.go b/pkg/minikube/out/register/register_test.go index e9b5a74c7f..bcada4c351 100644 --- a/pkg/minikube/out/register/register_test.go +++ b/pkg/minikube/out/register/register_test.go @@ -21,6 +21,8 @@ import ( "fmt" "os" "testing" + + "k8s.io/minikube/pkg/minikube/tests" ) func TestSetCurrentStep(t *testing.T) { @@ -42,9 +44,7 @@ func TestSetCurrentStep(t *testing.T) { } PrintStep("message") - actual := buf.String() + actual := buf.Bytes() - if actual != expected { - t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) - } + tests.CompareJSON(t, actual, []byte(expected)) } diff --git a/pkg/minikube/tests/json_utils.go b/pkg/minikube/tests/json_utils.go new file mode 100644 index 0000000000..5ea9455ee8 --- /dev/null +++ b/pkg/minikube/tests/json_utils.go @@ -0,0 +1,50 @@ +/* +Copyright 2021 The Kubernetes Authors All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package tests + +import ( + "encoding/json" + "reflect" + "testing" +) + +type TestEvent struct { + Data map[string]string `json:"data"` + Datacontenttype string `json:"datacontenttype"` + ID string `json:"id"` + Source string `json:"source"` + Specversion string `json:"specversion"` + Eventtype string `json:"type"` +} + +func CompareJSON(t *testing.T, actual, expected []byte) { + var actualJSON, expectedJSON TestEvent + + err := json.Unmarshal(actual, &actualJSON) + if err != nil { + t.Fatalf("error unmarshalling json: %v", err) + } + + err = json.Unmarshal(expected, &expectedJSON) + if err != nil { + t.Fatalf("error unmarshalling json: %v", err) + } + + if !reflect.DeepEqual(actualJSON, expectedJSON) { + t.Fatalf("expected didn't match actual:\nExpected:\n%v\n\nActual:\n%v", expected, actual) + } +} From ee28862f2941dcd750a258e3dae075f40b653026 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Thu, 19 Aug 2021 16:31:40 -0700 Subject: [PATCH 35/53] add comments --- pkg/minikube/tests/json_utils.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/minikube/tests/json_utils.go b/pkg/minikube/tests/json_utils.go index 5ea9455ee8..db1b3c3882 100644 --- a/pkg/minikube/tests/json_utils.go +++ b/pkg/minikube/tests/json_utils.go @@ -22,6 +22,7 @@ import ( "testing" ) +// TestEvent simulates a CloudEvent for our JSON output type TestEvent struct { Data map[string]string `json:"data"` Datacontenttype string `json:"datacontenttype"` @@ -31,6 +32,8 @@ type TestEvent struct { Eventtype string `json:"type"` } +// CompareJSON takes two byte slices, unmarshals them to TestEvent +// and compares them, failing the test if they don't match func CompareJSON(t *testing.T, actual, expected []byte) { var actualJSON, expectedJSON TestEvent From daff8762beab1a191f34000b004cb9cc6a35cb45 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Thu, 19 Aug 2021 17:25:42 -0700 Subject: [PATCH 36/53] add extra config for cloud shell start --- test/integration/start_stop_delete_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index c756965d03..8a6da71577 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -83,7 +83,10 @@ func TestStartStop(t *testing.T) { version string args []string }{ - {"cloud-shell", constants.DefaultKubernetesVersion, []string{}}, + {"cloud-shell", constants.DefaultKubernetesVersion, []string{ + "--extra-config=kubelet.cgroups-per-qos=false", + "--extra-config=kubelet.enforce-node-allocatable=\"\"", + }}, } } From f8b9b884250ff888ae80930d7029506af5eff5e7 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Fri, 20 Aug 2021 11:03:44 -0700 Subject: [PATCH 37/53] pause each container separately --- pkg/minikube/cruntime/cri.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/minikube/cruntime/cri.go b/pkg/minikube/cruntime/cri.go index f4a223388c..d1d2857e89 100644 --- a/pkg/minikube/cruntime/cri.go +++ b/pkg/minikube/cruntime/cri.go @@ -134,9 +134,8 @@ func pauseCRIContainers(cr CommandRunner, root string, ids []string) error { args = append(args, "--root", root) } args = append(args, "pause") - cargs := args for _, id := range ids { - cargs = append(cargs, id) + cargs := append(args, id) if _, err := cr.RunCmd(exec.Command("sudo", cargs...)); err != nil { return errors.Wrap(err, "runc") } From b6bbf9fd4bc58ebbb9232104743ddb8785be6c79 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Fri, 20 Aug 2021 11:21:07 -0700 Subject: [PATCH 38/53] fix lint --- pkg/minikube/cruntime/cri.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/minikube/cruntime/cri.go b/pkg/minikube/cruntime/cri.go index d1d2857e89..0d88580da2 100644 --- a/pkg/minikube/cruntime/cri.go +++ b/pkg/minikube/cruntime/cri.go @@ -135,8 +135,8 @@ func pauseCRIContainers(cr CommandRunner, root string, ids []string) error { } args = append(args, "pause") for _, id := range ids { - cargs := append(args, id) - if _, err := cr.RunCmd(exec.Command("sudo", cargs...)); err != nil { + args := append(args, id) + if _, err := cr.RunCmd(exec.Command("sudo", args...)); err != nil { return errors.Wrap(err, "runc") } } From 32f0a138dc93995a910b277d023d0779ea24d269 Mon Sep 17 00:00:00 2001 From: minikube-bot Date: Fri, 20 Aug 2021 22:18:39 +0000 Subject: [PATCH 39/53] Update auto-generated docs and translations --- translations/de.json | 6 ++++-- translations/es.json | 5 ++++- translations/fr.json | 4 ++++ translations/ja.json | 6 ++++-- translations/ko.json | 6 ++++-- translations/pl.json | 6 ++++-- translations/strings.txt | 6 ++++-- translations/zh-CN.json | 6 ++++-- 8 files changed, 32 insertions(+), 13 deletions(-) diff --git a/translations/de.json b/translations/de.json index c3840a59d1..d9327c7d5d 100644 --- a/translations/de.json +++ b/translations/de.json @@ -17,6 +17,7 @@ "- {{.logPath}}": "", "--kvm-numa-count range is 1-8": "", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "", + "127.0.0.1": "", "\u003ctarget file absolute path\u003e must be an absolute Path. Relative Path is not allowed (example: \"/home/docker/copied.txt\")": "", "==\u003e Audit \u003c==": "", "==\u003e Last Start \u003c==": "", @@ -153,7 +154,6 @@ "Downloading Kubernetes {{.version}} preload ...": "", "Downloading VM boot image ...": "", "Downloading driver {{.driver}}:": "", - "Due to networking limitations of driver {{.driver_name}} on {{.os_name}}, {{.addon_name}} addon is not supported.\nAlternatively to use this addon you can use a vm-based driver:\n\n\t'minikube start --vm=true'\n\nTo track the update on this work in progress feature please check:\nhttps://github.com/kubernetes/minikube/issues/7332": "", "Due to networking limitations of driver {{.driver_name}}, {{.addon_name}} addon is not fully supported. Try using a different driver.": "", "ERROR creating `registry-creds-acr` secret": "", "ERROR creating `registry-creds-dpr` secret": "", @@ -402,6 +402,7 @@ "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit driver)": "", "Number of lines back to go within the log": "", "OS release is {{.pretty_name}}": "", + "One of 'text', 'yaml' or 'json'.": "", "One of 'yaml' or 'json'.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 1 character, starting with alphanumeric.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 2 characters, starting with alphanumeric.": "", @@ -661,7 +662,7 @@ "The podman-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/": "", "The requested memory allocation of {{.requested}}MiB does not leave room for system overhead (total system memory: {{.system_limit}}MiB). You may face stability issues.": "", "The service namespace": "", - "The service {{.service}} requires privileged ports to be exposed: {{.ports}}": "", + "The service/ingress {{.resource}} requires privileged ports to be exposed: {{.ports}}": "", "The services namespace": "", "The time interval for each check that wait performs in seconds": "", "The value passed to --format is invalid": "", @@ -848,6 +849,7 @@ "error provisioning guest": "", "error starting tunnel": "", "error stopping tunnel": "", + "error: --output must be 'text', 'yaml' or 'json'": "", "error: --output must be 'yaml' or 'json'": "", "experimental": "", "failed to add node": "", diff --git a/translations/es.json b/translations/es.json index e9ddccf717..2b00fa95ad 100644 --- a/translations/es.json +++ b/translations/es.json @@ -18,6 +18,7 @@ "- {{.logPath}}": "", "--kvm-numa-count range is 1-8": "", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "", + "127.0.0.1": "", "\u003ctarget file absolute path\u003e must be an absolute Path. Relative Path is not allowed (example: \"/home/docker/copied.txt\")": "", "==\u003e Audit \u003c==": "", "==\u003e Last Start \u003c==": "", @@ -407,6 +408,7 @@ "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit driver)": "", "Number of lines back to go within the log": "", "OS release is {{.pretty_name}}": "", + "One of 'text', 'yaml' or 'json'.": "", "One of 'yaml' or 'json'.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 1 character, starting with alphanumeric.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 2 characters, starting with alphanumeric.": "", @@ -666,7 +668,7 @@ "The podman-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/": "", "The requested memory allocation of {{.requested}}MiB does not leave room for system overhead (total system memory: {{.system_limit}}MiB). You may face stability issues.": "", "The service namespace": "", - "The service {{.service}} requires privileged ports to be exposed: {{.ports}}": "", + "The service/ingress {{.resource}} requires privileged ports to be exposed: {{.ports}}": "", "The services namespace": "", "The time interval for each check that wait performs in seconds": "", "The value passed to --format is invalid": "", @@ -853,6 +855,7 @@ "error provisioning guest": "", "error starting tunnel": "", "error stopping tunnel": "", + "error: --output must be 'text', 'yaml' or 'json'": "", "error: --output must be 'yaml' or 'json'": "", "experimental": "", "failed to add node": "", diff --git a/translations/fr.json b/translations/fr.json index 74552a86ac..d1707d7364 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -18,6 +18,7 @@ "- {{.logPath}}": "- {{.logPath}}", "--kvm-numa-count range is 1-8": "la tranche de --kvm-numa-count est 1 à 8", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "le drapeau --network est valide uniquement avec les pilotes docker/podman et KVM, il va être ignoré", + "127.0.0.1": "", "\u003ctarget file absolute path\u003e must be an absolute Path. Relative Path is not allowed (example: \"/home/docker/copied.txt\")": "\u003ctarget file absolute path\u003e doit être un chemin absolu. Les chemins relatifs ne sont pas autorisés (exemple: \"/home/docker/copied.txt\")", "==\u003e Audit \u003c==": "==\u003e Audit \u003c==", "==\u003e Last Start \u003c==": "==\u003e Dernier démarrage \u003c==", @@ -407,6 +408,7 @@ "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit driver)": "Nombre de disques supplémentaires créés et attachés à la machine virtuelle minikube (actuellement implémenté uniquement pour le pilote hyperkit)", "Number of lines back to go within the log": "Nombre de lignes à remonter dans le journal", "OS release is {{.pretty_name}}": "La version du système d'exploitation est {{.pretty_name}}", + "One of 'text', 'yaml' or 'json'.": "", "One of 'yaml' or 'json'.": "Un parmi 'yaml' ou 'json'.", "Only alphanumeric and dashes '-' are permitted. Minimum 1 character, starting with alphanumeric.": "Seuls les caractères alphanumériques et les tirets '-' sont autorisés. Minimum 1 caractère, commençant par alphanumérique.", "Only alphanumeric and dashes '-' are permitted. Minimum 2 characters, starting with alphanumeric.": "Seuls les caractères alphanumériques et les tirets '-' sont autorisés. Minimum 2 caractères, commençant par alphanumérique.", @@ -668,6 +670,7 @@ "The requested memory allocation of {{.requested}}MiB does not leave room for system overhead (total system memory: {{.system_limit}}MiB). You may face stability issues.": "L'allocation de mémoire demandée de {{.requested}}MiB ne laisse pas de place pour la surcharge système (mémoire système totale : {{.system_limit}}MiB). Vous pouvez rencontrer des problèmes de stabilité.", "The service namespace": "L'espace de nom du service", "The service {{.service}} requires privileged ports to be exposed: {{.ports}}": "Le service {{.service}} nécessite l'exposition des ports privilégiés : {{.ports}}", + "The service/ingress {{.resource}} requires privileged ports to be exposed: {{.ports}}": "", "The services namespace": "L'espace de noms des services", "The time interval for each check that wait performs in seconds": "L'intervalle de temps pour chaque contrôle que wait effectue en secondes", "The value passed to --format is invalid": "La valeur passée à --format n'est pas valide", @@ -860,6 +863,7 @@ "error provisioning host": "erreur lors de l'approvisionnement de l'hôte", "error starting tunnel": "erreur de démarrage du tunnel", "error stopping tunnel": "erreur d'arrêt du tunnel", + "error: --output must be 'text', 'yaml' or 'json'": "", "error: --output must be 'yaml' or 'json'": "erreur : --output doit être 'yaml' ou 'json'", "experimental": "expérimental", "failed to add node": "échec de l'ajout du nœud", diff --git a/translations/ja.json b/translations/ja.json index c65e7a18d5..fb37609938 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -19,6 +19,7 @@ "- {{.logPath}}": "", "--kvm-numa-count range is 1-8": "", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "", + "127.0.0.1": "", "\u003ctarget file absolute path\u003e must be an absolute Path. Relative Path is not allowed (example: \"/home/docker/copied.txt\")": "", "==\u003e Audit \u003c==": "", "==\u003e Last Start \u003c==": "", @@ -150,7 +151,6 @@ "Downloading Kubernetes {{.version}} preload ...": "Kubernetes {{.version}} のダウンロードの準備をしています", "Downloading VM boot image ...": "VM ブートイメージをダウンロードしています...", "Downloading driver {{.driver}}:": "{{.driver}} ドライバをダウンロードしています:", - "Due to networking limitations of driver {{.driver_name}} on {{.os_name}}, {{.addon_name}} addon is not supported.\nAlternatively to use this addon you can use a vm-based driver:\n\n\t'minikube start --vm=true'\n\nTo track the update on this work in progress feature please check:\nhttps://github.com/kubernetes/minikube/issues/7332": "", "Due to networking limitations of driver {{.driver_name}}, {{.addon_name}} addon is not fully supported. Try using a different driver.": "", "ERROR creating `registry-creds-acr` secret": "`registry-creds-acr` シークレット作成中にエラーが発生しました", "ERROR creating `registry-creds-dpr` secret": "`registry-creds-dpr` シークレット作成中にエラーが発生しました", @@ -398,6 +398,7 @@ "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit driver)": "", "Number of lines back to go within the log": "", "OS release is {{.pretty_name}}": "OS は {{.pretty_name}} です。", + "One of 'text', 'yaml' or 'json'.": "", "One of 'yaml' or 'json'.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 1 character, starting with alphanumeric.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 2 characters, starting with alphanumeric.": "", @@ -661,7 +662,7 @@ "The podman-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/": "", "The requested memory allocation of {{.requested}}MiB does not leave room for system overhead (total system memory: {{.system_limit}}MiB). You may face stability issues.": "", "The service namespace": "", - "The service {{.service}} requires privileged ports to be exposed: {{.ports}}": "", + "The service/ingress {{.resource}} requires privileged ports to be exposed: {{.ports}}": "", "The services namespace": "", "The time interval for each check that wait performs in seconds": "", "The value passed to --format is invalid": "", @@ -856,6 +857,7 @@ "error provisioning guest": "", "error starting tunnel": "tunnel を開始する際にエラーが発生しました", "error stopping tunnel": "tunnel を停止する際にエラーが発生しました", + "error: --output must be 'text', 'yaml' or 'json'": "", "error: --output must be 'yaml' or 'json'": "エラーです。 --output は「 yaml 」、あるいは「 json 」である必要があります", "experimental": "", "failed to add node": "", diff --git a/translations/ko.json b/translations/ko.json index 42c0c950e3..c88d31db6d 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -23,6 +23,7 @@ "- {{.logPath}}": "", "--kvm-numa-count range is 1-8": "--kvm-numa-count 범위는 1부터 8입니다", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "", + "127.0.0.1": "", "\u003ctarget file absolute path\u003e must be an absolute Path. Relative Path is not allowed (example: \"/home/docker/copied.txt\")": "", "==\u003e Audit \u003c==": "", "==\u003e Last Start \u003c==": "", @@ -162,7 +163,6 @@ "Downloading VM boot image ...": "가상 머신 부트 이미지 다운로드 중 ...", "Downloading driver {{.driver}}:": "드라이버 {{.driver}} 다운로드 중 :", "Downloading {{.name}} {{.version}}": "{{.name}} {{.version}} 다운로드 중", - "Due to networking limitations of driver {{.driver_name}} on {{.os_name}}, {{.addon_name}} addon is not supported.\nAlternatively to use this addon you can use a vm-based driver:\n\n\t'minikube start --vm=true'\n\nTo track the update on this work in progress feature please check:\nhttps://github.com/kubernetes/minikube/issues/7332": "", "Due to networking limitations of driver {{.driver_name}}, {{.addon_name}} addon is not fully supported. Try using a different driver.": "", "ERROR creating `registry-creds-acr` secret": "registry-creds-acr` secret 생성 오류", "ERROR creating `registry-creds-dpr` secret": "`registry-creds-dpr` secret 생성 오류", @@ -423,6 +423,7 @@ "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit driver)": "", "Number of lines back to go within the log": "", "OS release is {{.pretty_name}}": "", + "One of 'text', 'yaml' or 'json'.": "", "One of 'yaml' or 'json'.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 1 character, starting with alphanumeric.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 2 characters, starting with alphanumeric.": "", @@ -672,7 +673,7 @@ "The podman-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/": "", "The requested memory allocation of {{.requested}}MiB does not leave room for system overhead (total system memory: {{.system_limit}}MiB). You may face stability issues.": "", "The service namespace": "", - "The service {{.service}} requires privileged ports to be exposed: {{.ports}}": "", + "The service/ingress {{.resource}} requires privileged ports to be exposed: {{.ports}}": "", "The services namespace": "", "The time interval for each check that wait performs in seconds": "", "The value passed to --format is invalid": "", @@ -858,6 +859,7 @@ "error provisioning guest": "", "error starting tunnel": "", "error stopping tunnel": "", + "error: --output must be 'text', 'yaml' or 'json'": "", "error: --output must be 'yaml' or 'json'": "", "experimental": "", "failed to add node": "", diff --git a/translations/pl.json b/translations/pl.json index 8dc41f784b..206d775652 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -22,6 +22,7 @@ "- {{.logPath}}": "", "--kvm-numa-count range is 1-8": "", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "", + "127.0.0.1": "", "\u003ctarget file absolute path\u003e must be an absolute Path. Relative Path is not allowed (example: \"/home/docker/copied.txt\")": "", "==\u003e Audit \u003c==": "==\u003e Audyt \u003c==", "==\u003e Last Start \u003c==": "==\u003e Ostatni start \u003c==", @@ -162,7 +163,6 @@ "Downloading VM boot image ...": "Pobieranie obrazu maszyny wirtualnej ...", "Downloading driver {{.driver}}:": "", "Downloading {{.name}} {{.version}}": "Pobieranie {{.name}} {{.version}}", - "Due to networking limitations of driver {{.driver_name}} on {{.os_name}}, {{.addon_name}} addon is not supported.\nAlternatively to use this addon you can use a vm-based driver:\n\n\t'minikube start --vm=true'\n\nTo track the update on this work in progress feature please check:\nhttps://github.com/kubernetes/minikube/issues/7332": "", "Due to networking limitations of driver {{.driver_name}}, {{.addon_name}} addon is not fully supported. Try using a different driver.": "", "ERROR creating `registry-creds-acr` secret": "", "ERROR creating `registry-creds-dpr` secret": "", @@ -415,6 +415,7 @@ "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit driver)": "", "Number of lines back to go within the log": "", "OS release is {{.pretty_name}}": "Wersja systemu operacyjnego to {{.pretty_name}}", + "One of 'text', 'yaml' or 'json'.": "", "One of 'yaml' or 'json'.": "Jeden z dwóćh formatów - 'yaml' lub 'json'", "Only alphanumeric and dashes '-' are permitted. Minimum 1 character, starting with alphanumeric.": "Tylko znaki alfanumeryczne oraz myślniki '-' są dozwolone. Co najmniej jeden znak, zaczynając od znaku alfanumerycznego", "Only alphanumeric and dashes '-' are permitted. Minimum 2 characters, starting with alphanumeric.": "Tylko znaki alfanumeryczne oraz myślniki '-' są dozwolone. Co najmniej dwa znaki, zaczynając od znaku alfanumerycznego", @@ -680,7 +681,7 @@ "The podman-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/": "", "The requested memory allocation of {{.requested}}MiB does not leave room for system overhead (total system memory: {{.system_limit}}MiB). You may face stability issues.": "", "The service namespace": "", - "The service {{.service}} requires privileged ports to be exposed: {{.ports}}": "", + "The service/ingress {{.resource}} requires privileged ports to be exposed: {{.ports}}": "", "The services namespace": "", "The time interval for each check that wait performs in seconds": "", "The value passed to --format is invalid": "Wartość przekazana do --format jest nieprawidłowa", @@ -864,6 +865,7 @@ "error provisioning guest": "", "error starting tunnel": "", "error stopping tunnel": "", + "error: --output must be 'text', 'yaml' or 'json'": "", "error: --output must be 'yaml' or 'json'": "", "experimental": "", "failed to add node": "", diff --git a/translations/strings.txt b/translations/strings.txt index a1d230cbd6..e4b5fadb80 100644 --- a/translations/strings.txt +++ b/translations/strings.txt @@ -17,6 +17,7 @@ "- {{.logPath}}": "", "--kvm-numa-count range is 1-8": "", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "", + "127.0.0.1": "", "\u003ctarget file absolute path\u003e must be an absolute Path. Relative Path is not allowed (example: \"/home/docker/copied.txt\")": "", "==\u003e Audit \u003c==": "", "==\u003e Last Start \u003c==": "", @@ -145,7 +146,6 @@ "Downloading Kubernetes {{.version}} preload ...": "", "Downloading VM boot image ...": "", "Downloading driver {{.driver}}:": "", - "Due to networking limitations of driver {{.driver_name}} on {{.os_name}}, {{.addon_name}} addon is not supported.\nAlternatively to use this addon you can use a vm-based driver:\n\n\t'minikube start --vm=true'\n\nTo track the update on this work in progress feature please check:\nhttps://github.com/kubernetes/minikube/issues/7332": "", "Due to networking limitations of driver {{.driver_name}}, {{.addon_name}} addon is not fully supported. Try using a different driver.": "", "ERROR creating `registry-creds-acr` secret": "", "ERROR creating `registry-creds-dpr` secret": "", @@ -377,6 +377,7 @@ "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit driver)": "", "Number of lines back to go within the log": "", "OS release is {{.pretty_name}}": "", + "One of 'text', 'yaml' or 'json'.": "", "One of 'yaml' or 'json'.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 1 character, starting with alphanumeric.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 2 characters, starting with alphanumeric.": "", @@ -619,7 +620,7 @@ "The podman-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/": "", "The requested memory allocation of {{.requested}}MiB does not leave room for system overhead (total system memory: {{.system_limit}}MiB). You may face stability issues.": "", "The service namespace": "", - "The service {{.service}} requires privileged ports to be exposed: {{.ports}}": "", + "The service/ingress {{.resource}} requires privileged ports to be exposed: {{.ports}}": "", "The services namespace": "", "The time interval for each check that wait performs in seconds": "", "The value passed to --format is invalid": "", @@ -793,6 +794,7 @@ "error provisioning guest": "", "error starting tunnel": "", "error stopping tunnel": "", + "error: --output must be 'text', 'yaml' or 'json'": "", "error: --output must be 'yaml' or 'json'": "", "experimental": "", "failed to add node": "", diff --git a/translations/zh-CN.json b/translations/zh-CN.json index 67988fff6c..50858be631 100644 --- a/translations/zh-CN.json +++ b/translations/zh-CN.json @@ -24,6 +24,7 @@ "- {{.logPath}}": "", "--kvm-numa-count range is 1-8": "", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "", + "127.0.0.1": "", "\u003ctarget file absolute path\u003e must be an absolute Path. Relative Path is not allowed (example: \"/home/docker/copied.txt\")": "", "==\u003e Audit \u003c==": "", "==\u003e Last Start \u003c==": "", @@ -187,7 +188,6 @@ "Downloading VM boot image ...": "正在下载 VM boot image...", "Downloading driver {{.driver}}:": "正在下载驱动 {{.driver}}:", "Downloading {{.name}} {{.version}}": "正在下载 {{.name}} {{.version}}", - "Due to networking limitations of driver {{.driver_name}} on {{.os_name}}, {{.addon_name}} addon is not supported.\nAlternatively to use this addon you can use a vm-based driver:\n\n\t'minikube start --vm=true'\n\nTo track the update on this work in progress feature please check:\nhttps://github.com/kubernetes/minikube/issues/7332": "", "Due to networking limitations of driver {{.driver_name}}, {{.addon_name}} addon is not fully supported. Try using a different driver.": "", "ERROR creating `registry-creds-acr` secret": "", "ERROR creating `registry-creds-dpr` secret": "创建 `registry-creds-dpr` secret 时出错", @@ -488,6 +488,7 @@ "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit driver)": "", "Number of lines back to go within the log": "", "OS release is {{.pretty_name}}": "", + "One of 'text', 'yaml' or 'json'.": "", "One of 'yaml' or 'json'.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 1 character, starting with alphanumeric.": "", "Only alphanumeric and dashes '-' are permitted. Minimum 2 characters, starting with alphanumeric.": "", @@ -768,7 +769,7 @@ "The podman-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/": "", "The requested memory allocation of {{.requested}}MiB does not leave room for system overhead (total system memory: {{.system_limit}}MiB). You may face stability issues.": "", "The service namespace": "", - "The service {{.service}} requires privileged ports to be exposed: {{.ports}}": "", + "The service/ingress {{.resource}} requires privileged ports to be exposed: {{.ports}}": "", "The services namespace": "", "The time interval for each check that wait performs in seconds": "", "The value passed to --format is invalid": "", @@ -970,6 +971,7 @@ "error provisioning guest": "", "error starting tunnel": "", "error stopping tunnel": "", + "error: --output must be 'text', 'yaml' or 'json'": "", "error: --output must be 'yaml' or 'json'": "", "experimental": "", "failed to add node": "", From fe6cbc4e428f26c4fdc6f307b4d7f147cebc1511 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Fri, 20 Aug 2021 15:34:53 -0700 Subject: [PATCH 40/53] add extra options to minikube start directly --- cmd/minikube/cmd/start_flags.go | 6 ++++++ test/integration/start_stop_delete_test.go | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index bfc39bda3a..e95316895a 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -35,6 +35,7 @@ import ( "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/cruntime" + "k8s.io/minikube/pkg/minikube/detect" "k8s.io/minikube/pkg/minikube/download" "k8s.io/minikube/pkg/minikube/driver" "k8s.io/minikube/pkg/minikube/exit" @@ -480,6 +481,11 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, drvName s cc.ContainerVolumeMounts = []string{viper.GetString(mountString)} } + if detect.IsCloudShell() { + cc.KubernetesConfig.ExtraOptions.Set("kubelet.cgroups-per-qos=false") + cc.KubernetesConfig.ExtraOptions.Set("kubelet.enforce-node-allocatable=\"\"") + } + return cc } diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 8a6da71577..c756965d03 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -83,10 +83,7 @@ func TestStartStop(t *testing.T) { version string args []string }{ - {"cloud-shell", constants.DefaultKubernetesVersion, []string{ - "--extra-config=kubelet.cgroups-per-qos=false", - "--extra-config=kubelet.enforce-node-allocatable=\"\"", - }}, + {"cloud-shell", constants.DefaultKubernetesVersion, []string{}}, } } From 380b8467153944a19bb872811bff9e001216d1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 15 Aug 2021 20:20:07 +0200 Subject: [PATCH 41/53] Add stand-alone image pull and image tag commands Needed for testing, but maybe elsewhere as well --- cmd/minikube/cmd/image.go | 42 +++++++++ pkg/minikube/cruntime/containerd.go | 10 +++ pkg/minikube/cruntime/crio.go | 10 +++ pkg/minikube/cruntime/cruntime.go | 2 + pkg/minikube/cruntime/docker.go | 10 +++ pkg/minikube/machine/cache_images.go | 57 ++++++++++++ pkg/minikube/reason/reason.go | 4 + site/content/en/docs/commands/image.md | 88 +++++++++++++++++++ site/content/en/docs/contrib/errorcodes.en.md | 6 ++ translations/strings.txt | 5 ++ 10 files changed, 234 insertions(+) diff --git a/cmd/minikube/cmd/image.go b/cmd/minikube/cmd/image.go index 85616c09c4..cbc6aa87d9 100644 --- a/cmd/minikube/cmd/image.go +++ b/cmd/minikube/cmd/image.go @@ -165,6 +165,24 @@ $ minikube image unload image busybox }, } +var pullImageCmd = &cobra.Command{ + Use: "pull", + Short: "Pull images", + Example: ` +$ minikube image pull busybox +`, + Run: func(cmd *cobra.Command, args []string) { + profile, err := config.LoadProfile(viper.GetString(config.ProfileName)) + if err != nil { + exit.Error(reason.Usage, "loading profile", err) + } + + if err := machine.PullImages(args, profile); err != nil { + exit.Error(reason.GuestImagePull, "Failed to pull images", err) + } + }, +} + func createTar(dir string) (string, error) { tar, err := docker.CreateTarStream(dir, dockerFile) if err != nil { @@ -245,6 +263,28 @@ $ minikube image ls }, } +var tagImageCmd = &cobra.Command{ + Use: "tag", + Short: "Tag images", + Example: ` +$ minikube image tag source target +`, + Aliases: []string{"list"}, + Run: func(cmd *cobra.Command, args []string) { + if len(args) != 2 { + exit.Message(reason.Usage, "Please provide source and target image") + } + profile, err := config.LoadProfile(viper.GetString(config.ProfileName)) + if err != nil { + exit.Error(reason.Usage, "loading profile", err) + } + + if err := machine.TagImage(profile, args[0], args[1]); err != nil { + exit.Error(reason.GuestImageTag, "Failed to tag images", err) + } + }, +} + func init() { loadImageCmd.Flags().BoolVarP(&pull, "pull", "", false, "Pull the remote image (no caching)") loadImageCmd.Flags().BoolVar(&imgDaemon, "daemon", false, "Cache image from docker daemon") @@ -252,6 +292,7 @@ func init() { loadImageCmd.Flags().BoolVar(&overwrite, "overwrite", true, "Overwrite image even if same image:tag name exists") imageCmd.AddCommand(loadImageCmd) imageCmd.AddCommand(removeImageCmd) + imageCmd.AddCommand(pullImageCmd) buildImageCmd.Flags().StringVarP(&tag, "tag", "t", "", "Tag to apply to the new image (optional)") buildImageCmd.Flags().BoolVarP(&push, "push", "", false, "Push the new image (requires tag)") buildImageCmd.Flags().StringVarP(&dockerFile, "file", "f", "", "Path to the Dockerfile to use (optional)") @@ -259,4 +300,5 @@ func init() { buildImageCmd.Flags().StringArrayVar(&buildOpt, "build-opt", nil, "Specify arbitrary flags to pass to the build. (format: key=value)") imageCmd.AddCommand(buildImageCmd) imageCmd.AddCommand(listImageCmd) + imageCmd.AddCommand(tagImageCmd) } diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index edc22533f1..13b0834e9b 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -305,6 +305,16 @@ func (r *Containerd) RemoveImage(name string) error { return removeCRIImage(r.Runner, name) } +// TagImage tags an image in this runtime +func (r *Containerd) TagImage(source string, target string) error { + klog.Infof("Tagging image %s: %s", source, target) + c := exec.Command("sudo", "ctr", "-n=k8s.io", "images", "tag", source, target) + if _, err := r.Runner.RunCmd(c); err != nil { + return errors.Wrapf(err, "ctr images tag") + } + return nil +} + func gitClone(cr CommandRunner, src string) (string, error) { // clone to a temporary directory rr, err := cr.RunCmd(exec.Command("mktemp", "-d")) diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index 82d30647f6..ddb61ceb43 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -216,6 +216,16 @@ func (r *CRIO) RemoveImage(name string) error { return removeCRIImage(r.Runner, name) } +// TagImage tags an image in this runtime +func (r *CRIO) TagImage(source string, target string) error { + klog.Infof("Tagging image %s: %s", source, target) + c := exec.Command("sudo", "podman", "tag", source, target) + if _, err := r.Runner.RunCmd(c); err != nil { + return errors.Wrap(err, "crio tag image") + } + return nil +} + // BuildImage builds an image into this runtime func (r *CRIO) BuildImage(src string, file string, tag string, push bool, env []string, opts []string) error { klog.Infof("Building image: %s", src) diff --git a/pkg/minikube/cruntime/cruntime.go b/pkg/minikube/cruntime/cruntime.go index 95d9084839..a7ae9f4323 100644 --- a/pkg/minikube/cruntime/cruntime.go +++ b/pkg/minikube/cruntime/cruntime.go @@ -101,6 +101,8 @@ type Manager interface { BuildImage(string, string, string, bool, []string, []string) error // Save an image from the runtime on a host SaveImage(string, string) error + // Tag an image + TagImage(string, string) error // ImageExists takes image name and image sha checks if an it exists ImageExists(string, string) bool diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index c25c6cc930..641775b78b 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -244,6 +244,16 @@ func (r *Docker) RemoveImage(name string) error { return nil } +// TagImage tags an image in this runtime +func (r *Docker) TagImage(source string, target string) error { + klog.Infof("Tagging image %s: %s", source, target) + c := exec.Command("docker", "tag", source, target) + if _, err := r.Runner.RunCmd(c); err != nil { + return errors.Wrap(err, "tag image docker.") + } + return nil +} + // BuildImage builds an image into this runtime func (r *Docker) BuildImage(src string, file string, tag string, push bool, env []string, opts []string) error { klog.Infof("Building image: %s", src) diff --git a/pkg/minikube/machine/cache_images.go b/pkg/minikube/machine/cache_images.go index ad97ddcf8d..c9b9e54632 100644 --- a/pkg/minikube/machine/cache_images.go +++ b/pkg/minikube/machine/cache_images.go @@ -539,3 +539,60 @@ func ListImages(profile *config.Profile) error { return nil } + +// TagImage tags image in all nodes in profile +func TagImage(profile *config.Profile, source string, target string) error { + api, err := NewAPIClient() + if err != nil { + return errors.Wrap(err, "error creating api client") + } + defer api.Close() + + succeeded := []string{} + failed := []string{} + + pName := profile.Name + + c, err := config.Load(pName) + if err != nil { + klog.Errorf("Failed to load profile %q: %v", pName, err) + return errors.Wrapf(err, "error loading config for profile :%v", pName) + } + + for _, n := range c.Nodes { + m := config.MachineName(*c, n) + + status, err := Status(api, m) + if err != nil { + klog.Warningf("error getting status for %s: %v", m, err) + continue + } + + if status == state.Running.String() { + h, err := api.Load(m) + if err != nil { + klog.Warningf("Failed to load machine %q: %v", m, err) + continue + } + runner, err := CommandRunner(h) + if err != nil { + return err + } + cruntime, err := cruntime.New(cruntime.Config{Type: c.KubernetesConfig.ContainerRuntime, Runner: runner}) + if err != nil { + return errors.Wrap(err, "error creating container runtime") + } + err = cruntime.TagImage(source, target) + if err != nil { + failed = append(failed, m) + klog.Warningf("Failed to tag image for profile %s %v", pName, err.Error()) + continue + } + succeeded = append(succeeded, m) + } + } + + klog.Infof("succeeded tagging in: %s", strings.Join(succeeded, " ")) + klog.Infof("failed tagging in: %s", strings.Join(failed, " ")) + return nil +} diff --git a/pkg/minikube/reason/reason.go b/pkg/minikube/reason/reason.go index 9b044e45b8..b64f5cd031 100644 --- a/pkg/minikube/reason/reason.go +++ b/pkg/minikube/reason/reason.go @@ -315,8 +315,12 @@ var ( GuestImageLoad = Kind{ID: "GUEST_IMAGE_LOAD", ExitCode: ExGuestError} // minikube failed to remove an image GuestImageRemove = Kind{ID: "GUEST_IMAGE_REMOVE", ExitCode: ExGuestError} + // minikube failed to pull an image + GuestImagePull = Kind{ID: "GUEST_IMAGE_PULL", ExitCode: ExGuestError} // minikube failed to build an image GuestImageBuild = Kind{ID: "GUEST_IMAGE_BUILD", ExitCode: ExGuestError} + // minikube failed to tag an image + GuestImageTag = Kind{ID: "GUEST_IMAGE_TAG", ExitCode: ExGuestError} // minikube failed to load host GuestLoadHost = Kind{ID: "GUEST_LOAD_HOST", ExitCode: ExGuestError} // minkube failed to create a mount diff --git a/site/content/en/docs/commands/image.md b/site/content/en/docs/commands/image.md index 299e0c80ae..51a509972f 100644 --- a/site/content/en/docs/commands/image.md +++ b/site/content/en/docs/commands/image.md @@ -216,6 +216,48 @@ $ minikube image ls --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging ``` +## minikube image pull + +Pull images + +### Synopsis + +Pull images + +```shell +minikube image pull [flags] +``` + +### Examples + +``` + +$ minikube image pull busybox + +``` + +### Options inherited from parent commands + +``` + --add_dir_header If true, adds the file directory to the header of the log messages + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm") + -h, --help + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --log_file string If non-empty, use this log file + --log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) + --logtostderr log to standard error instead of files + --one_output If true, only write logs to their native severity level (vs also writing to each lower severity level) + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --skip_headers If true, avoid header prefixes in the log messages + --skip_log_headers If true, avoid headers when opening log files + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + --user string Specifies the user executing the operation. Useful for auditing operations executed by 3rd party tools. Defaults to the operating system username. + -v, --v Level number for the log level verbosity + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` + ## minikube image rm Remove one or more images @@ -264,3 +306,49 @@ $ minikube image unload image busybox --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging ``` +## minikube image tag + +Tag images + +### Synopsis + +Tag images + +```shell +minikube image tag [flags] +``` + +### Aliases + +[list] + +### Examples + +``` + +$ minikube image tag source target + +``` + +### Options inherited from parent commands + +``` + --add_dir_header If true, adds the file directory to the header of the log messages + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm") + -h, --help + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --log_file string If non-empty, use this log file + --log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) + --logtostderr log to standard error instead of files + --one_output If true, only write logs to their native severity level (vs also writing to each lower severity level) + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --skip_headers If true, avoid header prefixes in the log messages + --skip_log_headers If true, avoid headers when opening log files + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + --user string Specifies the user executing the operation. Useful for auditing operations executed by 3rd party tools. Defaults to the operating system username. + -v, --v Level number for the log level verbosity + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` + diff --git a/site/content/en/docs/contrib/errorcodes.en.md b/site/content/en/docs/contrib/errorcodes.en.md index d2589bf1e5..8b718f5acb 100644 --- a/site/content/en/docs/contrib/errorcodes.en.md +++ b/site/content/en/docs/contrib/errorcodes.en.md @@ -378,9 +378,15 @@ minikube failed to pull or load an image "GUEST_IMAGE_REMOVE" (Exit code ExGuestError) minikube failed to remove an image +"GUEST_IMAGE_PULL" (Exit code ExGuestError) +minikube failed to pull an image + "GUEST_IMAGE_BUILD" (Exit code ExGuestError) minikube failed to build an image +"GUEST_IMAGE_TAG" (Exit code ExGuestError) +minikube failed to tag an image + "GUEST_LOAD_HOST" (Exit code ExGuestError) minikube failed to load host diff --git a/translations/strings.txt b/translations/strings.txt index e4b5fadb80..8535d29ba0 100644 --- a/translations/strings.txt +++ b/translations/strings.txt @@ -235,6 +235,7 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", "Failed to reload cached images": "", "Failed to remove image": "", "Failed to save config {{.profile}}": "", @@ -245,6 +246,7 @@ "Failed to start container runtime": "", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "", + "Failed to tag images": "", "Failed to update cluster": "", "Failed to update config": "", "Failed unmount: {{.error}}": "", @@ -409,6 +411,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "", @@ -433,6 +436,7 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "", "Push the new image (requires tag)": "", @@ -549,6 +553,7 @@ "Successfully stopped node {{.name}}": "", "Suggestion: {{.advice}}": "", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "", "Target {{.path}} can not be empty": "", From 817f8b4b70af8231b09773f1d0263e876bf67f83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 22 Aug 2021 20:07:17 +0200 Subject: [PATCH 42/53] Add also stand-alone image push matching pull Normally this is done as part of image build --- cmd/minikube/cmd/image.go | 19 +++++ pkg/minikube/cruntime/containerd.go | 9 +++ pkg/minikube/cruntime/crio.go | 10 +++ pkg/minikube/cruntime/cruntime.go | 2 + pkg/minikube/cruntime/docker.go | 10 +++ pkg/minikube/machine/cache_images.go | 81 +++++++++++++++++++ pkg/minikube/reason/reason.go | 2 + site/content/en/docs/commands/image.md | 42 ++++++++++ site/content/en/docs/contrib/errorcodes.en.md | 3 + translations/strings.txt | 2 + 10 files changed, 180 insertions(+) diff --git a/cmd/minikube/cmd/image.go b/cmd/minikube/cmd/image.go index cbc6aa87d9..f76da74e23 100644 --- a/cmd/minikube/cmd/image.go +++ b/cmd/minikube/cmd/image.go @@ -285,6 +285,24 @@ $ minikube image tag source target }, } +var pushImageCmd = &cobra.Command{ + Use: "push", + Short: "Push images", + Example: ` +$ minikube image push busybox +`, + Run: func(cmd *cobra.Command, args []string) { + profile, err := config.LoadProfile(viper.GetString(config.ProfileName)) + if err != nil { + exit.Error(reason.Usage, "loading profile", err) + } + + if err := machine.PushImages(args, profile); err != nil { + exit.Error(reason.GuestImagePush, "Failed to push images", err) + } + }, +} + func init() { loadImageCmd.Flags().BoolVarP(&pull, "pull", "", false, "Pull the remote image (no caching)") loadImageCmd.Flags().BoolVar(&imgDaemon, "daemon", false, "Cache image from docker daemon") @@ -301,4 +319,5 @@ func init() { imageCmd.AddCommand(buildImageCmd) imageCmd.AddCommand(listImageCmd) imageCmd.AddCommand(tagImageCmd) + imageCmd.AddCommand(pushImageCmd) } diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 13b0834e9b..71ca9a9048 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -422,6 +422,15 @@ func (r *Containerd) BuildImage(src string, file string, tag string, push bool, return nil } +// PushImage pushes an image +func (r *Containerd) PushImage(name string) error { + klog.Infof("Pushing image %s: %s", name) + c := exec.Command("sudo", "ctr", "-n=k8s.io", "images", "push", name) + if _, err := r.Runner.RunCmd(c); err != nil { + return errors.Wrapf(err, "ctr images push") + } + return nil +} func (r *Containerd) initBuildkitDaemon() error { // if daemon is already running, do nothing cmd := exec.Command("pgrep", "buildkitd") diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index ddb61ceb43..8d69afa1e0 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -260,6 +260,16 @@ func (r *CRIO) BuildImage(src string, file string, tag string, push bool, env [] return nil } +// PushImage pushes an image +func (r *CRIO) PushImage(name string) error { + klog.Infof("Pushing image %s", name) + c := exec.Command("sudo", "podman", "push", name) + if _, err := r.Runner.RunCmd(c); err != nil { + return errors.Wrap(err, "crio push image") + } + return nil +} + // CGroupDriver returns cgroup driver ("cgroupfs" or "systemd") func (r *CRIO) CGroupDriver() (string, error) { c := exec.Command("crio", "config") diff --git a/pkg/minikube/cruntime/cruntime.go b/pkg/minikube/cruntime/cruntime.go index a7ae9f4323..1ca58e01d4 100644 --- a/pkg/minikube/cruntime/cruntime.go +++ b/pkg/minikube/cruntime/cruntime.go @@ -103,6 +103,8 @@ type Manager interface { SaveImage(string, string) error // Tag an image TagImage(string, string) error + // Push an image from the runtime to the container registry + PushImage(string) error // ImageExists takes image name and image sha checks if an it exists ImageExists(string, string) bool diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 641775b78b..2b06321f43 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -288,6 +288,16 @@ func (r *Docker) BuildImage(src string, file string, tag string, push bool, env return nil } +// PushImage pushes an image +func (r *Docker) PushImage(name string) error { + klog.Infof("Pushing image: %s", name) + c := exec.Command("docker", "push", name) + if _, err := r.Runner.RunCmd(c); err != nil { + return errors.Wrap(err, "push image docker.") + } + return nil +} + // CGroupDriver returns cgroup driver ("cgroupfs" or "systemd") func (r *Docker) CGroupDriver() (string, error) { // Note: the server daemon has to be running, for this call to return successfully diff --git a/pkg/minikube/machine/cache_images.go b/pkg/minikube/machine/cache_images.go index c9b9e54632..f2f03dc64b 100644 --- a/pkg/minikube/machine/cache_images.go +++ b/pkg/minikube/machine/cache_images.go @@ -596,3 +596,84 @@ func TagImage(profile *config.Profile, source string, target string) error { klog.Infof("failed tagging in: %s", strings.Join(failed, " ")) return nil } + +// pushImages pushes images from the container run time +func pushImages(cruntime cruntime.Manager, images []string) error { + klog.Infof("PushImages start: %s", images) + start := time.Now() + + defer func() { + klog.Infof("PushImages completed in %s", time.Since(start)) + }() + + var g errgroup.Group + + for _, image := range images { + image := image + g.Go(func() error { + return cruntime.PushImage(image) + }) + } + if err := g.Wait(); err != nil { + return errors.Wrap(err, "error pushing images") + } + klog.Infoln("Successfully pushed images") + return nil +} + +// PushImages push images on all nodes in profile +func PushImages(images []string, profile *config.Profile) error { + api, err := NewAPIClient() + if err != nil { + return errors.Wrap(err, "error creating api client") + } + defer api.Close() + + succeeded := []string{} + failed := []string{} + + pName := profile.Name + + c, err := config.Load(pName) + if err != nil { + klog.Errorf("Failed to load profile %q: %v", pName, err) + return errors.Wrapf(err, "error loading config for profile :%v", pName) + } + + for _, n := range c.Nodes { + m := config.MachineName(*c, n) + + status, err := Status(api, m) + if err != nil { + klog.Warningf("error getting status for %s: %v", m, err) + continue + } + + if status == state.Running.String() { + h, err := api.Load(m) + if err != nil { + klog.Warningf("Failed to load machine %q: %v", m, err) + continue + } + runner, err := CommandRunner(h) + if err != nil { + return err + } + cruntime, err := cruntime.New(cruntime.Config{Type: c.KubernetesConfig.ContainerRuntime, Runner: runner}) + if err != nil { + return errors.Wrap(err, "error creating container runtime") + } + err = pushImages(cruntime, images) + if err != nil { + failed = append(failed, m) + klog.Warningf("Failed to push image for profile %s %v", pName, err.Error()) + continue + } + succeeded = append(succeeded, m) + } + } + + klog.Infof("succeeded pushing in: %s", strings.Join(succeeded, " ")) + klog.Infof("failed pushing in: %s", strings.Join(failed, " ")) + return nil +} diff --git a/pkg/minikube/reason/reason.go b/pkg/minikube/reason/reason.go index b64f5cd031..a3dd176432 100644 --- a/pkg/minikube/reason/reason.go +++ b/pkg/minikube/reason/reason.go @@ -317,6 +317,8 @@ var ( GuestImageRemove = Kind{ID: "GUEST_IMAGE_REMOVE", ExitCode: ExGuestError} // minikube failed to pull an image GuestImagePull = Kind{ID: "GUEST_IMAGE_PULL", ExitCode: ExGuestError} + // minikube failed to push an image + GuestImagePush = Kind{ID: "GUEST_IMAGE_PUSH", ExitCode: ExGuestError} // minikube failed to build an image GuestImageBuild = Kind{ID: "GUEST_IMAGE_BUILD", ExitCode: ExGuestError} // minikube failed to tag an image diff --git a/site/content/en/docs/commands/image.md b/site/content/en/docs/commands/image.md index 51a509972f..6f6537c5ff 100644 --- a/site/content/en/docs/commands/image.md +++ b/site/content/en/docs/commands/image.md @@ -258,6 +258,48 @@ $ minikube image pull busybox --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging ``` +## minikube image push + +Push images + +### Synopsis + +Push images + +```shell +minikube image push [flags] +``` + +### Examples + +``` + +$ minikube image push busybox + +``` + +### Options inherited from parent commands + +``` + --add_dir_header If true, adds the file directory to the header of the log messages + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm") + -h, --help + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --log_file string If non-empty, use this log file + --log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) + --logtostderr log to standard error instead of files + --one_output If true, only write logs to their native severity level (vs also writing to each lower severity level) + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --skip_headers If true, avoid header prefixes in the log messages + --skip_log_headers If true, avoid headers when opening log files + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + --user string Specifies the user executing the operation. Useful for auditing operations executed by 3rd party tools. Defaults to the operating system username. + -v, --v Level number for the log level verbosity + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` + ## minikube image rm Remove one or more images diff --git a/site/content/en/docs/contrib/errorcodes.en.md b/site/content/en/docs/contrib/errorcodes.en.md index 8b718f5acb..a491beb0b4 100644 --- a/site/content/en/docs/contrib/errorcodes.en.md +++ b/site/content/en/docs/contrib/errorcodes.en.md @@ -381,6 +381,9 @@ minikube failed to remove an image "GUEST_IMAGE_PULL" (Exit code ExGuestError) minikube failed to pull an image +"GUEST_IMAGE_PUSH" (Exit code ExGuestError) +minikube failed to push an image + "GUEST_IMAGE_BUILD" (Exit code ExGuestError) minikube failed to build an image diff --git a/translations/strings.txt b/translations/strings.txt index 8535d29ba0..c22e44bce8 100644 --- a/translations/strings.txt +++ b/translations/strings.txt @@ -236,6 +236,7 @@ "Failed to persist images": "", "Failed to pull image": "", "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "", "Failed to remove image": "", "Failed to save config {{.profile}}": "", @@ -439,6 +440,7 @@ "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "", "Rebuild libvirt with virt-network support": "", From cd97ec2195ca167de054563006a2b6e5438e4232 Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Tue, 17 Aug 2021 14:20:42 +0200 Subject: [PATCH 43/53] Fix french translation Signed-off-by: Jeff MAURY --- translations/fr.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translations/fr.json b/translations/fr.json index d1707d7364..8dedc64423 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -71,8 +71,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "Le pont CNI est incompatible avec les clusters multi-nœuds, utilisez un autre CNI", "Build a container image in minikube": "Construire une image de conteneur dans minikube", "Build a container image, using the container runtime.": "Construire une image de conteneur à l'aide de l'environnement d'exécution du conteneur.", - "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", - "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "L'allocation CGroup n'est pas disponible dans votre environnement, vous exécutez peut-être minikube dans un conteneur imbriqué. Essayez d'exécuter :\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\ n\n\t\t\t\n\t\t\t", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "L'allocation CGroup n'est pas disponible dans votre environnement, vous exécutez peut-être minikube dans un conteneur imbriqué. Essayez d'exécuter :\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\ n\n\t\t\t\n\t\t\t", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "Plug-in CNI à utiliser. Options valides : auto, bridge, calico, cilium, flannel, kindnet ou chemin vers un manifeste CNI (par défaut : auto)", "Cache image from docker daemon": "Cacher l'image du démon docker", "Cache image from remote registry": "Cacher l'image du registre distant", @@ -572,7 +572,7 @@ "Starts a node.": "Démarre un nœud.", "Starts an existing stopped node in a cluster.": "Démarre un nœud arrêté existant dans un cluster.", "Startup with {{.old_driver}} driver failed, trying with alternate driver {{.new_driver}}: {{.error}}": "Échec du démarrage avec le pilote {{.old_driver}}, essai avec un autre pilote {{.new_driver}} : {{.error}}", - "Stopped tunnel for service {{.service}}.": "", + "Stopped tunnel for service {{.service}}.": "Tunnel arrêté pour le service {{.service}}.", "Stopping \"{{.profile_name}}\" in {{.driver_name}} ...": "Arrêt de \"{{.profile_name}}\" sur {{.driver_name}}...", "Stopping node \"{{.name}}\" ...": "Nœud d'arrêt \"{{.name}}\" ...", "Stopping tunnel for service {{.service}}.": "Tunnel d'arrêt pour le service {{.service}}.", From 3e063625fda73b45d476ca2f38170dc6e4e6db66 Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Tue, 17 Aug 2021 22:26:11 +0200 Subject: [PATCH 44/53] Fix typo in fr.json Signed-off-by: Jeff MAURY --- translations/fr.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translations/fr.json b/translations/fr.json index 8dedc64423..1e27b33428 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -71,8 +71,8 @@ "Bridge CNI is incompatible with multi-node clusters, use a different CNI": "Le pont CNI est incompatible avec les clusters multi-nœuds, utilisez un autre CNI", "Build a container image in minikube": "Construire une image de conteneur dans minikube", "Build a container image, using the container runtime.": "Construire une image de conteneur à l'aide de l'environnement d'exécution du conteneur.", - "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "L'allocation CGroup n'est pas disponible dans votre environnement, vous exécutez peut-être minikube dans un conteneur imbriqué. Essayez d'exécuter :\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\ n\n\t\t\t\n\t\t\t", - "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "L'allocation CGroup n'est pas disponible dans votre environnement, vous exécutez peut-être minikube dans un conteneur imbriqué. Essayez d'exécuter :\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\ n\n\t\t\t\n\t\t\t", + "CGroup allocation is not available in your environment, You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "L'allocation CGroup n'est pas disponible dans votre environnement, vous exécutez peut-être minikube dans un conteneur imbriqué. Essayez d'exécuter :\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t", + "CGroup allocation is not available in your environment. You might be running minikube in a nested container. Try running:\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t": "L'allocation CGroup n'est pas disponible dans votre environnement, vous exécutez peut-être minikube dans un conteneur imbriqué. Essayez d'exécuter :\n\t\t\t\n\tminikube start --extra-config=kubelet.cgroups-per-qos=false --extra-config=kubelet.enforce-node-allocatable=\"\"\n\n\t\t\t\n\t\t\t", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)": "Plug-in CNI à utiliser. Options valides : auto, bridge, calico, cilium, flannel, kindnet ou chemin vers un manifeste CNI (par défaut : auto)", "Cache image from docker daemon": "Cacher l'image du démon docker", "Cache image from remote registry": "Cacher l'image du registre distant", @@ -969,4 +969,4 @@ "{{.profile}} profile is not valid: {{.err}}": "Le profil {{.profile}} n'est pas valide : {{.err}}", "{{.type}} is not yet a supported filesystem. We will try anyways!": "{{.type}} n'est pas encore un système de fichiers pris en charge. Nous essaierons quand même !", "{{.url}} is not accessible: {{.error}}": "{{.url}} n'est pas accessible : {{.error}}" -} \ No newline at end of file +} From 68818d421281cdb3bcbf0b4cba78f78bac45fbac Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Mon, 23 Aug 2021 07:46:27 +0200 Subject: [PATCH 45/53] Complete missing items Signed-off-by: Jeff MAURY --- translations/fr.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translations/fr.json b/translations/fr.json index 1e27b33428..6a8fd1a266 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -18,7 +18,7 @@ "- {{.logPath}}": "- {{.logPath}}", "--kvm-numa-count range is 1-8": "la tranche de --kvm-numa-count est 1 à 8", "--network flag is only valid with the docker/podman and KVM drivers, it will be ignored": "le drapeau --network est valide uniquement avec les pilotes docker/podman et KVM, il va être ignoré", - "127.0.0.1": "", + "127.0.0.1": "127.0.0.1", "\u003ctarget file absolute path\u003e must be an absolute Path. Relative Path is not allowed (example: \"/home/docker/copied.txt\")": "\u003ctarget file absolute path\u003e doit être un chemin absolu. Les chemins relatifs ne sont pas autorisés (exemple: \"/home/docker/copied.txt\")", "==\u003e Audit \u003c==": "==\u003e Audit \u003c==", "==\u003e Last Start \u003c==": "==\u003e Dernier démarrage \u003c==", @@ -408,7 +408,7 @@ "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit driver)": "Nombre de disques supplémentaires créés et attachés à la machine virtuelle minikube (actuellement implémenté uniquement pour le pilote hyperkit)", "Number of lines back to go within the log": "Nombre de lignes à remonter dans le journal", "OS release is {{.pretty_name}}": "La version du système d'exploitation est {{.pretty_name}}", - "One of 'text', 'yaml' or 'json'.": "", + "One of 'text', 'yaml' or 'json'.": "Un parmi 'text', 'yaml' ou 'json'.", "One of 'yaml' or 'json'.": "Un parmi 'yaml' ou 'json'.", "Only alphanumeric and dashes '-' are permitted. Minimum 1 character, starting with alphanumeric.": "Seuls les caractères alphanumériques et les tirets '-' sont autorisés. Minimum 1 caractère, commençant par alphanumérique.", "Only alphanumeric and dashes '-' are permitted. Minimum 2 characters, starting with alphanumeric.": "Seuls les caractères alphanumériques et les tirets '-' sont autorisés. Minimum 2 caractères, commençant par alphanumérique.", @@ -670,7 +670,7 @@ "The requested memory allocation of {{.requested}}MiB does not leave room for system overhead (total system memory: {{.system_limit}}MiB). You may face stability issues.": "L'allocation de mémoire demandée de {{.requested}}MiB ne laisse pas de place pour la surcharge système (mémoire système totale : {{.system_limit}}MiB). Vous pouvez rencontrer des problèmes de stabilité.", "The service namespace": "L'espace de nom du service", "The service {{.service}} requires privileged ports to be exposed: {{.ports}}": "Le service {{.service}} nécessite l'exposition des ports privilégiés : {{.ports}}", - "The service/ingress {{.resource}} requires privileged ports to be exposed: {{.ports}}": "", + "The service/ingress {{.resource}} requires privileged ports to be exposed: {{.ports}}": "Le service/ingress {{.resource}} nécessite l'exposition des ports privilégiés : {{.ports}}", "The services namespace": "L'espace de noms des services", "The time interval for each check that wait performs in seconds": "L'intervalle de temps pour chaque contrôle que wait effectue en secondes", "The value passed to --format is invalid": "La valeur passée à --format n'est pas valide", @@ -863,7 +863,7 @@ "error provisioning host": "erreur lors de l'approvisionnement de l'hôte", "error starting tunnel": "erreur de démarrage du tunnel", "error stopping tunnel": "erreur d'arrêt du tunnel", - "error: --output must be 'text', 'yaml' or 'json'": "", + "error: --output must be 'text', 'yaml' or 'json'": "erreur : --output doit être 'text', 'yaml' ou 'json'", "error: --output must be 'yaml' or 'json'": "erreur : --output doit être 'yaml' ou 'json'", "experimental": "expérimental", "failed to add node": "échec de l'ajout du nœud", From 6892652f34477073a752d90466d48775cffb904f Mon Sep 17 00:00:00 2001 From: minikube-bot Date: Mon, 23 Aug 2021 10:01:54 +0000 Subject: [PATCH 46/53] bump golaint versions --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index da260e6607..9eb0bdba96 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download KERNEL_VERSION ?= 4.19.202 # latest from https://github.com/golangci/golangci-lint/releases # update this only by running `make update-golint-version` -GOLINT_VERSION ?= v1.41.1 +GOLINT_VERSION ?= v1.42.0 # Limit number of default jobs, to avoid the CI builds running out of memory GOLINT_JOBS ?= 4 # see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint From 10dfafeafbfa3270c7f47c23c5f6246b1147fe31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Mon, 23 Aug 2021 18:15:21 +0200 Subject: [PATCH 47/53] Add kubeadm image versions for kubernetes 1.22 Again, the images were wrong in the preload --- pkg/minikube/bootstrapper/images/images.go | 11 ++++++++--- pkg/minikube/bootstrapper/images/images_test.go | 9 +++++++++ pkg/minikube/download/preload.go | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pkg/minikube/bootstrapper/images/images.go b/pkg/minikube/bootstrapper/images/images.go index 8c7de8ef64..f54215d0e5 100644 --- a/pkg/minikube/bootstrapper/images/images.go +++ b/pkg/minikube/bootstrapper/images/images.go @@ -31,8 +31,11 @@ func Pause(v semver.Version, mirror string) string { // Note: changing this logic requires bumping the preload version // Should match `PauseVersion` in: // https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/constants/constants.go - pv := "3.4.1" + pv := "3.5" // https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/constants/constants_unix.go + if semver.MustParseRange("<1.22.0-alpha.3")(v) { + pv = "3.4.1" + } if semver.MustParseRange("<1.21.0-alpha.3")(v) { pv = "3.2" } @@ -71,8 +74,10 @@ func coreDNS(v semver.Version, mirror string) string { if semver.MustParseRange("<1.21.0-alpha.1")(v) { in = "coredns" } - cv := "v1.8.0" + cv := "v1.8.4" switch v.Minor { + case 21: + cv = "v1.8.0" case 20, 19: cv = "1.7.0" case 18: @@ -96,7 +101,7 @@ func etcd(v semver.Version, mirror string) string { // Note: changing this logic requires bumping the preload version // Should match `DefaultEtcdVersion` in: // https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/constants/constants.go - ev := "3.4.13-3" + ev := "3.5.0-0" switch v.Minor { case 19, 20, 21: diff --git a/pkg/minikube/bootstrapper/images/images_test.go b/pkg/minikube/bootstrapper/images/images_test.go index 8075e45d44..e2bed3f86f 100644 --- a/pkg/minikube/bootstrapper/images/images_test.go +++ b/pkg/minikube/bootstrapper/images/images_test.go @@ -65,6 +65,15 @@ k8s.gcr.io/kube-proxy:v1.21.0 k8s.gcr.io/pause:3.4.1 k8s.gcr.io/etcd:3.4.13-0 k8s.gcr.io/coredns/coredns:v1.8.0 +`, "\n"), "\n")}, + {"v1.22.0", strings.Split(strings.Trim(` +k8s.gcr.io/kube-apiserver:v1.22.0 +k8s.gcr.io/kube-controller-manager:v1.22.0 +k8s.gcr.io/kube-scheduler:v1.22.0 +k8s.gcr.io/kube-proxy:v1.22.0 +k8s.gcr.io/pause:3.5 +k8s.gcr.io/etcd:3.5.0-0 +k8s.gcr.io/coredns/coredns:v1.8.4 `, "\n"), "\n")}, } for _, tc := range testCases { diff --git a/pkg/minikube/download/preload.go b/pkg/minikube/download/preload.go index 1f3e09d6ee..428f595e98 100644 --- a/pkg/minikube/download/preload.go +++ b/pkg/minikube/download/preload.go @@ -43,7 +43,7 @@ const ( // PreloadVersion is the current version of the preloaded tarball // // NOTE: You may need to bump this version up when upgrading auxiliary docker images - PreloadVersion = "v11" + PreloadVersion = "v12" // PreloadBucket is the name of the GCS bucket where preloaded volume tarballs exist PreloadBucket = "minikube-preloaded-volume-tarballs" ) From af957cb64d874a081715021646db79f68691f394 Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Mon, 23 Aug 2021 09:48:12 -0700 Subject: [PATCH 48/53] Fix typo. --- site/content/en/docs/faq/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/en/docs/faq/_index.md b/site/content/en/docs/faq/_index.md index 2f38a1fd5e..13b318fd07 100644 --- a/site/content/en/docs/faq/_index.md +++ b/site/content/en/docs/faq/_index.md @@ -95,7 +95,7 @@ Simply run the following command to be enrolled into beta notifications: minikube config set WantBetaUpdateNotification true ``` -## Can I get rid of the emoji in minikube's outpuut? +## Can I get rid of the emoji in minikube's output? Yes! If you prefer not having emoji in your minikube output 😔 , just set the `MINIKUBE_IN_STYLE` environment variable to `0` or `false`: From b17f8efa1230274391a58b6a84f531d8e39f285e Mon Sep 17 00:00:00 2001 From: minikube-bot Date: Mon, 23 Aug 2021 17:27:05 +0000 Subject: [PATCH 49/53] Update auto-generated docs and translations --- translations/de.json | 7 +++++++ translations/es.json | 7 +++++++ translations/fr.json | 9 ++++++++- translations/ja.json | 7 +++++++ translations/ko.json | 7 +++++++ translations/pl.json | 7 +++++++ translations/zh-CN.json | 7 +++++++ 7 files changed, 50 insertions(+), 1 deletion(-) diff --git a/translations/de.json b/translations/de.json index d9327c7d5d..c7407570c8 100644 --- a/translations/de.json +++ b/translations/de.json @@ -250,6 +250,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "", "Failed to remove image": "", "Failed to save config {{.profile}}": "", @@ -261,6 +263,7 @@ "Failed to start container runtime": "", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "", + "Failed to tag images": "", "Failed to update cluster": "", "Failed to update config": "", "Failed unmount: {{.error}}": "", @@ -434,6 +437,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "", @@ -459,8 +463,10 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "Geben Sie die VM-UUID an, um die MAC-Adresse wiederherzustellen (nur Hyperkit-Treiber)", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "", "Rebuild libvirt with virt-network support": "", @@ -579,6 +585,7 @@ "Successfully stopped node {{.name}}": "", "Suggestion: {{.advice}}": "", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "", "Target {{.path}} can not be empty": "", diff --git a/translations/es.json b/translations/es.json index 2b00fa95ad..d3a662c985 100644 --- a/translations/es.json +++ b/translations/es.json @@ -256,6 +256,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "", "Failed to remove image": "", "Failed to save config {{.profile}}": "", @@ -267,6 +269,7 @@ "Failed to start container runtime": "", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "", + "Failed to tag images": "", "Failed to update cluster": "", "Failed to update config": "", "Failed unmount: {{.error}}": "", @@ -440,6 +443,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "", @@ -465,8 +469,10 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "Permite especificar un UUID de VM para restaurar la dirección MAC (solo con el controlador de hyperkit)", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "", "Rebuild libvirt with virt-network support": "", @@ -585,6 +591,7 @@ "Successfully stopped node {{.name}}": "", "Suggestion: {{.advice}}": "", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "", "Target {{.path}} can not be empty": "", diff --git a/translations/fr.json b/translations/fr.json index 6a8fd1a266..7e7d5bc396 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -254,6 +254,8 @@ "Failed to load image": "Échec du chargement de l'image", "Failed to persist images": "Échec de la persistance des images", "Failed to pull image": "Échec de l'extraction de l'image", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "Échec du rechargement des images mises en cache", "Failed to remove image": "Échec de la suppression de l'image", "Failed to save config {{.profile}}": "Échec de l'enregistrement de la configuration {{.profile}}", @@ -265,6 +267,7 @@ "Failed to start container runtime": "Échec du démarrage de l'exécution du conteneur", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "Échec du démarrage de {{.driver}} {{.driver_type}}. L'exécution de \"{{.cmd}}\" peut résoudre le problème : {{.error}}", "Failed to stop node {{.name}}": "Échec de l'arrêt du nœud {{.name}}", + "Failed to tag images": "", "Failed to update cluster": "Échec de la mise à jour du cluster", "Failed to update config": "Échec de la mise à jour de la configuration", "Failed to verify '{{.driver_name}} info' will try again ...": "Échec de la vérification des informations sur '{{.driver_name}}' va réessayer ...", @@ -440,6 +443,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "Veuillez vous assurer que le service que vous recherchez est déployé ou se trouve dans le bon espace de noms.", "Please provide a path or url to build": "Veuillez fournir un chemin ou une URL à construire", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "Veuillez fournir une image dans votre démon local à charger dans minikube via \u003cminikube image load IMAGE_NAME\u003e", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "Veuillez réévaluer votre docker-env, pour vous assurer que vos variables d'environnement ont des ports mis à jour :\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "Veuillez réévaluer votre podman-env, pour vous assurer que vos variables d'environnement ont des ports mis à jour :\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t", "Please see {{.documentation_url}} for more details": "Veuillez consulter {{.documentation_url}} pour plus de détails", @@ -465,9 +469,11 @@ "Profile name '{{.profilename}}' is not valid": "Le nom de profil '{{.profilename}}' n'est pas valide", "Profile name should be unique": "Le nom du profil doit être unique", "Provide VM UUID to restore MAC address (hyperkit driver only)": "Fournit l'identifiant unique universel (UUID) de la VM pour restaurer l'adresse MAC (pilote hyperkit uniquement).", + "Pull images": "", "Pull the remote image (no caching)": "Extraire l'image distante (pas de mise en cache)", "Pulling base image ...": "Extraction de l'image de base...", "Pulling images ...": "Extraction des images... ", + "Push images": "", "Push the new image (requires tag)": "Pousser la nouvelle image (nécessite une balise)", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "Redémarrez pour terminer l'installation de VirtualBox, vérifiez que VirtualBox n'est pas bloqué par votre système et/ou utilisez un autre hyperviseur", "Rebuild libvirt with virt-network support": "Reconstruire libvirt avec le support de virt-network", @@ -587,6 +593,7 @@ "Successfully stopped node {{.name}}": "Nœud {{.name}} arrêté avec succès", "Suggestion: {{.advice}}": "Suggestion : {{.advice}}", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "Le système n'a que {{.size}} Mio disponibles, moins que les {{.req}} Mio requis pour Kubernetes", + "Tag images": "", "Tag to apply to the new image (optional)": "Tag à appliquer à la nouvelle image (facultatif)", "Target directory {{.path}} must be an absolute path": "Le répertoire cible {{.path}} doit être un chemin absolu", "Target {{.path}} can not be empty": "La cible {{.path}} ne peut pas être vide", @@ -969,4 +976,4 @@ "{{.profile}} profile is not valid: {{.err}}": "Le profil {{.profile}} n'est pas valide : {{.err}}", "{{.type}} is not yet a supported filesystem. We will try anyways!": "{{.type}} n'est pas encore un système de fichiers pris en charge. Nous essaierons quand même !", "{{.url}} is not accessible: {{.error}}": "{{.url}} n'est pas accessible : {{.error}}" -} +} \ No newline at end of file diff --git a/translations/ja.json b/translations/ja.json index fb37609938..331116505a 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -244,6 +244,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "", "Failed to remove image": "", "Failed to save config {{.profile}}": "", @@ -254,6 +256,7 @@ "Failed to start container runtime": "", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "", + "Failed to tag images": "", "Failed to update cluster": "", "Failed to update config": "", "Failed unmount: {{.error}}": "", @@ -431,6 +434,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "", @@ -456,8 +460,10 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "MAC アドレスを復元するための VM UUID を指定します(hyperkit ドライバのみ)", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "イメージを Pull しています...", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "", "Rebuild libvirt with virt-network support": "", @@ -579,6 +585,7 @@ "Suggestion: {{.advice}}": "提案: {{.advice}}", "Suggestion: {{.fix}}": "提案: {{.fix}}", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "", "Target {{.path}} can not be empty": "", diff --git a/translations/ko.json b/translations/ko.json index c88d31db6d..f3a35395f1 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -271,6 +271,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "캐시된 이미지를 다시 불러오는 데 실패하였습니다", "Failed to remove image": "", "Failed to save config": "컨피그 저장에 실패하였습니다", @@ -284,6 +286,7 @@ "Failed to start node {{.name}}": "노드 {{.name}} 시작에 실패하였습니다", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "노드 {{.name}} 중지에 실패하였습니다", + "Failed to tag images": "", "Failed to update cluster": "클러스터를 수정하는 데 실패하였습니다", "Failed to update config": "컨피그를 수정하는 데 실패하였습니다", "Failed unmount: {{.error}}": "마운트 해제에 실패하였습니다: {{.error}}", @@ -455,6 +458,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "", @@ -479,8 +483,10 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "베이스 이미지를 다운받는 중 ...", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "", "Rebuild libvirt with virt-network support": "", @@ -601,6 +607,7 @@ "Successfully stopped node {{.name}}": "{{.name}} 노드가 정상적으로 중지되었습니다", "Suggestion: {{.advice}}": "권장: {{.advice}}", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "타겟 폴더 {{.path}} 는 절대 경로여야 합니다", "Target {{.path}} can not be empty": "", diff --git a/translations/pl.json b/translations/pl.json index 206d775652..1ac201e79c 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -258,6 +258,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "", "Failed to remove image": "", "Failed to remove profile": "Usunięcie profilu nie powiodło się", @@ -271,6 +273,7 @@ "Failed to start container runtime": "", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "", + "Failed to tag images": "", "Failed to update cluster": "Aktualizacja klastra nie powiodła się", "Failed to update config": "Aktualizacja konfiguracji nie powiodła się", "Failed unmount: {{.error}}": "", @@ -448,6 +451,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "Proszę upewnij się, że serwis którego szukasz znajduje się w prawidłowej przestrzeni nazw", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "Zobacz {{.documentation_url}} żeby uzyskać więcej informacji", @@ -474,8 +478,10 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, and verify that VirtualBox is not blocked by your system": "Uruchom ponownie komputer aby zakończyć instalację VirtualBox'a i upewnij się, że nie jest on blokowany przez twój system", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "", @@ -600,6 +606,7 @@ "Successfully stopped node {{.name}}": "", "Suggestion: {{.advice}}": "Sugestia: {{.advice}}", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "", "Target {{.path}} can not be empty": "", diff --git a/translations/zh-CN.json b/translations/zh-CN.json index 50858be631..1cd5e409e5 100644 --- a/translations/zh-CN.json +++ b/translations/zh-CN.json @@ -321,6 +321,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "重新加载缓存镜像失败", "Failed to remove image": "", "Failed to remove profile": "无法删除配置文件", @@ -335,6 +337,7 @@ "Failed to start container runtime": "", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "", + "Failed to tag images": "", "Failed to update cluster": "更新 cluster 失败", "Failed to update config": "更新 config 失败", "Failed unmount: {{.error}}": "unmount 失败:{{.error}}", @@ -522,6 +525,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "", @@ -549,9 +553,11 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "提供虚拟机 UUID 以恢复 MAC 地址(仅限 hyperkit 驱动程序)", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "", "Pulling images ...": "拉取镜像 ...", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "重启以完成 VirtualBox 安装,检查 VirtualBox 未被您的操作系统禁用,或者使用其他的管理程序。", "Rebuild libvirt with virt-network support": "", @@ -684,6 +690,7 @@ "Suggestion: {{.advice}}": "建议:{{.advice}}", "Suggestion: {{.fix}}": "建议:{{.fix}}", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "", "Target {{.path}} can not be empty": "", From 42818923b33686a2c050fbce3223b5e7e18d9ba3 Mon Sep 17 00:00:00 2001 From: minikube-bot Date: Mon, 23 Aug 2021 20:03:56 +0000 Subject: [PATCH 50/53] Update auto-generated docs and translations --- translations/de.json | 7 +++++++ translations/es.json | 7 +++++++ translations/fr.json | 9 ++++++++- translations/ja.json | 7 +++++++ translations/ko.json | 7 +++++++ translations/pl.json | 7 +++++++ translations/zh-CN.json | 7 +++++++ 7 files changed, 50 insertions(+), 1 deletion(-) diff --git a/translations/de.json b/translations/de.json index d9327c7d5d..c7407570c8 100644 --- a/translations/de.json +++ b/translations/de.json @@ -250,6 +250,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "", "Failed to remove image": "", "Failed to save config {{.profile}}": "", @@ -261,6 +263,7 @@ "Failed to start container runtime": "", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "", + "Failed to tag images": "", "Failed to update cluster": "", "Failed to update config": "", "Failed unmount: {{.error}}": "", @@ -434,6 +437,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "", @@ -459,8 +463,10 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "Geben Sie die VM-UUID an, um die MAC-Adresse wiederherzustellen (nur Hyperkit-Treiber)", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "", "Rebuild libvirt with virt-network support": "", @@ -579,6 +585,7 @@ "Successfully stopped node {{.name}}": "", "Suggestion: {{.advice}}": "", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "", "Target {{.path}} can not be empty": "", diff --git a/translations/es.json b/translations/es.json index 2b00fa95ad..d3a662c985 100644 --- a/translations/es.json +++ b/translations/es.json @@ -256,6 +256,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "", "Failed to remove image": "", "Failed to save config {{.profile}}": "", @@ -267,6 +269,7 @@ "Failed to start container runtime": "", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "", + "Failed to tag images": "", "Failed to update cluster": "", "Failed to update config": "", "Failed unmount: {{.error}}": "", @@ -440,6 +443,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "", @@ -465,8 +469,10 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "Permite especificar un UUID de VM para restaurar la dirección MAC (solo con el controlador de hyperkit)", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "", "Rebuild libvirt with virt-network support": "", @@ -585,6 +591,7 @@ "Successfully stopped node {{.name}}": "", "Suggestion: {{.advice}}": "", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "", "Target {{.path}} can not be empty": "", diff --git a/translations/fr.json b/translations/fr.json index 6a8fd1a266..7e7d5bc396 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -254,6 +254,8 @@ "Failed to load image": "Échec du chargement de l'image", "Failed to persist images": "Échec de la persistance des images", "Failed to pull image": "Échec de l'extraction de l'image", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "Échec du rechargement des images mises en cache", "Failed to remove image": "Échec de la suppression de l'image", "Failed to save config {{.profile}}": "Échec de l'enregistrement de la configuration {{.profile}}", @@ -265,6 +267,7 @@ "Failed to start container runtime": "Échec du démarrage de l'exécution du conteneur", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "Échec du démarrage de {{.driver}} {{.driver_type}}. L'exécution de \"{{.cmd}}\" peut résoudre le problème : {{.error}}", "Failed to stop node {{.name}}": "Échec de l'arrêt du nœud {{.name}}", + "Failed to tag images": "", "Failed to update cluster": "Échec de la mise à jour du cluster", "Failed to update config": "Échec de la mise à jour de la configuration", "Failed to verify '{{.driver_name}} info' will try again ...": "Échec de la vérification des informations sur '{{.driver_name}}' va réessayer ...", @@ -440,6 +443,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "Veuillez vous assurer que le service que vous recherchez est déployé ou se trouve dans le bon espace de noms.", "Please provide a path or url to build": "Veuillez fournir un chemin ou une URL à construire", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "Veuillez fournir une image dans votre démon local à charger dans minikube via \u003cminikube image load IMAGE_NAME\u003e", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "Veuillez réévaluer votre docker-env, pour vous assurer que vos variables d'environnement ont des ports mis à jour :\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "Veuillez réévaluer votre podman-env, pour vous assurer que vos variables d'environnement ont des ports mis à jour :\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t", "Please see {{.documentation_url}} for more details": "Veuillez consulter {{.documentation_url}} pour plus de détails", @@ -465,9 +469,11 @@ "Profile name '{{.profilename}}' is not valid": "Le nom de profil '{{.profilename}}' n'est pas valide", "Profile name should be unique": "Le nom du profil doit être unique", "Provide VM UUID to restore MAC address (hyperkit driver only)": "Fournit l'identifiant unique universel (UUID) de la VM pour restaurer l'adresse MAC (pilote hyperkit uniquement).", + "Pull images": "", "Pull the remote image (no caching)": "Extraire l'image distante (pas de mise en cache)", "Pulling base image ...": "Extraction de l'image de base...", "Pulling images ...": "Extraction des images... ", + "Push images": "", "Push the new image (requires tag)": "Pousser la nouvelle image (nécessite une balise)", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "Redémarrez pour terminer l'installation de VirtualBox, vérifiez que VirtualBox n'est pas bloqué par votre système et/ou utilisez un autre hyperviseur", "Rebuild libvirt with virt-network support": "Reconstruire libvirt avec le support de virt-network", @@ -587,6 +593,7 @@ "Successfully stopped node {{.name}}": "Nœud {{.name}} arrêté avec succès", "Suggestion: {{.advice}}": "Suggestion : {{.advice}}", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "Le système n'a que {{.size}} Mio disponibles, moins que les {{.req}} Mio requis pour Kubernetes", + "Tag images": "", "Tag to apply to the new image (optional)": "Tag à appliquer à la nouvelle image (facultatif)", "Target directory {{.path}} must be an absolute path": "Le répertoire cible {{.path}} doit être un chemin absolu", "Target {{.path}} can not be empty": "La cible {{.path}} ne peut pas être vide", @@ -969,4 +976,4 @@ "{{.profile}} profile is not valid: {{.err}}": "Le profil {{.profile}} n'est pas valide : {{.err}}", "{{.type}} is not yet a supported filesystem. We will try anyways!": "{{.type}} n'est pas encore un système de fichiers pris en charge. Nous essaierons quand même !", "{{.url}} is not accessible: {{.error}}": "{{.url}} n'est pas accessible : {{.error}}" -} +} \ No newline at end of file diff --git a/translations/ja.json b/translations/ja.json index fb37609938..331116505a 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -244,6 +244,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "", "Failed to remove image": "", "Failed to save config {{.profile}}": "", @@ -254,6 +256,7 @@ "Failed to start container runtime": "", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "", + "Failed to tag images": "", "Failed to update cluster": "", "Failed to update config": "", "Failed unmount: {{.error}}": "", @@ -431,6 +434,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "", @@ -456,8 +460,10 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "MAC アドレスを復元するための VM UUID を指定します(hyperkit ドライバのみ)", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "イメージを Pull しています...", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "", "Rebuild libvirt with virt-network support": "", @@ -579,6 +585,7 @@ "Suggestion: {{.advice}}": "提案: {{.advice}}", "Suggestion: {{.fix}}": "提案: {{.fix}}", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "", "Target {{.path}} can not be empty": "", diff --git a/translations/ko.json b/translations/ko.json index c88d31db6d..f3a35395f1 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -271,6 +271,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "캐시된 이미지를 다시 불러오는 데 실패하였습니다", "Failed to remove image": "", "Failed to save config": "컨피그 저장에 실패하였습니다", @@ -284,6 +286,7 @@ "Failed to start node {{.name}}": "노드 {{.name}} 시작에 실패하였습니다", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "노드 {{.name}} 중지에 실패하였습니다", + "Failed to tag images": "", "Failed to update cluster": "클러스터를 수정하는 데 실패하였습니다", "Failed to update config": "컨피그를 수정하는 데 실패하였습니다", "Failed unmount: {{.error}}": "마운트 해제에 실패하였습니다: {{.error}}", @@ -455,6 +458,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "", @@ -479,8 +483,10 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "베이스 이미지를 다운받는 중 ...", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "", "Rebuild libvirt with virt-network support": "", @@ -601,6 +607,7 @@ "Successfully stopped node {{.name}}": "{{.name}} 노드가 정상적으로 중지되었습니다", "Suggestion: {{.advice}}": "권장: {{.advice}}", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "타겟 폴더 {{.path}} 는 절대 경로여야 합니다", "Target {{.path}} can not be empty": "", diff --git a/translations/pl.json b/translations/pl.json index 206d775652..1ac201e79c 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -258,6 +258,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "", "Failed to remove image": "", "Failed to remove profile": "Usunięcie profilu nie powiodło się", @@ -271,6 +273,7 @@ "Failed to start container runtime": "", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "", + "Failed to tag images": "", "Failed to update cluster": "Aktualizacja klastra nie powiodła się", "Failed to update config": "Aktualizacja konfiguracji nie powiodła się", "Failed unmount: {{.error}}": "", @@ -448,6 +451,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "Proszę upewnij się, że serwis którego szukasz znajduje się w prawidłowej przestrzeni nazw", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "Zobacz {{.documentation_url}} żeby uzyskać więcej informacji", @@ -474,8 +478,10 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, and verify that VirtualBox is not blocked by your system": "Uruchom ponownie komputer aby zakończyć instalację VirtualBox'a i upewnij się, że nie jest on blokowany przez twój system", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "", @@ -600,6 +606,7 @@ "Successfully stopped node {{.name}}": "", "Suggestion: {{.advice}}": "Sugestia: {{.advice}}", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "", "Target {{.path}} can not be empty": "", diff --git a/translations/zh-CN.json b/translations/zh-CN.json index 50858be631..1cd5e409e5 100644 --- a/translations/zh-CN.json +++ b/translations/zh-CN.json @@ -321,6 +321,8 @@ "Failed to load image": "", "Failed to persist images": "", "Failed to pull image": "", + "Failed to pull images": "", + "Failed to push images": "", "Failed to reload cached images": "重新加载缓存镜像失败", "Failed to remove image": "", "Failed to remove profile": "无法删除配置文件", @@ -335,6 +337,7 @@ "Failed to start container runtime": "", "Failed to start {{.driver}} {{.driver_type}}. Running \"{{.cmd}}\" may fix it: {{.error}}": "", "Failed to stop node {{.name}}": "", + "Failed to tag images": "", "Failed to update cluster": "更新 cluster 失败", "Failed to update config": "更新 config 失败", "Failed unmount: {{.error}}": "unmount 失败:{{.error}}", @@ -522,6 +525,7 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please provide a path or url to build": "", "Please provide an image in your local daemon to load into minikube via \u003cminikube image load IMAGE_NAME\u003e": "", + "Please provide source and target image": "", "Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "", "Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "", "Please see {{.documentation_url}} for more details": "", @@ -549,9 +553,11 @@ "Profile name '{{.profilename}}' is not valid": "", "Profile name should be unique": "", "Provide VM UUID to restore MAC address (hyperkit driver only)": "提供虚拟机 UUID 以恢复 MAC 地址(仅限 hyperkit 驱动程序)", + "Pull images": "", "Pull the remote image (no caching)": "", "Pulling base image ...": "", "Pulling images ...": "拉取镜像 ...", + "Push images": "", "Push the new image (requires tag)": "", "Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor": "重启以完成 VirtualBox 安装,检查 VirtualBox 未被您的操作系统禁用,或者使用其他的管理程序。", "Rebuild libvirt with virt-network support": "", @@ -684,6 +690,7 @@ "Suggestion: {{.advice}}": "建议:{{.advice}}", "Suggestion: {{.fix}}": "建议:{{.fix}}", "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", + "Tag images": "", "Tag to apply to the new image (optional)": "", "Target directory {{.path}} must be an absolute path": "", "Target {{.path}} can not be empty": "", From d261d4a855302b5439704267db3be04467058304 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Mon, 23 Aug 2021 13:41:53 -0700 Subject: [PATCH 51/53] fix changed files output for github actions --- .github/workflows/docs.yml | 6 +++++- .github/workflows/leaderboard.yml | 6 +++++- .github/workflows/update-k8s-versions.yml | 7 ++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index dc6e2dc393..10415104ef 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,7 +20,10 @@ jobs: id: gendocs run: | make generate-docs - echo "::set-output name=changes::$(git status --porcelain)" + c=$(git status --porcelain) + c="${c//$'\n'/'%0A'}" + c="${c//$'\r'/'%0D'}" + echo "::set-output name=changes::$c" - name: Create PR if: ${{ steps.gendocs.outputs.changes != '' }} uses: peter-evans/create-pull-request@v3 @@ -37,6 +40,7 @@ jobs: body: | Committing changes resulting from `make generate-docs`. This PR is auto-generated by the [gendocs](https://github.com/kubernetes/minikube/blob/master/.github/workflows/docs.yml) CI workflow. + ``` ${{ steps.gendocs.outputs.changes }} ``` diff --git a/.github/workflows/leaderboard.yml b/.github/workflows/leaderboard.yml index 38c118625f..0c78b6e87e 100644 --- a/.github/workflows/leaderboard.yml +++ b/.github/workflows/leaderboard.yml @@ -21,7 +21,10 @@ jobs: id: leaderboard run: | make update-leaderboard - echo "::set-output name=changes::$(git status --porcelain)" + c=$(git status --porcelain) + c="${c//$'\n'/'%0A'}" + c="${c//$'\r'/'%0D'}" + echo "::set-output name=changes::$c" env: GITHUB_TOKEN: ${{ secrets.MINIKUBE_BOT_PAT }} - name: Create PR @@ -40,6 +43,7 @@ jobs: body: | Committing changes resulting from `make update-leaderboard`. This PR is auto-generated by the [update-leaderboard](https://github.com/kubernetes/minikube/blob/master/.github/workflows/leaderboard.yml) CI workflow. + ``` ${{ steps.leaderboard.outputs.changes }} ``` diff --git a/.github/workflows/update-k8s-versions.yml b/.github/workflows/update-k8s-versions.yml index 97b4a6043e..d94302a62a 100644 --- a/.github/workflows/update-k8s-versions.yml +++ b/.github/workflows/update-k8s-versions.yml @@ -20,7 +20,10 @@ jobs: id: bumpk8s run: | make update-kubernetes-version - echo "::set-output name=changes::$(git status --porcelain)" + c=$(git status --porcelain) + c="${c//$'\n'/'%0A'}" + c="${c//$'\r'/'%0D'}" + echo "::set-output name=changes::$c" - name: Create PR if: ${{ steps.bumpk8s.outputs.changes != '' }} uses: peter-evans/create-pull-request@v3 @@ -39,5 +42,7 @@ jobs: This PR was auto-generated by `make update-kubernetes-version` using [update-k8s-versions.yml](https://github.com/kubernetes/minikube/tree/master/.github/workflows) CI Workflow. Please only merge if all the tests pass. + ``` ${{ steps.bumpk8s.outputs.changes }} + ``` From 8470a955db0fa9a1e21fc584ff915fd7dd037fb1 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Mon, 23 Aug 2021 14:06:23 -0700 Subject: [PATCH 52/53] error handling\! --- cmd/minikube/cmd/start_flags.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index e95316895a..f87fd108e6 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -482,8 +482,14 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, drvName s } if detect.IsCloudShell() { - cc.KubernetesConfig.ExtraOptions.Set("kubelet.cgroups-per-qos=false") - cc.KubernetesConfig.ExtraOptions.Set("kubelet.enforce-node-allocatable=\"\"") + err := cc.KubernetesConfig.ExtraOptions.Set("kubelet.cgroups-per-qos=false") + if err != nil { + exit.Error(reason.InternalConfigSet, "failed to set cloud shell kubelet config options", err) + } + err = cc.KubernetesConfig.ExtraOptions.Set("kubelet.enforce-node-allocatable=\"\"") + if err != nil { + exit.Error(reason.InternalConfigSet, "failed to set cloud shell kubelet config options", err) + } } return cc From 77461f730e822878c93bf3bed60b301cc5007043 Mon Sep 17 00:00:00 2001 From: minikube-bot Date: Mon, 23 Aug 2021 22:33:04 +0000 Subject: [PATCH 53/53] Update auto-generated docs and translations --- translations/de.json | 1 + translations/es.json | 1 + translations/fr.json | 1 + translations/ja.json | 1 + translations/ko.json | 1 + translations/pl.json | 1 + translations/strings.txt | 1 + translations/zh-CN.json | 1 + 8 files changed, 8 insertions(+) diff --git a/translations/de.json b/translations/de.json index c7407570c8..960f99c0a6 100644 --- a/translations/de.json +++ b/translations/de.json @@ -862,6 +862,7 @@ "failed to add node": "", "failed to open browser: {{.error}}": "", "failed to save config": "", + "failed to set cloud shell kubelet config options": "", "failed to start node": "", "fish completion failed": "", "fish completion.": "", diff --git a/translations/es.json b/translations/es.json index d3a662c985..e7934d2f44 100644 --- a/translations/es.json +++ b/translations/es.json @@ -868,6 +868,7 @@ "failed to add node": "", "failed to open browser: {{.error}}": "", "failed to save config": "", + "failed to set cloud shell kubelet config options": "", "failed to start node": "", "fish completion failed": "", "fish completion.": "", diff --git a/translations/fr.json b/translations/fr.json index 7e7d5bc396..1f463da5f3 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -876,6 +876,7 @@ "failed to add node": "échec de l'ajout du nœud", "failed to open browser: {{.error}}": "échec de l'ouverture du navigateur : {{.error}}", "failed to save config": "échec de l'enregistrement de la configuration", + "failed to set cloud shell kubelet config options": "", "failed to start node": "échec du démarrage du nœud", "fish completion failed": "la complétion fish a échoué", "fish completion.": "complétion fish.", diff --git a/translations/ja.json b/translations/ja.json index 331116505a..da85a27a4f 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -870,6 +870,7 @@ "failed to add node": "", "failed to open browser: {{.error}}": "ブラウザを起動するのに失敗しました。 {{.error}}", "failed to save config": "", + "failed to set cloud shell kubelet config options": "", "failed to start node": "", "fish completion failed": "", "fish completion.": "", diff --git a/translations/ko.json b/translations/ko.json index f3a35395f1..88c4762012 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -872,6 +872,7 @@ "failed to add node": "", "failed to open browser: {{.error}}": "", "failed to save config": "", + "failed to set cloud shell kubelet config options": "", "failed to start node": "", "fish completion failed": "", "fish completion.": "", diff --git a/translations/pl.json b/translations/pl.json index 1ac201e79c..c17ea50253 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -878,6 +878,7 @@ "failed to add node": "", "failed to open browser: {{.error}}": "Nie udało się otworzyć przeglądarki: {{.error}}", "failed to save config": "", + "failed to set cloud shell kubelet config options": "", "failed to start node": "", "fish completion failed": "", "fish completion.": "", diff --git a/translations/strings.txt b/translations/strings.txt index c22e44bce8..8d29cea872 100644 --- a/translations/strings.txt +++ b/translations/strings.txt @@ -807,6 +807,7 @@ "failed to add node": "", "failed to open browser: {{.error}}": "", "failed to save config": "", + "failed to set cloud shell kubelet config options": "", "failed to start node": "", "fish completion failed": "", "fish completion.": "", diff --git a/translations/zh-CN.json b/translations/zh-CN.json index 1cd5e409e5..1690f42703 100644 --- a/translations/zh-CN.json +++ b/translations/zh-CN.json @@ -984,6 +984,7 @@ "failed to add node": "", "failed to open browser: {{.error}}": "", "failed to save config": "", + "failed to set cloud shell kubelet config options": "", "failed to start node": "", "fish completion failed": "", "fish completion.": "",