Skip to content
Permalink
Browse files

Camelcase shortcodes.

  • Loading branch information
amwat committed Dec 13, 2019
1 parent 0f4b43f commit 8e772d985cc0d99f556bcd8f99e482949bc7bf96
@@ -53,5 +53,5 @@ NOTE: not all options are documented yet! We will fix this with time, PRs welco
Extra mounts can be used to pass through storage on the host to a kind node
for persisting data, mounting through code etc.

{{< codefromfile file="examples/config-with-mounts.yaml" lang="yaml" >}}
{{< codeFromFile file="static/examples/config-with-mounts.yaml" lang="yaml" >}}

@@ -31,7 +31,7 @@ The following ingress controllers are known to work:

Create a kind cluster with `extraPortMappings` and `node-labels`.

```shell script
{{< codeFromInline lang="bash" >}}
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
@@ -51,21 +51,27 @@ nodes:
- containerPort: 443
hostPort: 443
EOF
```
{{< /codeFromInline >}}

Apply the [mandatory ingress-nginx components](https://kubernetes.github.io/ingress-nginx/deploy/#prerequisite-generic-deployment-command).

```shell script
{{< codeFromInline lang="bash" >}}
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
```
{{< /codeFromInline >}}

Apply kind specific patches to forward the hostPorts to the
ingress controller, set taint tolerations and
schedule it to the custom labelled node.

{{< codefromfile file="examples/ingress/nginx/patch.json" lang="json" >}}
```json
{{% readFile "static/examples/ingress/nginx/patch.json" %}}
```

Apply it by running:

{{% mdwithcopy lang="bash" %}}
kubectl patch deployments -n ingress-nginx nginx-ingress-controller -p '{{< minify file="examples/ingress/nginx/patch.json" >}}'
{{% /mdwithcopy %}}
{{< codeFromInline lang="bash" >}}
kubectl patch deployments -n ingress-nginx nginx-ingress-controller -p '{{< minify file="static/examples/ingress/nginx/patch.json" >}}'
{{< /codeFromInline >}}


Now the Ingress is all setup to be used.
@@ -76,19 +82,21 @@ Refer [Using Ingress](#using-ingress) for a basic example usage.
The following example creates simple http-echo services
and an Ingress object to route to these services.

{{< codefromfile file="examples/ingress/usage.yaml" lang="yaml" >}}
```yaml
{{< readFile "static/examples/ingress/usage.yaml" >}}
```

Apply the contents

{{% mdwithcopy lang="bash" %}}
kubectl apply -f {{< absurl "examples/ingress/nginx/example.yaml" >}}
{{% /mdwithcopy %}}
{{< codeFromInline lang="bash" >}}
kubectl apply -f {{< absURL "examples/ingress/usage.yaml" >}}
{{< /codeFromInline >}}

Now verify that the ingress works

{{% mdwithcopy lang="bash" %}}
{{< codeFromInline lang="bash" >}}
# should output "foo"
curl localhost/foo
# should output "bar"
curl localhost/bar
{{% /mdwithcopy %}}
{{< /codeFromInline >}}
@@ -17,7 +17,7 @@ The following recipe leverages this to enable a local registry.
The following shell script will create a local docker registry and a kind cluster
with it enabled.

{{< codefromfile file="static/examples/kind-with-registry.sh" >}}
{{< codeFromFile file="static/examples/kind-with-registry.sh" >}}

## Using The Registry

@@ -62,7 +62,7 @@ If you do this then kubelet must be restarted on each node to pick up the new cr
An example shell snippet for generating a [gcr.io][GCR] cred file on your host machine
using Access Tokens:

{{< codefromfile file="static/examples/kind-gcr.sh" >}}
{{< codeFromFile file="static/examples/kind-gcr.sh" >}}

### Use a Service Account

@@ -1,2 +1,2 @@
{{/* the one input should be a relative url */}}
{{- .Get 0 | absURL }}
{{- .Get 0 | absURL }}
@@ -1,4 +1,4 @@
{{ $file := printf "static/%s" (.Get "file") }}
{{ $file := .Get "file" }}
{{ $lang := "" }}
{{ $suffix := findRE "(\\.[^.]+)$" $file 1 }}
{{ with $suffix }}
@@ -1,4 +1,4 @@
{{ $code := trim .Inner "\n" }}
{{ $code := trim .Inner "\n" }}
{{ $lang := "" }}
{{ with .Get "lang" }}{{ $lang = . }}{{ end }}
{{ $hash := md5 $code }}
@@ -1,4 +1,4 @@
{{ $file := printf "static/%s" (.Get "file") }}
{{ $file := .Get "file" }}
{{- $contents := readFile $file -}}
{{ $res := $contents | resources.FromString $file }}
{{- ($res | resources.Minify).Content -}}
{{- safeHTML (($res | resources.Minify).Content) -}}
@@ -0,0 +1,2 @@
{{/* the one input should be a file path */}}
{{- .Get 0 | readFile | safeHTML -}}

0 comments on commit 8e772d9

Please sign in to comment.
You can’t perform that action at this time.