Created
December 7, 2016 18:45
-
-
Save sebgoa/90befefd18d906d6e784998e48adf99d to your computer and use it in GitHub Desktop.
ingress controller backend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/kubernetes/contrib/blob/master/ingress/controllers/nginx/examples/default-backend.yaml | |
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: default-http-backend | |
spec: | |
replicas: 1 | |
selector: | |
app: default-http-backend | |
template: | |
metadata: | |
labels: | |
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 | |
--- | |
# create a service for the default backend | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app: default-http-backend | |
name: default-http-backend | |
spec: | |
ports: | |
- port: 80 | |
protocol: TCP | |
targetPort: 8080 | |
selector: | |
app: default-http-backend | |
sessionAffinity: None | |
type: ClusterIP | |
--- | |
# Replication controller for the load balancer | |
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: nginx-ingress-controller | |
labels: | |
k8s-app: nginx-ingress-lb | |
spec: | |
replicas: 1 | |
selector: | |
k8s-app: nginx-ingress-lb | |
template: | |
metadata: | |
labels: | |
k8s-app: nginx-ingress-lb | |
name: nginx-ingress-lb | |
spec: | |
terminationGracePeriodSeconds: 60 | |
containers: | |
- image: gcr.io/google_containers/nginx-ingress-controller:0.8.2 | |
name: nginx-ingress-lb | |
imagePullPolicy: Always | |
livenessProbe: | |
httpGet: | |
path: /healthz | |
port: 10249 | |
scheme: HTTP | |
initialDelaySeconds: 30 | |
timeoutSeconds: 5 | |
# use downward API | |
env: | |
- name: POD_NAME | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.name | |
- name: POD_NAMESPACE | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.namespace | |
ports: | |
- containerPort: 80 | |
hostPort: 80 | |
- containerPort: 443 | |
hostPort: 443 | |
args: | |
- /nginx-ingress-controller | |
- --default-backend-service=default/default-http-backend |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment