wadeholler

Untitled

Nov 24th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 9.44 KB | None | 0 0
  1. contour tls issue.
  2.  
  3. contour yaml.
  4.  
  5. straight from the `Get Started` section of https://github.com/heptio/contour
  6. plus followed instructions from https://github.com/heptio/contour/blob/master/docs/tls.md
  7. and mainly https://github.com/heptio/contour/blob/master/docs/proxy-proto.md
  8.  
  9. apiVersion: v1
  10. kind: Namespace
  11. metadata:
  12.   name: heptio-contour
  13. ---
  14. apiVersion: v1
  15. kind: ServiceAccount
  16. metadata:
  17.   name: contour
  18.   namespace: heptio-contour
  19. ---
  20. apiVersion: apiextensions.k8s.io/v1beta1
  21. kind: CustomResourceDefinition
  22. metadata:
  23.   name: ingressroutes.contour.heptio.com
  24.   labels:
  25.     component: ingressroute
  26. spec:
  27.   group: contour.heptio.com
  28.   version: v1beta1
  29.   scope: Namespaced
  30.   names:
  31.     plural: ingressroutes
  32.     kind: IngressRoute
  33.   additionalPrinterColumns:
  34.     - name: FQDN
  35.       type: string
  36.       description: Fully qualified domain name
  37.       JSONPath: .spec.virtualhost.fqdn
  38.     - name: TLS Secret
  39.       type: string
  40.       description: Secret with TLS credentials
  41.       JSONPath: .spec.virtualhost.tls.secretName
  42.     - name: First route
  43.       type: string
  44.       description: First routes defined
  45.       JSONPath: .spec.routes[0].match
  46.     - name: Status
  47.       type: string
  48.       description: The current status of the IngressRoute
  49.       JSONPath: .status.currentStatus
  50.     - name: Status Description
  51.       type: string
  52.       description: Description of the current status
  53.       JSONPath: .status.description
  54.   validation:
  55.     openAPIV3Schema:
  56.       properties:
  57.         spec:
  58.           required:
  59.            - routes
  60.           properties:
  61.             virtualhost:
  62.               properties:
  63.                 fqdn:
  64.                   type: string
  65.                   pattern: ^([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\.)+[a-z]{2,}$
  66.                 tls:
  67.                   properties:
  68.                     secretName:
  69.                       type: string
  70.                       pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ # DNS-1123 subdomain
  71.                     minimumProtocolVersion:
  72.                       type: string
  73.                       enum:
  74.                        - "1.3"
  75.                         - "1.2"
  76.                         - "1.1"
  77.             strategy:
  78.               type: string
  79.               enum:
  80.                - RoundRobin
  81.                 - WeightedLeastRequest
  82.                 - Random
  83.                 - RingHash
  84.                 - Maglev
  85.             healthCheck:
  86.               type: object
  87.               required:
  88.                - path
  89.               properties:
  90.                 path:
  91.                   type: string
  92.                   pattern: ^\/.*$
  93.                 intervalSeconds:
  94.                   type: integer
  95.                 timeoutSeconds:
  96.                   type: integer
  97.                 unhealthyThresholdCount:
  98.                   type: integer
  99.                 healthyThresholdCount:
  100.                   type: integer
  101.             routes:
  102.               type: array
  103.               items:
  104.                 required:
  105.                  - match
  106.                 properties:
  107.                   match:
  108.                     type: string
  109.                     pattern: ^\/.*$
  110.                   delegate:
  111.                     type: object
  112.                     required:
  113.                      - name
  114.                     properties:
  115.                       name:
  116.                         type: string
  117.                         pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ # DNS-1123 subdomain
  118.                       namespace:
  119.                         type: string
  120.                         pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ # DNS-1123 label
  121.                   services:
  122.                     type: array
  123.                     items:
  124.                       type: object
  125.                       required:
  126.                        - name
  127.                         - port
  128.                       properties:
  129.                         name:
  130.                           type: string
  131.                           pattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$ # DNS-1035 label
  132.                         port:
  133.                           type: integer
  134.                         weight:
  135.                           type: integer
  136.                         strategy:
  137.                           type: string
  138.                           enum:
  139.                            - RoundRobin
  140.                             - WeightedLeastRequest
  141.                             - Random
  142.                             - RingHash
  143.                             - Maglev
  144.                         healthCheck:
  145.                           type: object
  146.                           required:
  147.                            - path
  148.                           properties:
  149.                             path:
  150.                               type: string
  151.                               pattern: ^\/.*$
  152.                             intervalSeconds:
  153.                               type: integer
  154.                             timeoutSeconds:
  155.                               type: integer
  156.                             unhealthyThresholdCount:
  157.                               type: integer
  158.                             healthyThresholdCount:
  159.                               type: integer
  160. ---
  161. apiVersion: extensions/v1beta1
  162. kind: Deployment
  163. metadata:
  164.   labels:
  165.     app: contour
  166.   name: contour
  167.   namespace: heptio-contour
  168. spec:
  169.   selector:
  170.     matchLabels:
  171.       app: contour
  172.   replicas: 2
  173.   template:
  174.     metadata:
  175.       labels:
  176.         app: contour
  177.       annotations:
  178.         prometheus.io/scrape: "true"
  179.         prometheus.io/port: "8002"
  180.         prometheus.io/path: "/stats"
  181.         prometheus.io/format: "prometheus"
  182.     spec:
  183.       containers:
  184.       - image: gcr.io/heptio-images/contour:master
  185.         imagePullPolicy: Always
  186.         name: contour
  187.         command: ["contour"]
  188.         args: ["serve", "--incluster", "--use-proxy-protocol"]
  189.       - image: docker.io/envoyproxy/envoy-alpine:v1.7.0
  190.         name: envoy
  191.         ports:
  192.         - containerPort: 8080
  193.           name: http
  194.         - containerPort: 8443
  195.           name: https
  196.         command: ["envoy"]
  197.         args:
  198.        - --config-path /config/contour.yaml
  199.         - --service-cluster cluster0
  200.         - --service-node node0
  201.         - --log-level info
  202.         - --v2-config-only
  203.         readinessProbe:
  204.           httpGet:
  205.             path: /healthz
  206.             port: 8002
  207.           initialDelaySeconds: 3
  208.           periodSeconds: 3
  209.         volumeMounts:
  210.         - name: contour-config
  211.           mountPath: /config
  212.         lifecycle:
  213.           preStop:
  214.             exec:
  215.               command: ["wget", "-qO-", "http://localhost:9001/healthcheck/fail"]
  216.       initContainers:
  217.       - image: gcr.io/heptio-images/contour:master
  218.         imagePullPolicy: Always
  219.         name: envoy-initconfig
  220.         command: ["contour"]
  221.         args:
  222.        - bootstrap
  223.         # Uncomment the statsd-enable to enable statsd metrics
  224.         #- --statsd-enable
  225.         # Uncomment to set a custom stats emission address and port
  226.         #- --stats-address=0.0.0.0
  227.         #- --stats-port=8002
  228.         - /config/contour.yaml
  229.         volumeMounts:
  230.         - name: contour-config
  231.           mountPath: /config
  232.       volumes:
  233.       - name: contour-config
  234.         emptyDir: {}
  235.       dnsPolicy: ClusterFirst
  236.       serviceAccountName: contour
  237.       terminationGracePeriodSeconds: 30
  238.       # The affinity stanza below tells Kubernetes to try hard not to place 2 of
  239.       # these pods on the same node.
  240.       affinity:
  241.         podAntiAffinity:
  242.           preferredDuringSchedulingIgnoredDuringExecution:
  243.           - weight: 100
  244.             podAffinityTerm:
  245.               labelSelector:
  246.                 matchLabels:
  247.                   app: contour
  248.               topologyKey: kubernetes.io/hostname
  249. ---
  250. apiVersion: rbac.authorization.k8s.io/v1beta1
  251. kind: ClusterRoleBinding
  252. metadata:
  253.   name: contour
  254. roleRef:
  255.   apiGroup: rbac.authorization.k8s.io
  256.   kind: ClusterRole
  257.   name: contour
  258. subjects:
  259. - kind: ServiceAccount
  260.   name: contour
  261.   namespace: heptio-contour
  262. ---
  263. apiVersion: rbac.authorization.k8s.io/v1beta1
  264. kind: ClusterRole
  265. metadata:
  266.   name: contour
  267. rules:
  268. - apiGroups:
  269.  - ""
  270.   resources:
  271.  - configmaps
  272.   - endpoints
  273.   - nodes
  274.   - pods
  275.   - secrets
  276.   verbs:
  277.  - list
  278.   - watch
  279. - apiGroups:
  280.  - ""
  281.   resources:
  282.  - nodes
  283.   verbs:
  284.  - get
  285. - apiGroups:
  286.  - ""
  287.   resources:
  288.  - services
  289.   verbs:
  290.  - get
  291.   - list
  292.   - watch
  293. - apiGroups:
  294.  - extensions
  295.   resources:
  296.  - ingresses
  297.   verbs:
  298.  - get
  299.   - list
  300.   - watch
  301. - apiGroups: ["contour.heptio.com"]
  302.   resources: ["ingressroutes"]
  303.   verbs:
  304.  - get
  305.   - list
  306.   - watch
  307.   - put
  308.   - post
  309.   - patch
  310. ---
  311. apiVersion: v1
  312. kind: Service
  313. metadata:
  314.  name: contour
  315.  namespace: heptio-contour
  316.  annotations:
  317.  # This annotation puts the AWS ELB into "TCP" mode so that it does not
  318.   # do HTTP negotiation for HTTPS connections at the ELB edge.
  319.   # The downside of this is the remote IP address of all connections will
  320.   # appear to be the internal address of the ELB. See docs/proxy-proto.md
  321.   # for information about enabling the PROXY protocol on the ELB to recover
  322.   # the original remote IP address.
  323.   service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
  324.   service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*'
  325. spec:
  326.  ports:
  327.  - port: 80
  328.    name: http
  329.    protocol: TCP
  330.    targetPort: 8080
  331.  - port: 443
  332.    name: https
  333.    protocol: TCP
  334.    targetPort: 8443
  335.  selector:
  336.    app: contour
  337.  type: LoadBalancer
  338. ---
Advertisement
Add Comment
Please, Sign In to add comment