Skip to content

Commit

Permalink
Merge pull request #1270 from harryge00/add-yaml-to-nginx-controller
Browse files Browse the repository at this point in the history
add missing yamls in controllers/nginx
  • Loading branch information
aledbf authored Aug 30, 2017
2 parents 2d6f811 + 6dd1b0b commit 2d7f6c5
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/nginx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ $ ./rootfs/nginx-ingress-controller --running-in-cluster=false --default-backend

First create a default backend:
```
$ kubectl create -f examples/deployment/nginx/default-backend.yaml
$ kubectl create -f examples/default-backend.yaml
$ kubectl expose rc default-http-backend --port=80 --target-port=8080 --name=default-http-backend
```

Loadbalancers are created via a ReplicationController or Daemonset:

```
$ kubectl create -f examples/default/rc-default.yaml
$ kubectl create -f examples/rc-default.yaml
```

## HTTP
Expand Down
51 changes: 51 additions & 0 deletions controllers/nginx/examples/default-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: default-http-backend
labels:
k8s-app: default-http-backend
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
k8s-app: default-http-backend
spec:
terminationGracePeriodSeconds: 60
containers:
- name: default-http-backend
# Any image is permissable as long as:
# 1. It serves a 404 page at /
# 2. It serves 200 on a /healthz endpoint
image: gcr.io/google_containers/defaultbackend:1.0
livenessProbe:
httpGet:
path: /healthz
port: 8080
scheme: HTTP
initialDelaySeconds: 30
timeoutSeconds: 5
ports:
- containerPort: 8080
resources:
limits:
cpu: 10m
memory: 20Mi
requests:
cpu: 10m
memory: 20Mi
---
apiVersion: v1
kind: Service
metadata:
name: default-http-backend
namespace: kube-system
labels:
k8s-app: default-http-backend
spec:
ports:
- port: 80
targetPort: 8080
selector:
k8s-app: default-http-backend
26 changes: 26 additions & 0 deletions controllers/nginx/examples/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is the Ingress resource that creates a HTTP Loadbalancer configured
# according to the Ingress rules.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: echomap
spec:
rules:
- host: foo.bar.com
http:
paths:
- path: /foo
backend:
serviceName: echoheaders-x
servicePort: 80
- host: bar.baz.com
http:
paths:
- path: /bar
backend:
serviceName: echoheaders-y
servicePort: 80
- path: /foo
backend:
serviceName: echoheaders-x
servicePort: 80

0 comments on commit 2d7f6c5

Please sign in to comment.