Fix incorrect / obsolete references to RCs and files

This commit is contained in:
Janet Kuo
2016-12-29 16:32:23 -08:00
parent e547257664
commit e8b5af4202
+9 -12
View File
@@ -174,7 +174,7 @@ You can acquire all these from the [nginx https example](https://github.com/kube
```shell ```shell
$ make keys secret KEY=/tmp/nginx.key CERT=/tmp/nginx.crt SECRET=/tmp/secret.json $ make keys secret KEY=/tmp/nginx.key CERT=/tmp/nginx.crt SECRET=/tmp/secret.json
$ kubectl create -f /tmp/secret.json $ kubectl create -f /tmp/secret.json
secrets/nginxsecret secret "nginxsecret" created
$ kubectl get secrets $ kubectl get secrets
NAME TYPE DATA NAME TYPE DATA
default-token-il9rc kubernetes.io/service-account-token 1 default-token-il9rc kubernetes.io/service-account-token 1
@@ -183,19 +183,16 @@ nginxsecret Opaque 2
Now modify your nginx replicas to start an https server using the certificate in the secret, and the Service, to expose both ports (80 and 443): Now modify your nginx replicas to start an https server using the certificate in the secret, and the Service, to expose both ports (80 and 443):
{% include code.html language="yaml" file="nginx-secure-app.yaml" ghlink="/docs/user-guide/nginx-secure-app" %} {% include code.html language="yaml" file="nginx-secure-app.yaml" ghlink="/docs/user-guide/nginx-secure-app.yaml" %}
Noteworthy points about the nginx-secure-app manifest: Noteworthy points about the nginx-secure-app manifest:
- It contains both rc and service specification in the same file - It contains both Deployment and Service specification in the same file
- The [nginx server](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/https-nginx/default.conf) serves http traffic on port 80 and https traffic on 443, and nginx Service exposes both ports. - The [nginx server](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/https-nginx/default.conf) serves http traffic on port 80 and https traffic on 443, and nginx Service exposes both ports.
- Each container has access to the keys through a volume mounted at /etc/nginx/ssl. This is setup *before* the nginx server is started. - Each container has access to the keys through a volume mounted at /etc/nginx/ssl. This is setup *before* the nginx server is started.
```shell ```shell
$ kubectl apply -f ./nginx-secure-app.yaml $ kubectl delete deployments,svc my-nginx; kubectl create -f ./nginx-secure-app.yaml
$ kubectl delete rc,svc -l app=nginx; kubectl create -f ./nginx-app.yaml
service "my-nginx" configured
deployment "my-nginx" configured
``` ```
At this point you can reach the nginx server from any node. At this point you can reach the nginx server from any node.
@@ -216,11 +213,10 @@ Lets test this from a pod (the same secret is being reused for simplicity, the p
```shell ```shell
$ kubectl create -f ./curlpod.yaml $ kubectl create -f ./curlpod.yaml
$ kubectl get pods $ kubectl get pods -l app=curlpod
NAME READY STATUS RESTARTS AGE NAME READY STATUS RESTARTS AGE
curlpod 1/1 Running 0 2m curl-deployment-1515033274-1410r 1/1 Running 0 1m
$ kubectl exec curl-deployment-1515033274-1410r -- curl https://my-nginx --cacert /etc/nginx/ssl/nginx.crt
$ kubectl exec curlpod -- curl https://my-nginx --cacert /etc/nginx/ssl/nginx.crt
... ...
<title>Welcome to nginx!</title> <title>Welcome to nginx!</title>
... ...
@@ -291,6 +287,7 @@ $ kubectl describe service my-nginx
LoadBalancer Ingress: a320587ffd19711e5a37606cf4a74574-1142138393.us-east-1.elb.amazonaws.com LoadBalancer Ingress: a320587ffd19711e5a37606cf4a74574-1142138393.us-east-1.elb.amazonaws.com
... ...
``` ```
## Further reading ## Further reading
Kubernetes also supports Federated Services, which can span multiple Kubernetes also supports Federated Services, which can span multiple