Created
          February 13, 2018 12:04 
        
      - 
      
- 
        Save ycliuhw/03d8aa29c6b4377a66a7afc4c2160280 to your computer and use it in GitHub Desktop. 
  
    
      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
    
  
  
    
  | --- | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: {{service.name}} | |
| annotations: | |
| getambassador.io/config: | | |
| --- | |
| apiVersion: ambassador/v1 | |
| kind: Mapping | |
| name: {{build.name}}-prometheus-mapping | |
| prefix: /prometheus/ | |
| service: prometheus | |
| spec: | |
| selector: | |
| app: {{service.name}} | |
| ports: | |
| - name: http | |
| protocol: TCP | |
| port: 80 | |
| targetPort: 80 | |
| type: LoadBalancer | |
| --- | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: {{service.name}}-metrics | |
| annotations: | |
| prometheus.io/scrape: "true" | |
| prometheus.io/path: "/metrics" | |
| prometheus.io/port: "9102" | |
| spec: | |
| selector: | |
| app: {{service.name}} | |
| ports: | |
| - name: metrics | |
| port: 9102 | |
| targetPort: 9102 | |
| type: ClusterIP | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1beta1 | |
| kind: ClusterRole | |
| metadata: | |
| name: {{service.name}} | |
| rules: | |
| - apiGroups: [""] | |
| resources: | |
| - services | |
| verbs: ["get", "list", "watch"] | |
| --- | |
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: {{service.name}} | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1beta1 | |
| kind: ClusterRoleBinding | |
| metadata: | |
| name: {{service.name}} | |
| roleRef: | |
| apiGroup: rbac.authorization.k8s.io | |
| kind: ClusterRole | |
| name: {{service.name}} | |
| subjects: | |
| - kind: ServiceAccount | |
| name: {{service.name}} | |
| namespace: default | |
| --- | |
| apiVersion: extensions/v1beta1 | |
| kind: Deployment | |
| metadata: {name: {{service.name}}} | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: {app: {{service.name}}} | |
| strategy: | |
| rollingUpdate: {maxSurge: 1, maxUnavailable: 0} | |
| type: RollingUpdate | |
| revisionHistoryLimit: 1 | |
| template: | |
| metadata: | |
| labels: {app: {{service.name}}} | |
| name: {{service.name}} | |
| spec: | |
| serviceAccountName: {{service.name}} | |
| containers: | |
| - image: {{build.images["ambassador/Dockerfile"]}} | |
| imagePullPolicy: IfNotPresent | |
| name: {{service.name}} | |
| resources: | |
| requests: | |
| memory: {{service.min_memory}} | |
| cpu: {{service.min_cpu}} | |
| limits: | |
| memory: {{service.max_memory}} | |
| cpu: {{service.max_cpu}} | |
| terminationMessagePath: /dev/termination-log | |
| - name: statsd-exporter | |
| image: prom/statsd-exporter | |
| restartPolicy: Always | |
| dnsPolicy: ClusterFirst | |
| restartPolicy: Always | |
| securityContext: {} | |
| terminationGracePeriodSeconds: 30 | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment