...
Table of Contents | ||||
---|---|---|---|---|
|
...
Navigate to the cloned repository directory <SETUP_HOME>
and run the following command:
vagrant ssh master
...
Navigate to the cloned repository directory <SETUP_HOME>
and run the following command:
vagrant ssh minion-1
...
Navigate to the cloned repository directory <SETUP_HOME>
and run the following command:
vagrant ssh minion-2
...
ssh to the master node
fleetctl list-machines
...
Code Block |
---|
core@master ~ $ fleetctl list-machines MACHINE IP METADATA 07215782... 172.17.8.100 - 4b56425a... 172.17.8.102 - bf39a4c4... 172.17.8.101 - |
...
ssh to master node
kubectl list /replicationControllers
...
Code Block |
---|
core@master ~ $ kubectl list /replicationControllers ID Image(s) Selector Replicas test2.php.domain 54.254.64.141:5000/stratos-php name=php 2 |
...
ssh to master node
kubectl list /pods
...
Code Block |
---|
core@master ~ $ kubectl list /pods ID Image(s) Host Labels Status 115bbe15-49ff-11e4-91b7-08002794b041 stratos-php 172.17.8.100/ name=php,replicationController=php Waiting 115cc7e9-49ff-11e4-91b7-08002794b041 stratos-php 172.17.8.101/ name=php,replicationController=php Waiting |
...
ssh to master node
journalctl -f
...
ssh to master node
systemctl restart scheduler
...
ssh to the node
docker ps
The following is a sample of the output that will appear:
Code Block |
---|
core@master ~ $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS 37e3303eb337 stratos-php:latest "/bin/sh -c '/usr/lo 2 minutes ago Up a3f787d0a7ae kubernetes/pause:latest "/pause" 2 minutes ago Up 0.0.0.0:80->80/tcp |
ssh to the node
docker inspect CONTAINER-ID | grep IPAddress
...
Code Block |
---|
core@master ~ $ docker inspect a3f787d0a7ae | grep IPAddress IPAddress": "10.100.56.3", |
...
ssh root@CONTAINER-IPAddress
g
as the password...
ssh to the node
docker kill CONTAINER-ID
...
Another container will be created within a few seconds.
...
ssh to the master node
kubectl -json get /replicationControllers/REPLICATION-CONTROLLER-ID
...
Code Block |
---|
core@master ~ $ kubectl -json get /replicationControllers/test2.php.domain {"kind":"ReplicationController","id":"test2.php.domain","creationTimestamp":"2014-10-02T07:44:58Z","resourceVersion":6701,"apiVersion":"v1beta1","desiredState":{"replicas":2,"replicaSelector":{"name":"test2.php.domain"},"podTemplate":{"desiredState":{"manifest":{"version":"v1beta1","id":"","volumes":null,"containers":[{"name":"test2-apachestratos-org","image":"54.254.64.141:5000/stratos-php","ports":[{"name":"tcp80","hostPort":80,"containerPort":80,"protocol":"tcp"}],"env":[{"name":"SERVICE_NAME","key":"SERVICE_NAME","value":"php"},{"name":"HOST_NAME","key":"HOST_NAME","value":"test2.apachestratos.org"},{"name":"MULTITENANT","key":"MULTITENANT","value":"false"},{"name":"TENANT_ID","key":"TENANT_ID","value":"-1234"},{"name":"TENANT_RANGE","key":"TENANT_RANGE","value":"-1234"},{"name":"CARTRIDGE_ALIAS","key":"CARTRIDGE_ALIAS","value":"test2"},{"name":"CLUSTER_ID","key":"CLUSTER_ID","value":"test2.php.domain"},{"name":"CARTRIDGE_KEY","key":"CARTRIDGE_KEY","value":"uLBSXhS3Kzos5xVe"},{"name":"REPO_URL","key":"REPO_URL","value":"null"},{"name":"PORTS","key":"PORTS","value":"80"},{"name":"PROVIDER","key":"PROVIDER","value":"apache"},{"name":"PUPPET_IP","key":"PUPPET_IP","value":"127.0.0.1"},{"name":"PUPPET_HOSTNAME","key":"PUPPET_HOSTNAME","value":"puppet.raj.org"},{"name":"PUPPET_DNS_AVAILABLE","key":"PUPPET_DNS_AVAILABLE","value":"null"},{"name":"PUPPET_ENV","key":"PUPPET_ENV","value":"stratos"},{"name":"DEPLOYMENT","key":"DEPLOYMENT","value":"default"},{"name":"CEP_PORT","key":"CEP_PORT","value":"7611"},{"name":"COMMIT_ENABLED","key":"COMMIT_ENABLED","value":"false"},{"name":"MB_PORT","key":"MB_PORT","value":"1883"},{"name":"MB_IP","key":"MB_IP","value":"172.17.42.1"},{"name":"CEP_IP","key":"CEP_IP","value":"172.17.42.1"},{"name":"MEMBER_ID","key":"MEMBER_ID","value":"test2.php.domaindb8e4a24-17e8-40a2-ad85-e0d0ca127887"},{"name":"LB_CLUSTER_ID","key":"LB_CLUSTER_ID"},{"name":"NETWORK_PARTITION_ID","key":"NETWORK_PARTITION_ID"},{"name":"KUBERNETES_CLUSTER_ID","key":"KUBERNETES_CLUSTER_ID","value":"KubGrp1"},{"name":"KUBERNETES_MASTER_IP","key":"KUBERNETES_MASTER_IP","value":"127.0.0.1"},{"name":"KUBERNETES_PORT_RANGE","key":"KUBERNETES_PORT_RANGE","value":"4000-5000"}]}],"restartPolicy":{"always":{}}}},"labels":{"name":"test2.php.domain"}}},"currentState":{"replicas":2,"podTemplate":{"desiredState":{"manifest":{"version":"","id":"","volumes":null,"containers":null,"restartPolicy":{}}}}},"labels":{"name":"test2.php.domain"}} |
...
kubectl -json get /replicationControllers/REPLICATION-CONTROLLER-ID >> rep-controller.json
rep-controller.json
(for example, set replicas to 0)replicationController
....
This will delete all the pods immediately.
...
kubectl list /pods
...
Code Block |
---|
core@master ~ $ kubectl delete pods/3ed5c5a6-4a0a-11e4-91b7-08002794b041 I1002 08:01:25.351501 02112 request.go:292] Waiting for completion of /operations/67 Status success |
...
kubectl list /replicationControllers
...
If you unsubscribe from the cartridge, the replicationControllers, pods and containers for that service cluster will be wiped out.
...
Navigate to the folder that has the Kubernetes setup.
For example:
Code Block |
---|
cd kubernetes-vagrant-setup |
Destroy the cluster.
Code Block |
---|
vagrant destroy -f |
Remove the Vagrant file.
Code Block |
---|
rm -rf .vagrant/ |
...
Execute the following command to check the CoreOS version being used for the Kubernetes cluster:
...