Skip to content

Commit

Permalink
updates for v06
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Davis <dug@us.ibm.com>
  • Loading branch information
Doug Davis committed Jul 19, 2019
1 parent 27a1894 commit f3aedda
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 47 deletions.
49 changes: 10 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,35 +219,6 @@ Dockerhub namespace name instead of `duglin`, and change `GITREPO`
to be the name of your Github clone of this repo - typically you should
just need to swap `duglin` for your Github name.

#### Setup our network

Before we go any further, we'll need to modify our Istio configuration so that
it allows outbound network traffic from our pods. By default Istio blocks all
outbound traffic. To do this I have this `ingress.yaml` file:

```
# Allow for pods to talk to the internet
apiVersion: v1
kind: ConfigMap
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","data":{"istio.sidecar.includeOutboundIPRanges":"*"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"config-network","namespace":"knative-serving"}}
name: config-network
namespace: knative-serving
data:
istio.sidecar.includeOutboundIPRanges: 172.30.0.0/16,172.20.0.0/16,10.10.10.0/24
```

Install this resouce:

```
$ ./kapply ingress.yaml
configmap/config-network created
```

We'll talk more about the `kapply` command later.

#### Secrets

Before we get to the real point of this, which is deploying an application,
Expand Down Expand Up @@ -487,16 +458,16 @@ then we give it the name/location of the container image to use.
Once that's done, if you want a couple of seconds for the image to download,
you should then be able to ask for the list of services:
```
$ ./kn service get
NAME DOMAIN GENERATION AGE CONDITIONS READY REASON
helloworld helloworld.default.kndemo.us-south.containers.appdomain.cloud 1 46s 3 OK / 3 True
$ ./kn service list
NAME URL GENERATION AGE CONDITIONS READY REASON
helloworld http://helloworld-default.kndemo.us-south.containers.appdomain.cloud 1 10s 3 OK / 3 True
```

Notice that in there it will show you the full URL of the service that
you can then curl against:

```
$ curl -sf helloworld.default.kndemo.us-south.containers.appdomain.cloud
$ curl -sf helloworld-default.kndemo.us-south.containers.appdomain.cloud
c8xg6: Hello World!
```

Expand All @@ -506,7 +477,7 @@ it, route traffic to it and even give it a relatively nice URL.

One more thing.... you can also access it via SSL:
```
$ curl -sf https://helloworld.default.kndemo.us-south.containers.appdomain.cloud
$ curl -sf https://helloworld-default.kndemo.us-south.containers.appdomain.cloud
c8xg6: Hello World!
```

Expand Down Expand Up @@ -637,14 +608,14 @@ the full URL of the service, to find that do this:
```
$ kubectl get ksvc
NAME DOMAIN LATESTCREATED LATESTREADY READY REASON
helloworld helloworld.default.kndemo.us-south.containers.appdomain.cloud helloworld-s824d helloworld-s824d True
helloworld helloworld-default.kndemo.us-south.containers.appdomain.cloud helloworld-s824d helloworld-s824d True
```

You'll notice that once the Service is ready the "DOMAIN" column will show
the full URL of the Service and that's what we'll use to call it.

```
$ curl -sf helloworld.default.kndemo.us-south.containers.appdomain.cloud
$ curl -sf helloworld-default.kndemo.us-south.containers.appdomain.cloud
s824d: Hello World!
```
Expand Down Expand Up @@ -747,7 +718,7 @@ the request.
So, let's hit it:
```
$ curl -sf helloworld.default.kndemo.us-south.containers.appdomain.cloud
$ curl -sf helloworld-default.kndemo.us-south.containers.appdomain.cloud
p8c2v: Hello World!
```
Expand Down Expand Up @@ -936,7 +907,7 @@ pod show up, which is our new version of the app running and ready to be
hit:
```
$ curl -sf helloworld.default.kndemo.us-south.containers.appdomain.cloud
$ curl -sf helloworld-default.kndemo.us-south.containers.appdomain.cloud
7vh75: Now is the time for all good...
```
Expand Down Expand Up @@ -1031,7 +1002,7 @@ To see this rollout, we'll need to geneate some load. Make sure you've
built the `load` tool (`make load`):
```
$ ./load 10 30 http://helloworld.default.kndemo.us-south.containers.appdomain.cloud
$ ./load 10 30 http://helloworld-default.kndemo.us-south.containers.appdomain.cloud
```
What you should see is something like this:
Expand Down
12 changes: 4 additions & 8 deletions demo
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ function cleanDemo {
-f service1.yaml \
-f github.yaml \
-f rebuild.yaml \
-f secrets.yaml \
-f ingress.yaml
-f secrets.yaml

kubectl delete \
clusterchannelprovisioner.eventing.knative.dev/in-memory-channel
Expand Down Expand Up @@ -68,9 +67,6 @@ doit ibmcloud ks cluster-config -s --export ${CLUSTER}
doit $(cat out)
$(cat out)

comment Enable external internet access from our pods
doit ./kapply ingress.yaml

comment Create the secrets used for accessing DockerHub and Github
doit ./kapply secrets.yaml

Expand All @@ -92,9 +88,9 @@ scroll helloworld.go

comment Use the easy CLI first
doit ./kn service create --image duglin/helloworld helloworld
wait ./kn service get \| grep helloworld.default
doit ./kn service get
APPURL=$(grep helloworld out | sed "s/^.* \(helloworld.def.*cloud\).*$/\1/")
wait ./kn service list \| grep helloworld.default
doit ./kn service list
APPURL=$(grep helloworld out | sed "s/^.*\(helloworld.def.*cloud\).*$/\1/")
doit curl -sf ${APPURL}
doit curl -sfk https://${APPURL}
doit ./showresources all
Expand Down
Binary file modified demo.tar
Binary file not shown.
Binary file modified kn
Binary file not shown.

0 comments on commit f3aedda

Please sign in to comment.