mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
commit
b4bb70d998
3
.gitignore
vendored
3
.gitignore
vendored
@ -12,3 +12,6 @@
|
|||||||
|
|
||||||
# Emacs save files
|
# Emacs save files
|
||||||
*~
|
*~
|
||||||
|
|
||||||
|
# Go test binaries
|
||||||
|
*.test
|
||||||
|
@ -46,15 +46,8 @@ KUBE_TEMP=$(mktemp -d -t kubernetes.XXXXXX)
|
|||||||
trap "rm -rf ${KUBE_TEMP}" EXIT
|
trap "rm -rf ${KUBE_TEMP}" EXIT
|
||||||
|
|
||||||
get-password
|
get-password
|
||||||
echo "Generating password: $user:$passwd"
|
echo "Using password: $user:$passwd"
|
||||||
htpasswd -b -c ${KUBE_TEMP}/htpasswd $user $passwd
|
htpasswd -b -c ${KUBE_TEMP}/htpasswd $user $passwd
|
||||||
cat << EOF > ~/.kubernetes_auth
|
|
||||||
{
|
|
||||||
"User": "$user",
|
|
||||||
"Password": "$passwd"
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
chmod 0600 ~/.kubernetes_auth
|
|
||||||
HTPASSWD=$(cat ${KUBE_TEMP}/htpasswd)
|
HTPASSWD=$(cat ${KUBE_TEMP}/htpasswd)
|
||||||
|
|
||||||
(
|
(
|
||||||
|
@ -89,5 +89,14 @@ function get-password {
|
|||||||
fi
|
fi
|
||||||
user=admin
|
user=admin
|
||||||
passwd=$(python -c 'import string,random; print "".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16))')
|
passwd=$(python -c 'import string,random; print "".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16))')
|
||||||
|
|
||||||
|
# Store password for reuse.
|
||||||
|
cat << EOF > ~/.kubernetes_auth
|
||||||
|
{
|
||||||
|
"User": "$user",
|
||||||
|
"Password": "$passwd"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
chmod 0600 ~/.kubernetes_auth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// A basic integration test for the service.
|
// A basic integration test for the service.
|
||||||
// Assumes that there is a pre-existing etcd server running on localhost.
|
// Assumes that there is a pre-existing etcd server running on localhost.
|
||||||
package main
|
package main
|
||||||
@ -26,7 +27,7 @@ import (
|
|||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
|
||||||
kube_client "github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry"
|
||||||
"github.com/coreos/go-etcd/etcd"
|
"github.com/coreos/go-etcd/etcd"
|
||||||
)
|
)
|
||||||
@ -42,13 +43,13 @@ func main() {
|
|||||||
reg := registry.MakeEtcdRegistry(etcdClient, machineList)
|
reg := registry.MakeEtcdRegistry(etcdClient, machineList)
|
||||||
|
|
||||||
apiserver := apiserver.New(map[string]apiserver.RESTStorage{
|
apiserver := apiserver.New(map[string]apiserver.RESTStorage{
|
||||||
"pods": registry.MakePodRegistryStorage(reg, &kube_client.FakeContainerInfo{}, registry.MakeRoundRobinScheduler(machineList)),
|
"pods": registry.MakePodRegistryStorage(reg, &client.FakeContainerInfo{}, registry.MakeRoundRobinScheduler(machineList)),
|
||||||
"replicationControllers": registry.MakeControllerRegistryStorage(reg),
|
"replicationControllers": registry.MakeControllerRegistryStorage(reg),
|
||||||
}, "/api/v1beta1")
|
}, "/api/v1beta1")
|
||||||
server := httptest.NewServer(apiserver)
|
server := httptest.NewServer(apiserver)
|
||||||
|
|
||||||
controllerManager := registry.MakeReplicationManager(etcd.NewClient(servers),
|
controllerManager := registry.MakeReplicationManager(etcd.NewClient(servers),
|
||||||
kube_client.Client{
|
client.Client{
|
||||||
Host: server.URL,
|
Host: server.URL,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ func main() {
|
|||||||
// Wait for the synchronization threads to come up.
|
// Wait for the synchronization threads to come up.
|
||||||
time.Sleep(time.Second * 10)
|
time.Sleep(time.Second * 10)
|
||||||
|
|
||||||
kubeClient := kube_client.Client{
|
kubeClient := client.Client{
|
||||||
Host: server.URL,
|
Host: server.URL,
|
||||||
}
|
}
|
||||||
data, err := ioutil.ReadFile("api/examples/controller.json")
|
data, err := ioutil.ReadFile("api/examples/controller.json")
|
||||||
|
@ -19,7 +19,7 @@ limitations under the License.
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
// ContainerManifest corresponds to the Container Manifest format, documented at:
|
// ContainerManifest corresponds to the Container Manifest format, documented at:
|
||||||
// https://developers.google.com/compute/docs/containers#container_manifest
|
// https://developers.google.com/compute/docs/containers/container_vms#container_manifest
|
||||||
// This is used as the representation of Kubernete's workloads.
|
// This is used as the representation of Kubernete's workloads.
|
||||||
type ContainerManifest struct {
|
type ContainerManifest struct {
|
||||||
Version string `yaml:"version" json:"version"`
|
Version string `yaml:"version" json:"version"`
|
||||||
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package util
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
Loading…
Reference in New Issue
Block a user