text stringlengths 0 59.1k |
|---|
``` |
NAME READY STATUS RESTARTS AGE |
phabricator-controller-9vy68 1/1 Running 0 1m |
``` |
If you ssh to that machine, you can run `docker ps` to see the actual pod: |
```sh |
me@workstation$ gcloud compute ssh --zone us-central1-b kubernetes-node-2 |
$ sudo docker ps |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
54983bc33494 fgrzadkowski/phabricator:latest "/run.sh" 2 hours ago Up 2 hours k8s_phabricator.d6b45054_phabricator-controller-02qp4.default.api_eafb1e53-b6a9-11e4-b1ae-42010af05ea6_01c2c4ca |
``` |
(Note that initial `docker pull` may take a few minutes, depending on network conditions. During this time, the `get pods` command will return `Pending` because the container has not yet started ) |
### Step Four: Turn up the phabricator service |
A Kubernetes 'service' is a named load balancer that proxies traffic to one or more containers. The services in a Kubernetes cluster are discoverable inside other containers via *environment variables*. Services find the containers to load balance based on pod labels. These environment variables are typically referenc... |
The pod that you created in Step Three has the label `name=phabricator`. The selector field of the service determines which pods will receive the traffic sent to the service. |
Use the file [`examples/phabricator/phabricator-service.json`](phabricator-service.json): |
<!-- BEGIN MUNGE: EXAMPLE phabricator-service.json --> |
```json |
{ |
"kind": "Service", |
"apiVersion": "v1", |
"metadata": { |
"name": "phabricator" |
}, |
"spec": { |
"ports": [ |
{ |
"port": 80, |
"targetPort": "http-server" |
} |
], |
"selector": { |
"name": "phabricator" |
}, |
"type": "LoadBalancer" |
} |
} |
``` |
[Download example](phabricator-service.json?raw=true) |
<!-- END MUNGE: EXAMPLE phabricator-service.json --> |
To create the service run: |
```sh |
$ kubectl create -f examples/phabricator/phabricator-service.json |
phabricator |
``` |
To play with the service itself, find the external IP of the load balancer: |
```console |
$ kubectl get services |
NAME LABELS SELECTOR IP(S) PORT(S) |
kubernetes component=apiserver,provider=kubernetes <none> 10.0.0.1 443/TCP |
phabricator <none> name=phabricator 10.0.31.173 80/TCP |
$ kubectl get services phabricator -o json | grep ingress -A 4 |
"ingress": [ |
{ |
"ip": "104.197.13.125" |
} |
] |
``` |
and then visit port 80 of that IP address. |
**Note**: Provisioning of the external IP address may take few minutes. |
**Note**: You may need to open the firewall for port 80 using the [console][cloud-console] or the `gcloud` tool. The following command will allow traffic from any source to instances tagged `kubernetes-node`: |
```sh |
$ gcloud compute firewall-rules create phabricator-node-80 --allow=tcp:80 --target-tags kubernetes-node |
``` |
### Step Six: Cleanup |
To turn down a Kubernetes cluster: |
```sh |
$ cluster/kube-down.sh |
``` |
<|endoftext|> |
# source: k8s_examples/_archived/elasticsearch/es-rc.yaml type: yaml |
apiVersion: v1 |
kind: ReplicationController |
metadata: |
name: es |
labels: |
component: elasticsearch |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.