Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nginx-ingress addon manifests for bare-metal
- Loading branch information
Showing
11 changed files
with
284 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: ingress | ||
labels: | ||
name: ingress |
40 changes: 40 additions & 0 deletions
40
addons/nginx-ingress/bare-metal/default-backend/deployment.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: default-backend | ||
namespace: ingress | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: default-backend | ||
phase: prod | ||
template: | ||
metadata: | ||
labels: | ||
name: default-backend | ||
phase: prod | ||
spec: | ||
containers: | ||
- name: default-backend | ||
# Any image is permissable as long as: | ||
# 1. It serves a 404 page at / | ||
# 2. It serves 200 on a /healthz endpoint | ||
image: k8s.gcr.io/defaultbackend:1.4 | ||
ports: | ||
- containerPort: 8080 | ||
resources: | ||
limits: | ||
cpu: 10m | ||
memory: 20Mi | ||
requests: | ||
cpu: 10m | ||
memory: 20Mi | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 30 | ||
timeoutSeconds: 5 | ||
terminationGracePeriodSeconds: 60 |
15 changes: 15 additions & 0 deletions
15
addons/nginx-ingress/bare-metal/default-backend/service.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: default-backend | ||
namespace: ingress | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
name: default-backend | ||
phase: prod | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 80 | ||
targetPort: 8080 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: ingress-controller-public | ||
namespace: ingress | ||
spec: | ||
replicas: 2 | ||
strategy: | ||
rollingUpdate: | ||
maxUnavailable: 1 | ||
selector: | ||
matchLabels: | ||
name: ingress-controller-public | ||
phase: prod | ||
template: | ||
metadata: | ||
labels: | ||
name: ingress-controller-public | ||
phase: prod | ||
spec: | ||
containers: | ||
- name: nginx-ingress-controller | ||
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.17.1 | ||
args: | ||
- /nginx-ingress-controller | ||
- --default-backend-service=$(POD_NAMESPACE)/default-backend | ||
- --ingress-class=public | ||
# use downward API | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
ports: | ||
- name: http | ||
containerPort: 80 | ||
- name: https | ||
containerPort: 443 | ||
- name: health | ||
containerPort: 10254 | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 10254 | ||
scheme: HTTP | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
failureThreshold: 3 | ||
timeoutSeconds: 1 | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 10254 | ||
scheme: HTTP | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
failureThreshold: 3 | ||
timeoutSeconds: 1 | ||
securityContext: | ||
capabilities: | ||
add: | ||
- NET_BIND_SERVICE | ||
drop: | ||
- ALL | ||
runAsUser: 33 # www-data | ||
restartPolicy: Always | ||
terminationGracePeriodSeconds: 60 | ||
|
12 changes: 12 additions & 0 deletions
12
addons/nginx-ingress/bare-metal/rbac/cluster-role-binding.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: ingress | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: ingress | ||
subjects: | ||
- kind: ServiceAccount | ||
namespace: ingress | ||
name: default |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: ingress | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
- endpoints | ||
- nodes | ||
- pods | ||
- secrets | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "extensions" | ||
resources: | ||
- ingresses | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- patch | ||
- apiGroups: | ||
- "extensions" | ||
resources: | ||
- ingresses/status | ||
verbs: | ||
- update |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: ingress | ||
namespace: ingress | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: ingress | ||
subjects: | ||
- kind: ServiceAccount | ||
namespace: ingress | ||
name: default |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: ingress | ||
namespace: ingress | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
- pods | ||
- secrets | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
resourceNames: | ||
# Defaults to "<election-id>-<ingress-class>" | ||
# Here: "<ingress-controller-leader>-<nginx>" | ||
# This has to be adapted if you change either parameter | ||
# when launching the nginx-ingress-controller. | ||
- "ingress-controller-leader-public" | ||
verbs: | ||
- get | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- create | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- endpoints | ||
verbs: | ||
- get | ||
- create | ||
- update |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: ingress-controller-public | ||
namespace: ingress | ||
annotations: | ||
prometheus.io/scrape: 'true' | ||
prometheus.io/port: '10254' | ||
spec: | ||
type: ClusterIP | ||
clusterIP: 10.3.0.12 | ||
selector: | ||
name: ingress-controller-public | ||
phase: prod | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
- name: https | ||
protocol: TCP | ||
port: 443 | ||
targetPort: 443 |
This file contains 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