mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Merge pull request #6790 from nikhiljindal/encoder
Removing references to v1beta1 from hack/ and test/
This commit is contained in:
commit
29e68ad392
@ -73,40 +73,44 @@ function start_service() {
|
|||||||
echo "Starting service '$1' on port $2 with $3 replicas"
|
echo "Starting service '$1' on port $2 with $3 replicas"
|
||||||
svcs_to_clean+=("$1")
|
svcs_to_clean+=("$1")
|
||||||
${KUBECTL} create -f - << __EOF__
|
${KUBECTL} create -f - << __EOF__
|
||||||
{
|
{
|
||||||
"kind": "ReplicationController",
|
"kind": "ReplicationController",
|
||||||
"apiVersion": "v1beta1",
|
"apiVersion": "v1beta3",
|
||||||
"id": "$1",
|
"metadata": {
|
||||||
"namespace": "default",
|
"name": "$1",
|
||||||
"desiredState": {
|
"namespace": "default",
|
||||||
"replicas": $3,
|
"labels": {
|
||||||
"replicaSelector": {
|
"name": "$1"
|
||||||
"name": "$1"
|
}
|
||||||
},
|
},
|
||||||
"podTemplate": {
|
"spec": {
|
||||||
"desiredState": {
|
"replicas": $3,
|
||||||
"manifest": {
|
"selector": {
|
||||||
"version": "v1beta2",
|
"name": "$1"
|
||||||
"containers": [
|
},
|
||||||
{
|
"template": {
|
||||||
"name": "$1",
|
"metadata": {
|
||||||
"image": "gcr.io/google_containers/serve_hostname:1.1",
|
"labels": {
|
||||||
"ports": [
|
"name": "$1"
|
||||||
{
|
}
|
||||||
"containerPort": 9376,
|
},
|
||||||
"protocol": "TCP"
|
"spec": {
|
||||||
}
|
"containers": [
|
||||||
]
|
{
|
||||||
}
|
"name": "$1",
|
||||||
]
|
"image": "gcr.io/google_containers/serve_hostname:1.1",
|
||||||
}
|
"ports": [
|
||||||
},
|
{
|
||||||
"labels": {
|
"containerPort": 9376,
|
||||||
"name": "$1"
|
"protocol": "TCP"
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
__EOF__
|
__EOF__
|
||||||
# Convert '1.2.3.4 5.6.7.8' => '"1.2.3.4", "5.6.7.8"'
|
# Convert '1.2.3.4 5.6.7.8' => '"1.2.3.4", "5.6.7.8"'
|
||||||
local ip ips_array=() public_ips
|
local ip ips_array=() public_ips
|
||||||
@ -115,22 +119,30 @@ __EOF__
|
|||||||
done
|
done
|
||||||
public_ips=$(join ", " "${ips_array[@]:+${ips_array[@]}}")
|
public_ips=$(join ", " "${ips_array[@]:+${ips_array[@]}}")
|
||||||
${KUBECTL} create -f - << __EOF__
|
${KUBECTL} create -f - << __EOF__
|
||||||
|
{
|
||||||
|
"kind": "Service",
|
||||||
|
"apiVersion": "v1beta3",
|
||||||
|
"metadata": {
|
||||||
|
"name": "$1",
|
||||||
|
"namespace": "default",
|
||||||
|
"labels": {
|
||||||
|
"name": "$1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"ports": [
|
||||||
{
|
{
|
||||||
"kind": "Service",
|
"protocol": "TCP",
|
||||||
"apiVersion": "v1beta1",
|
"port": $2,
|
||||||
"id": "$1",
|
"targetPort": 9376
|
||||||
"namespace": "default",
|
|
||||||
"port": $2,
|
|
||||||
"protocol": "TCP",
|
|
||||||
"labels": {
|
|
||||||
"name": "$1"
|
|
||||||
},
|
|
||||||
"selector": {
|
|
||||||
"name": "$1"
|
|
||||||
},
|
|
||||||
"containerPort": 9376,
|
|
||||||
"publicIPs": [ ${public_ips} ]
|
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"selector": {
|
||||||
|
"name": "$1"
|
||||||
|
},
|
||||||
|
"publicIPs": [ ${public_ips} ]
|
||||||
|
}
|
||||||
|
}
|
||||||
__EOF__
|
__EOF__
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ kube::log::status "Starting CONTROLLER-MANAGER"
|
|||||||
CTLRMGR_PID=$!
|
CTLRMGR_PID=$!
|
||||||
|
|
||||||
kube::util::wait_for_url "http://127.0.0.1:${CTLRMGR_PORT}/healthz" "controller-manager: "
|
kube::util::wait_for_url "http://127.0.0.1:${CTLRMGR_PORT}/healthz" "controller-manager: "
|
||||||
kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/api/v1beta1/minions/127.0.0.1" "apiserver(minions): " 0.2 25
|
kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/api/v1beta3/nodes/127.0.0.1" "apiserver(nodes): " 0.2 25
|
||||||
|
|
||||||
# Expose kubectl directly for readability
|
# Expose kubectl directly for readability
|
||||||
PATH="${KUBE_OUTPUT_HOSTBIN}":$PATH
|
PATH="${KUBE_OUTPUT_HOSTBIN}":$PATH
|
||||||
@ -170,7 +170,7 @@ for version in "${kube_api_versions[@]}"; do
|
|||||||
kube::test::describe_object_assert pods 'valid-pod' "Name:" "Image(s):" "Host:" "Labels:" "Status:" "Replication Controllers"
|
kube::test::describe_object_assert pods 'valid-pod' "Name:" "Image(s):" "Host:" "Labels:" "Status:" "Replication Controllers"
|
||||||
|
|
||||||
### Dump current valid-pod POD
|
### Dump current valid-pod POD
|
||||||
output_pod=$(kubectl get pod valid-pod -o yaml --output-version=v1beta1 "${kube_flags[@]}")
|
output_pod=$(kubectl get pod valid-pod -o yaml --output-version=v1beta3 "${kube_flags[@]}")
|
||||||
|
|
||||||
### Delete POD valid-pod by id
|
### Delete POD valid-pod by id
|
||||||
# Pre-condition: valid-pod POD is running
|
# Pre-condition: valid-pod POD is running
|
||||||
@ -396,22 +396,29 @@ for version in "${kube_api_versions[@]}"; do
|
|||||||
kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:'
|
kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:'
|
||||||
# Command
|
# Command
|
||||||
kubectl create -f - "${kube_flags[@]}" << __EOF__
|
kubectl create -f - "${kube_flags[@]}" << __EOF__
|
||||||
|
{
|
||||||
|
"kind": "Service",
|
||||||
|
"apiVersion": "v1beta3",
|
||||||
|
"metadata": {
|
||||||
|
"name": "service-${version}-test"
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"ports": [
|
||||||
{
|
{
|
||||||
"kind": "Service",
|
"protocol": "TCP",
|
||||||
"apiVersion": "v1beta1",
|
"port": 80,
|
||||||
"id": "service-${version}-test",
|
"targetPort": 80
|
||||||
"port": 80,
|
|
||||||
"protocol": "TCP"
|
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
__EOF__
|
__EOF__
|
||||||
# Post-condition:redis-master-service service is running
|
# Post-condition:redis-master-service service is running
|
||||||
kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:service-.*-test:'
|
kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:kubernetes-ro:redis-master:service-.*-test:'
|
||||||
|
|
||||||
# Command
|
# Command
|
||||||
kubectl update service "${kube_flags[@]}" service-${version}-test --patch="{\"selector\":{\"my\":\"test-label\"},\"apiVersion\":\"v1beta1\"}"
|
kubectl update service "${kube_flags[@]}" service-${version}-test --patch="{\"spec\":{\"selector\":{\"my\":\"test-label\"}},\"apiVersion\":\"v1beta3\"}" --api-version=v1beta3
|
||||||
# Post-condition: selector.version == ${version}
|
# Post-condition: selector has "test-label" label.
|
||||||
# This test works only in v1beta1 and v1beta2
|
|
||||||
# https://github.com/GoogleCloudPlatform/kubernetes/issues/4771
|
|
||||||
kube::test::get_object_assert "service service-${version}-test" "{{range$service_selector_field}}{{.}}{{end}}" "test-label"
|
kube::test::get_object_assert "service service-${version}-test" "{{range$service_selector_field}}{{.}}{{end}}" "test-label"
|
||||||
|
|
||||||
### Identity
|
### Identity
|
||||||
|
@ -58,7 +58,7 @@ func CheckCadvisorHealthOnAllNodes(c *client.Client, timeout time.Duration) {
|
|||||||
for _, node := range nodeList.Items {
|
for _, node := range nodeList.Items {
|
||||||
// cadvisor is not accessible directly unless its port (4194 by default) is exposed.
|
// cadvisor is not accessible directly unless its port (4194 by default) is exposed.
|
||||||
// Here, we access '/stats/' REST endpoint on the kubelet which polls cadvisor internally.
|
// Here, we access '/stats/' REST endpoint on the kubelet which polls cadvisor internally.
|
||||||
statsResource := fmt.Sprintf("api/v1beta1/proxy/minions/%s/stats/", node.Name)
|
statsResource := fmt.Sprintf("api/v1beta3/proxy/nodes/%s/stats/", node.Name)
|
||||||
By(fmt.Sprintf("Querying stats from node %s using url %s", node.Name, statsResource))
|
By(fmt.Sprintf("Querying stats from node %s using url %s", node.Name, statsResource))
|
||||||
_, err = c.Get().AbsPath(statsResource).Timeout(timeout).Do().Raw()
|
_, err = c.Get().AbsPath(statsResource).Timeout(timeout).Do().Raw()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
|
|
||||||
@ -88,7 +89,7 @@ func testPodWithVolume(path string, source *api.EmptyDirVolumeSource) *api.Pod {
|
|||||||
return &api.Pod{
|
return &api.Pod{
|
||||||
TypeMeta: api.TypeMeta{
|
TypeMeta: api.TypeMeta{
|
||||||
Kind: "Pod",
|
Kind: "Pod",
|
||||||
APIVersion: "v1beta1",
|
APIVersion: latest.Version,
|
||||||
},
|
},
|
||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: podName,
|
Name: podName,
|
||||||
|
@ -54,7 +54,7 @@ var _ = Describe("kubectl", func() {
|
|||||||
|
|
||||||
Describe("update-demo", func() {
|
Describe("update-demo", func() {
|
||||||
var (
|
var (
|
||||||
updateDemoRoot = filepath.Join(testContext.RepoRoot, "examples/update-demo/v1beta1")
|
updateDemoRoot = filepath.Join(testContext.RepoRoot, "examples/update-demo/v1beta3")
|
||||||
nautilusPath = filepath.Join(updateDemoRoot, "nautilus-rc.yaml")
|
nautilusPath = filepath.Join(updateDemoRoot, "nautilus-rc.yaml")
|
||||||
kittenPath = filepath.Join(updateDemoRoot, "kitten-rc.yaml")
|
kittenPath = filepath.Join(updateDemoRoot, "kitten-rc.yaml")
|
||||||
)
|
)
|
||||||
|
@ -209,7 +209,7 @@ func testMonitoringUsingHeapsterInfluxdb(c *client.Client) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
Failf("failed to get master http client")
|
Failf("failed to get master http client")
|
||||||
}
|
}
|
||||||
proxyUrl := fmt.Sprintf("%s/api/v1beta1/proxy/services/%s/", getMasterHost(), influxdbService)
|
proxyUrl := fmt.Sprintf("%s/api/v1beta3/proxy/namespaces/default/services/%s/", getMasterHost(), influxdbService)
|
||||||
config := &influxdb.ClientConfig{
|
config := &influxdb.ClientConfig{
|
||||||
Host: proxyUrl,
|
Host: proxyUrl,
|
||||||
// TODO(vishh): Infer username and pw from the Pod spec.
|
// TODO(vishh): Infer username and pw from the Pod spec.
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/aws"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/aws"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
|
||||||
@ -234,7 +235,7 @@ func testPDPod(diskName, targetHost string, readOnly bool) *api.Pod {
|
|||||||
pod := &api.Pod{
|
pod := &api.Pod{
|
||||||
TypeMeta: api.TypeMeta{
|
TypeMeta: api.TypeMeta{
|
||||||
Kind: "Pod",
|
Kind: "Pod",
|
||||||
APIVersion: "v1beta1",
|
APIVersion: latest.Version,
|
||||||
},
|
},
|
||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: "pd-test-" + string(util.NewUUID()),
|
Name: "pd-test-" + string(util.NewUUID()),
|
||||||
|
@ -25,6 +25,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
|
|
||||||
@ -74,7 +75,7 @@ var _ = Describe("Services", func() {
|
|||||||
pod := &api.Pod{
|
pod := &api.Pod{
|
||||||
TypeMeta: api.TypeMeta{
|
TypeMeta: api.TypeMeta{
|
||||||
Kind: "Pod",
|
Kind: "Pod",
|
||||||
APIVersion: "v1beta1",
|
APIVersion: latest.Version,
|
||||||
},
|
},
|
||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: "dns-test-" + string(util.NewUUID()),
|
Name: "dns-test-" + string(util.NewUUID()),
|
||||||
@ -166,7 +167,7 @@ var _ = Describe("Services", func() {
|
|||||||
It("should provide RW and RO services", func() {
|
It("should provide RW and RO services", func() {
|
||||||
svc := api.ServiceList{}
|
svc := api.ServiceList{}
|
||||||
err := c.Get().
|
err := c.Get().
|
||||||
AbsPath("/api/v1beta1/proxy/services/kubernetes-ro/api/v1beta1/services").
|
AbsPath("/api/v1beta3/proxy/namespaces/default/services/kubernetes-ro/api/v1beta3/services").
|
||||||
Do().
|
Do().
|
||||||
Into(&svc)
|
Into(&svc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -299,7 +300,7 @@ var _ = Describe("Services", func() {
|
|||||||
pod := &api.Pod{
|
pod := &api.Pod{
|
||||||
TypeMeta: api.TypeMeta{
|
TypeMeta: api.TypeMeta{
|
||||||
Kind: "Pod",
|
Kind: "Pod",
|
||||||
APIVersion: "v1beta1",
|
APIVersion: latest.Version,
|
||||||
},
|
},
|
||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: "elb-test-" + string(util.NewUUID()),
|
Name: "elb-test-" + string(util.NewUUID()),
|
||||||
|
Loading…
Reference in New Issue
Block a user