|
| 1 | +# Copyright 2016 The Kubernetes Authors All rights reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +apiVersion: v1 |
| 16 | +kind: ReplicationController |
| 17 | +metadata: |
| 18 | + name: default-http-backend |
| 19 | + namespace: kube-system |
| 20 | + labels: |
| 21 | + kubernetes.io/cluster-service: "true" |
| 22 | +spec: |
| 23 | + replicas: 1 |
| 24 | + selector: |
| 25 | + app: default-http-backend |
| 26 | + kubernetes.io/cluster-service: "true" |
| 27 | + template: |
| 28 | + metadata: |
| 29 | + labels: |
| 30 | + app: default-http-backend |
| 31 | + kubernetes.io/cluster-service: "true" |
| 32 | + spec: |
| 33 | + terminationGracePeriodSeconds: 60 |
| 34 | + containers: |
| 35 | + - name: default-http-backend |
| 36 | + # Any image is permissable as long as: |
| 37 | + # 1. It serves a 404 page at / |
| 38 | + # 2. It serves 200 on a /healthz endpoint |
| 39 | + image: gcr.io/google_containers/defaultbackend:1.0 |
| 40 | + imagePullPolicy: IfNotPresent |
| 41 | + livenessProbe: |
| 42 | + httpGet: |
| 43 | + path: /healthz |
| 44 | + port: 8080 |
| 45 | + scheme: HTTP |
| 46 | + initialDelaySeconds: 30 |
| 47 | + timeoutSeconds: 5 |
| 48 | + ports: |
| 49 | + - containerPort: 8080 |
| 50 | + resources: |
| 51 | + limits: |
| 52 | + cpu: 10m |
| 53 | + memory: 20Mi |
| 54 | + requests: |
| 55 | + cpu: 10m |
| 56 | + memory: 20Mi |
| 57 | +--- |
| 58 | +apiVersion: v1 |
| 59 | +kind: ReplicationController |
| 60 | +metadata: |
| 61 | + name: nginx-ingress-controller |
| 62 | + namespace: kube-system |
| 63 | + labels: |
| 64 | + app: nginx-ingress-lb |
| 65 | + kubernetes.io/cluster-service: "true" |
| 66 | +spec: |
| 67 | + replicas: 1 |
| 68 | + selector: |
| 69 | + app: nginx-ingress-lb |
| 70 | + kubernetes.io/cluster-service: "true" |
| 71 | + template: |
| 72 | + metadata: |
| 73 | + labels: |
| 74 | + app: nginx-ingress-lb |
| 75 | + name: nginx-ingress-lb |
| 76 | + kubernetes.io/cluster-service: "true" |
| 77 | + spec: |
| 78 | + terminationGracePeriodSeconds: 60 |
| 79 | + containers: |
| 80 | + # TODO(r2d4): Use official k8s/ingress controller |
| 81 | + - image: gcr.io/k8s-minikube/nginx-ingress-controller:0.8.4 |
| 82 | + name: nginx-ingress-lb |
| 83 | + imagePullPolicy: IfNotPresent |
| 84 | + readinessProbe: |
| 85 | + httpGet: |
| 86 | + path: /ingress-controller-healthz |
| 87 | + port: 80 |
| 88 | + scheme: HTTP |
| 89 | + livenessProbe: |
| 90 | + httpGet: |
| 91 | + path: /ingress-controller-healthz |
| 92 | + port: 80 |
| 93 | + scheme: HTTP |
| 94 | + initialDelaySeconds: 10 |
| 95 | + timeoutSeconds: 1 |
| 96 | + # use downward API |
| 97 | + env: |
| 98 | + - name: POD_NAME |
| 99 | + valueFrom: |
| 100 | + fieldRef: |
| 101 | + fieldPath: metadata.name |
| 102 | + - name: POD_NAMESPACE |
| 103 | + valueFrom: |
| 104 | + fieldRef: |
| 105 | + fieldPath: metadata.namespace |
| 106 | + ports: |
| 107 | + - containerPort: 80 |
| 108 | + hostPort: 80 |
| 109 | + - containerPort: 443 |
| 110 | + hostPort: 443 |
| 111 | + # we expose 18080 to access nginx stats in url /nginx-status |
| 112 | + # this is optional |
| 113 | + - containerPort: 18080 |
| 114 | + hostPort: 18080 |
| 115 | + args: |
| 116 | + - /nginx-ingress-controller |
| 117 | + - --default-backend-service=$(POD_NAMESPACE)/default-http-backend |
| 118 | + - --nginx-configmap=$(POD_NAMESPACE)/nginx-load-balancer-conf |
0 commit comments