Skip to content

Instantly share code, notes, and snippets.

@CalvinHartwell
Created October 9, 2018 11:05
Show Gist options
  • Select an option

  • Save CalvinHartwell/bcf43af1f419384ea753b146dcbc4a62 to your computer and use it in GitHub Desktop.

Select an option

Save CalvinHartwell/bcf43af1f419384ea753b146dcbc4a62 to your computer and use it in GitHub Desktop.
cdk-rancher-ingress.yaml
apiVersion: v1
kind: Namespace
metadata:
name: rancher
labels:
name: rancher
---
kind: ServiceAccount
apiVersion: v1
metadata:
name: rancher-admin
namespace: rancher
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: rancher-cluster-admin-crb
namespace: rancher
subjects:
- kind: ServiceAccount
name: rancher-admin
namespace: rancher
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: rancher
labels:
app: rancher
namespace: rancher
spec:
replicas: 1
selector:
matchLabels:
app: rancher
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: rancher
spec:
containers:
- image: rancher/rancher:v2.0.7
imagePullPolicy: Always
name: rancher
ports:
- containerPort: 443
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 5
timeoutSeconds: 30
resources: {}
#args:
# - --debug
restartPolicy: Always
serviceAccountName: rancher-admin
status: {}
---
apiVersion: v1
kind: Service
metadata:
name: rancher
namespace: rancher
labels:
app: rancher
spec:
ports:
- port: 443
targetPort: 443
protocol: TCP
selector:
app: rancher
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: rancher
namespace: rancher
annotations:
#nginx.ingress.kubernetes.io/ssl-passthrough: "true"
nginx.ingress.kubernetes.io/tls-acme: "true"
# for updated ingress controller, use this line
nginx.ingress.kubernetes.io/secure-backends: "true"
# for the old ingress controller, use this line
ingress.kubernetes.io/secure-backends: "true"
spec:
tls:
- hosts:
- rancher.canonical-kubernet.es
# secretName: rancher-ingress-cert
rules:
- host: rancher.canonical-kubernet.es
http:
paths:
- path: /
backend:
serviceName: rancher
servicePort: 443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment