fix: fix services names (#49)

pull/51/head
Rémy-Christophe Schermesser 5 years ago committed by GitHub
parent 13dc122c47
commit e8470e9d4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -137,7 +137,7 @@ Change again the number of replicas to `2`, reapply, see what is happening.
We know how to scale up/down a deployment, but how can we deploy a new version of the application. To achieve this, we need to tell Kubernetes to update the image we are using in our `deployment`, for this:
```sh
$ kubectl set image deployment/simple-deployment simple-service=mhausenblas/simpleservice:0.5.0
$ kubectl set image deployment/simple-deployment simple-pod=mhausenblas/simpleservice:0.5.0
deployment.apps "simple-deployment" image updated
```

@ -2,7 +2,7 @@
apiVersion: v1
kind: Service
metadata:
name: simple-service
name: simple-internal-service
spec:
ports:
- port: 80

@ -7,5 +7,5 @@ metadata:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
backend:
serviceName: simple-service
serviceName: simple-internal-service
servicePort: 80

@ -86,22 +86,22 @@ is central to Kubernetes. It is with those fields that you will tell Kubernetes
Apply the service:
```sh
$ kubectl apply -f 08-service/03-simple-service.yml
$ kubectl apply -f 08-service/03-simple-internal-service.yml
service "simple-service" created
```
Your service is now accessible internally, try this in your `bash` container:
```sh
root@bash:/# nslookup simple-service
root@bash:/# nslookup simple-internal-service
Server: 10.96.0.10
Address: 10.96.0.10#53
Name: simple-service.default.svc.cluster.local
Name: simple-internal-service.default.svc.cluster.local
Address: 10.96.31.244
```
Try to curl the `/info` url, remember the `ports` we choose in the `service`.
Try to curl the `/healthz` url, remember the `ports` we choose in the `service`.
Can you access this service from the outside of Kubernetes?
@ -130,7 +130,7 @@ metadata:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
backend:
serviceName: simple-service
serviceName: simple-internal-service
servicePort: 80
```

Loading…
Cancel
Save