a73cf1f227528fdcae1006358a583cfad90fb2a6
[demo.git] / vnfs / DAaaS / 00-init / gloo / templates / 17-knative-no-istio-0.5.1.yaml
1 {{- if .Values.settings.integrations.knative.enabled }}
2 apiVersion: v1
3 kind: Namespace
4 metadata:
5   labels:
6     app: gloo
7     istio-injection: enabled
8     serving.knative.dev/release: devel
9   name: knative-serving
10
11 ---
12 aggregationRule:
13   clusterRoleSelectors:
14     - matchLabels:
15         serving.knative.dev/controller: "true"
16 apiVersion: rbac.authorization.k8s.io/v1
17 kind: ClusterRole
18 metadata:
19   labels:
20     serving.knative.dev/release: devel
21   name: knative-serving-admin
22 rules: []
23 ---
24 apiVersion: rbac.authorization.k8s.io/v1
25 kind: ClusterRole
26 metadata:
27   labels:
28     serving.knative.dev/controller: "true"
29     serving.knative.dev/release: devel
30   name: knative-serving-core
31 rules:
32   - apiGroups:
33       - ""
34     resources:
35       - pods
36       - namespaces
37       - secrets
38       - configmaps
39       - endpoints
40       - services
41       - events
42       - serviceaccounts
43     verbs:
44       - get
45       - list
46       - create
47       - update
48       - delete
49       - patch
50       - watch
51   - apiGroups:
52       - extensions
53     resources:
54       - ingresses
55       - deployments
56     verbs:
57       - get
58       - list
59       - create
60       - update
61       - delete
62       - patch
63       - watch
64   - apiGroups:
65       - apps
66     resources:
67       - deployments
68       - deployments/scale
69       - statefulsets
70     verbs:
71       - get
72       - list
73       - create
74       - update
75       - delete
76       - patch
77       - watch
78   - apiGroups:
79       - admissionregistration.k8s.io
80     resources:
81       - mutatingwebhookconfigurations
82     verbs:
83       - get
84       - list
85       - create
86       - update
87       - delete
88       - patch
89       - watch
90   - apiGroups:
91       - apiextensions.k8s.io
92     resources:
93       - customresourcedefinitions
94     verbs:
95       - get
96       - list
97       - create
98       - update
99       - delete
100       - patch
101       - watch
102   - apiGroups:
103       - serving.knative.dev
104     resources:
105       - configurations
106       - routes
107       - revisions
108       - services
109     verbs:
110       - get
111       - list
112       - create
113       - update
114       - delete
115       - patch
116       - watch
117   - apiGroups:
118       - serving.knative.dev
119     resources:
120       - configurations/status
121       - routes/status
122       - revisions/status
123       - services/status
124     verbs:
125       - get
126       - list
127       - create
128       - update
129       - delete
130       - patch
131       - watch
132   - apiGroups:
133       - autoscaling.internal.knative.dev
134     resources:
135       - podautoscalers
136       - podautoscalers/status
137     verbs:
138       - get
139       - list
140       - create
141       - update
142       - delete
143       - patch
144       - watch
145   - apiGroups:
146       - autoscaling
147     resources:
148       - horizontalpodautoscalers
149     verbs:
150       - get
151       - list
152       - create
153       - update
154       - delete
155       - patch
156       - watch
157   - apiGroups:
158       - caching.internal.knative.dev
159     resources:
160       - images
161     verbs:
162       - get
163       - list
164       - create
165       - update
166       - delete
167       - patch
168       - watch
169   - apiGroups:
170       - networking.internal.knative.dev
171     resources:
172       - clusteringresses
173       - clusteringresses/status
174       - serverlessservices
175       - serverlessservices/status
176     verbs:
177       - get
178       - list
179       - create
180       - update
181       - delete
182       - deletecollection
183       - patch
184       - watch
185   - apiGroups:
186       - networking.istio.io
187     resources:
188       - virtualservices
189     verbs:
190       - get
191       - list
192       - create
193       - update
194       - delete
195       - patch
196       - watch
197
198 ---
199 apiVersion: v1
200 kind: ServiceAccount
201 metadata:
202   labels:
203     serving.knative.dev/release: devel
204   name: controller
205   namespace: knative-serving
206
207 ---
208 apiVersion: rbac.authorization.k8s.io/v1
209 kind: ClusterRoleBinding
210 metadata:
211   labels:
212     serving.knative.dev/release: devel
213   name: knative-serving-controller-admin
214 roleRef:
215   apiGroup: rbac.authorization.k8s.io
216   kind: ClusterRole
217   name: knative-serving-admin
218 subjects:
219   - kind: ServiceAccount
220     name: controller
221     namespace: knative-serving
222
223 ---
224 apiVersion: v1
225 kind: Service
226 metadata:
227   labels:
228     app: activator
229     serving.knative.dev/release: devel
230   name: activator-service
231   namespace: knative-serving
232 spec:
233   ports:
234     - name: http
235       nodePort: null
236       port: 80
237       protocol: TCP
238       targetPort: 8080
239     - name: http2
240       port: 81
241       protocol: TCP
242       targetPort: 8081
243     - name: metrics
244       nodePort: null
245       port: 9090
246       protocol: TCP
247       targetPort: 9090
248   selector:
249     app: activator
250   type: ClusterIP
251
252 ---
253 apiVersion: v1
254 kind: Service
255 metadata:
256   labels:
257     app: controller
258     serving.knative.dev/release: devel
259   name: controller
260   namespace: knative-serving
261 spec:
262   ports:
263     - name: metrics
264       port: 9090
265       protocol: TCP
266       targetPort: 9090
267   selector:
268     app: controller
269
270 ---
271 apiVersion: v1
272 kind: Service
273 metadata:
274   labels:
275     role: webhook
276     serving.knative.dev/release: devel
277   name: webhook
278   namespace: knative-serving
279 spec:
280   ports:
281     - port: 443
282       targetPort: 443
283   selector:
284     role: webhook
285
286 ---
287 apiVersion: caching.internal.knative.dev/v1alpha1
288 kind: Image
289 metadata:
290   labels:
291     serving.knative.dev/release: devel
292   name: queue-proxy
293   namespace: knative-serving
294 spec:
295   image: gcr.io/knative-releases/github.com/knative/serving/cmd/queue@sha256:b5c759e4ea6f36ae4498c1ec794653920345b9ad7492731fb1d6087e3b95dc43
296
297 ---
298 apiVersion: apps/v1
299 kind: Deployment
300 metadata:
301   labels:
302     serving.knative.dev/release: devel
303   name: activator
304   namespace: knative-serving
305 spec:
306   selector:
307     matchLabels:
308       app: activator
309       role: activator
310   template:
311     metadata:
312       annotations:
313         sidecar.istio.io/inject: "true"
314       labels:
315         app: activator
316         role: activator
317         serving.knative.dev/release: devel
318     spec:
319       containers:
320         - args:
321             - -logtostderr=false
322             - -stderrthreshold=FATAL
323           env:
324             - name: POD_NAME
325               valueFrom:
326                 fieldRef:
327                   fieldPath: metadata.name
328             - name: SYSTEM_NAMESPACE
329               valueFrom:
330                 fieldRef:
331                   fieldPath: metadata.namespace
332             - name: CONFIG_LOGGING_NAME
333               value: config-logging
334           image: gcr.io/knative-releases/github.com/knative/serving/cmd/activator@sha256:60630ac88d8cb67debd1e2ab1ecd6ec3ff6cbab2336dda8e7ae1c01ebead76c0
335           livenessProbe:
336             httpGet:
337               path: /healthz
338               port: 8080
339           name: activator
340           ports:
341             - containerPort: 8080
342               name: http1-port
343             - containerPort: 8081
344               name: h2c-port
345             - containerPort: 9090
346               name: metrics-port
347           readinessProbe:
348             httpGet:
349               path: /healthz
350               port: 8080
351           resources:
352             limits:
353               cpu: 200m
354               memory: 600Mi
355             requests:
356               cpu: 20m
357               memory: 60Mi
358           volumeMounts:
359             - mountPath: /etc/config-logging
360               name: config-logging
361             - mountPath: /etc/config-observability
362               name: config-observability
363       serviceAccountName: controller
364       volumes:
365         - configMap:
366             name: config-logging
367           name: config-logging
368         - configMap:
369             name: config-observability
370           name: config-observability
371
372 ---
373 apiVersion: v1
374 kind: Service
375 metadata:
376   labels:
377     app: autoscaler
378     serving.knative.dev/release: devel
379   name: autoscaler
380   namespace: knative-serving
381 spec:
382   ports:
383     - name: http
384       port: 8080
385       protocol: TCP
386       targetPort: 8080
387     - name: metrics
388       port: 9090
389       protocol: TCP
390       targetPort: 9090
391   selector:
392     app: autoscaler
393
394 ---
395 apiVersion: apps/v1
396 kind: Deployment
397 metadata:
398   labels:
399     serving.knative.dev/release: devel
400   name: autoscaler
401   namespace: knative-serving
402 spec:
403   replicas: 1
404   selector:
405     matchLabels:
406       app: autoscaler
407   template:
408     metadata:
409       annotations:
410         sidecar.istio.io/inject: "true"
411       labels:
412         app: autoscaler
413     spec:
414       containers:
415         - env:
416             - name: SYSTEM_NAMESPACE
417               valueFrom:
418                 fieldRef:
419                   fieldPath: metadata.namespace
420             - name: CONFIG_LOGGING_NAME
421               value: config-logging
422           image: gcr.io/knative-releases/github.com/knative/serving/cmd/autoscaler@sha256:442f99e3a55653b19137b44c1d00f681b594d322cb39c1297820eb717e2134ba
423           name: autoscaler
424           ports:
425             - containerPort: 8080
426               name: websocket
427             - containerPort: 9090
428               name: metrics
429           resources:
430             limits:
431               cpu: 300m
432               memory: 400Mi
433             requests:
434               cpu: 30m
435               memory: 40Mi
436           volumeMounts:
437             - mountPath: /etc/config-autoscaler
438               name: config-autoscaler
439             - mountPath: /etc/config-logging
440               name: config-logging
441             - mountPath: /etc/config-observability
442               name: config-observability
443       serviceAccountName: controller
444       volumes:
445         - configMap:
446             name: config-autoscaler
447           name: config-autoscaler
448         - configMap:
449             name: config-logging
450           name: config-logging
451         - configMap:
452             name: config-observability
453           name: config-observability
454
455 ---
456 apiVersion: v1
457 data:
458   _example: |
459     ################################
460     #                              #
461     #    EXAMPLE CONFIGURATION     #
462     #                              #
463     ################################
464
465     # This block is not actually functional configuration,
466     # but serves to illustrate the available configuration
467     # options and document them in a way that is accessible
468     # to users that `kubectl edit` this config map.
469     #
470     # These sample configuration options may be copied out of
471     # this block and unindented to actually change the configuration.
472
473     # The Revision ContainerConcurrency field specifies the maximum number
474     # of requests the Container can handle at once. Container concurrency
475     # target percentage is how much of that maximum to use in a stable
476     # state. E.g. if a Revision specifies ContainerConcurrency of 10, then
477     # the Autoscaler will try to maintain 7 concurrent connections per pod
478     # on average. A value of 0.7 is chosen because the Autoscaler panics
479     # when concurrency exceeds 2x the desired set point. So we will panic
480     # before we reach the limit.
481     container-concurrency-target-percentage: "1.0"
482
483     # The container concurrency target default is what the Autoscaler will
484     # try to maintain when the Revision specifies unlimited concurrency.
485     # Even when specifying unlimited concurrency, the autoscaler will
486     # horizontally scale the application based on this target concurrency.
487     #
488     # A value of 100 is chosen because it's enough to allow vertical pod
489     # autoscaling to tune resource requests. E.g. maintaining 1 concurrent
490     # "hello world" request doesn't consume enough resources to allow VPA
491     # to achieve efficient resource usage (VPA CPU minimum is 300m).
492     container-concurrency-target-default: "100"
493
494     # When operating in a stable mode, the autoscaler operates on the
495     # average concurrency over the stable window.
496     stable-window: "60s"
497
498     # When observed average concurrency during the panic window reaches 2x
499     # the target concurrency, the autoscaler enters panic mode. When
500     # operating in panic mode, the autoscaler operates on the average
501     # concurrency over the panic window.
502     panic-window: "6s"
503
504     # Max scale up rate limits the rate at which the autoscaler will
505     # increase pod count. It is the maximum ratio of desired pods versus
506     # observed pods.
507     max-scale-up-rate: "10"
508
509     # Scale to zero feature flag
510     enable-scale-to-zero: "true"
511
512     # Tick interval is the time between autoscaling calculations.
513     tick-interval: "2s"
514
515     # Dynamic parameters (take effect when config map is updated):
516
517     # Scale to zero grace period is the time an inactive revision is left
518     # running before it is scaled to zero (min: 30s).
519     scale-to-zero-grace-period: "30s"
520 kind: ConfigMap
521 metadata:
522   labels:
523     serving.knative.dev/release: devel
524   name: config-autoscaler
525   namespace: knative-serving
526
527 ---
528 apiVersion: v1
529 data:
530   _example: |
531     ################################
532     #                              #
533     #    EXAMPLE CONFIGURATION     #
534     #                              #
535     ################################
536
537     # This block is not actually functional configuration,
538     # but serves to illustrate the available configuration
539     # options and document them in a way that is accessible
540     # to users that `kubectl edit` this config map.
541     #
542     # These sample configuration options may be copied out of
543     # this block and unindented to actually change the configuration.
544
545     # List of repositories for which tag to digest resolving should be skipped
546     registriesSkippingTagResolving: "ko.local,dev.local"
547   queueSidecarImage: gcr.io/knative-releases/github.com/knative/serving/cmd/queue@sha256:b5c759e4ea6f36ae4498c1ec794653920345b9ad7492731fb1d6087e3b95dc43
548 kind: ConfigMap
549 metadata:
550   labels:
551     serving.knative.dev/release: devel
552   name: config-controller
553   namespace: knative-serving
554
555 ---
556 apiVersion: v1
557 data:
558   _example: |
559     ################################
560     #                              #
561     #    EXAMPLE CONFIGURATION     #
562     #                              #
563     ################################
564
565     # This block is not actually functional configuration,
566     # but serves to illustrate the available configuration
567     # options and document them in a way that is accessible
568     # to users that `kubectl edit` this config map.
569     #
570     # These sample configuration options may be copied out of
571     # this block and unindented to actually change the configuration.
572
573     # revision-timeout-seconds contains the default number of
574     # seconds to use for the revision's per-request timeout, if
575     # none is specified.
576     revision-timeout-seconds: "300"  # 5 minutes
577
578     # revision-cpu-request contains the cpu allocation to assign
579     # to revisions by default.
580     revision-cpu-request: "400m"  # 0.4 of a CPU (aka 400 milli-CPU)
581 kind: ConfigMap
582 metadata:
583   labels:
584     serving.knative.dev/release: devel
585   name: config-defaults
586   namespace: knative-serving
587
588 ---
589 apiVersion: v1
590 data:
591   _example: |
592     ################################
593     #                              #
594     #    EXAMPLE CONFIGURATION     #
595     #                              #
596     ################################
597
598     # This block is not actually functional configuration,
599     # but serves to illustrate the available configuration
600     # options and document them in a way that is accessible
601     # to users that `kubectl edit` this config map.
602     #
603     # These sample configuration options may be copied out of
604     # this block and unindented to actually change the configuration.
605
606     # Default value for domain.
607     # Although it will match all routes, it is the least-specific rule so it
608     # will only be used if no other domain matches.
609     example.com: |
610
611     # These are example settings of domain.
612     # example.org will be used for routes having app=nonprofit.
613     example.org: |
614       selector:
615         app: nonprofit
616
617     # Routes having domain suffix of 'svc.cluster.local' will not be exposed
618     # through Ingress. You can define your own label selector to assign that
619     # domain suffix to your Route here, or you can set the label
620     #    "serving.knative.dev/visibility=cluster-local"
621     # to achieve the same effect.  This shows how to make routes having
622     # the label app=secret only exposed to the local cluster.
623     svc.cluster.local: |
624       selector:
625         app: secret
626 kind: ConfigMap
627 metadata:
628   labels:
629     serving.knative.dev/release: devel
630   name: config-domain
631   namespace: knative-serving
632
633 ---
634 apiVersion: v1
635 data:
636   _example: |
637     ################################
638     #                              #
639     #    EXAMPLE CONFIGURATION     #
640     #                              #
641     ################################
642
643     # This block is not actually functional configuration,
644     # but serves to illustrate the available configuration
645     # options and document them in a way that is accessible
646     # to users that `kubectl edit` this config map.
647     #
648     # These sample configuration options may be copied out of
649     # this block and unindented to actually change the configuration.
650
651     # Delay after revision creation before considering it for GC
652     stale-revision-create-delay: "24h"
653
654     # Duration since a route has been pointed at a revision before it should be GC'd
655     # This minus lastpinned-debounce be longer than the controller resync period (10 hours)
656     stale-revision-timeout: "15h"
657
658     # Minimum number of generations of revisions to keep before considering for GC
659     stale-revision-minimum-generations: "1"
660
661     # To avoid constant updates, we allow an existing annotation to be stale by this
662     # amount before we update the timestamp
663     stale-revision-lastpinned-debounce: "5h"
664 kind: ConfigMap
665 metadata:
666   labels:
667     serving.knative.dev/release: devel
668   name: config-gc
669   namespace: knative-serving
670
671 ---
672 apiVersion: v1
673 kind: ConfigMap
674 metadata:
675   labels:
676     networking.knative.dev/ingress-provider: istio
677     serving.knative.dev/release: devel
678   name: config-istio
679   namespace: knative-serving
680
681 ---
682 apiVersion: v1
683 data:
684   _example: |
685     ################################
686     #                              #
687     #    EXAMPLE CONFIGURATION     #
688     #                              #
689     ################################
690
691     # This block is not actually functional configuration,
692     # but serves to illustrate the available configuration
693     # options and document them in a way that is accessible
694     # to users that `kubectl edit` this config map.
695     #
696     # These sample configuration options may be copied out of
697     # this block and unindented to actually change the configuration.
698
699     # Common configuration for all Knative codebase
700     zap-logger-config: |
701       {
702         "level": "info",
703         "development": false,
704         "outputPaths": ["stdout"],
705         "errorOutputPaths": ["stderr"],
706         "encoding": "json",
707         "encoderConfig": {
708           "timeKey": "ts",
709           "levelKey": "level",
710           "nameKey": "logger",
711           "callerKey": "caller",
712           "messageKey": "msg",
713           "stacktraceKey": "stacktrace",
714           "lineEnding": "",
715           "levelEncoder": "",
716           "timeEncoder": "iso8601",
717           "durationEncoder": "",
718           "callerEncoder": ""
719         }
720       }
721
722     # Log level overrides
723     # For all components except the autoscaler and queue proxy,
724     # changes are be picked up immediately.
725     # For autoscaler and queue proxy, changes require recreation of the pods.
726     loglevel.controller: "info"
727     loglevel.autoscaler: "info"
728     loglevel.queueproxy: "info"
729     loglevel.webhook: "info"
730     loglevel.activator: "info"
731 kind: ConfigMap
732 metadata:
733   labels:
734     serving.knative.dev/release: devel
735   name: config-logging
736   namespace: knative-serving
737
738 ---
739 apiVersion: v1
740 kind: ConfigMap
741 metadata:
742   labels:
743     serving.knative.dev/release: devel
744   name: config-network
745   namespace: knative-serving
746
747 ---
748 apiVersion: v1
749 data:
750   _example: |
751     ################################
752     #                              #
753     #    EXAMPLE CONFIGURATION     #
754     #                              #
755     ################################
756
757     # This block is not actually functional configuration,
758     # but serves to illustrate the available configuration
759     # options and document them in a way that is accessible
760     # to users that `kubectl edit` this config map.
761     #
762     # These sample configuration options may be copied out of
763     # this block and unindented to actually change the configuration.
764
765     # logging.enable-var-log-collection defaults to false.
766     # A fluentd sidecar will be set up to collect var log if
767     # this flag is true.
768     logging.enable-var-log-collection: false
769
770     # logging.fluentd-sidecar-image provides the fluentd sidecar image
771     # to inject as a sidecar to collect logs from /var/log.
772     # Must be presented if logging.enable-var-log-collection is true.
773     logging.fluentd-sidecar-image: k8s.gcr.io/fluentd-elasticsearch:v2.0.4
774
775     # logging.fluentd-sidecar-output-config provides the configuration
776     # for the fluentd sidecar, which will be placed into a configmap and
777     # mounted into the fluentd sidecar image.
778     logging.fluentd-sidecar-output-config: |
779       # Parse json log before sending to Elastic Search
780       <filter **>
781         @type parser
782         key_name log
783         <parse>
784           @type multi_format
785           <pattern>
786             format json
787             time_key fluentd-time # fluentd-time is reserved for structured logs
788             time_format %Y-%m-%dT%H:%M:%S.%NZ
789           </pattern>
790           <pattern>
791             format none
792             message_key log
793           </pattern>
794         </parse>
795       </filter>
796       # Send to Elastic Search
797       <match **>
798         @id elasticsearch
799         @type elasticsearch
800         @log_level info
801         include_tag_key true
802         # Elasticsearch service is in monitoring namespace.
803         host elasticsearch-logging.knative-monitoring
804         port 9200
805         logstash_format true
806         <buffer>
807           @type file
808           path /var/log/fluentd-buffers/kubernetes.system.buffer
809           flush_mode interval
810           retry_type exponential_backoff
811           flush_thread_count 2
812           flush_interval 5s
813           retry_forever
814           retry_max_interval 30
815           chunk_limit_size 2M
816           queue_limit_length 8
817           overflow_action block
818         </buffer>
819       </match>
820
821     # logging.revision-url-template provides a template to use for producing the
822     # logging URL that is injected into the status of each Revision.
823     # This value is what you might use the the Knative monitoring bundle, and provides
824     # access to Kibana after setting up kubectl proxy.
825     logging.revision-url-template: |
826       http://localhost:8001/api/v1/namespaces/knative-monitoring/services/kibana-logging/proxy/app/kibana#/discover?_a=(query:(match:(kubernetes.labels.knative-dev%2FrevisionUID:(query:'${REVISION_UID}',type:phrase))))
827
828     # If non-empty, this enables queue proxy writing request logs to stdout.
829     # The value determines the shape of the request logs and it must be a valid go text/template.
830     # It is important to keep this as a single line. Multiple lines are parsed as separate entities
831     # by most collection agents and will split the request logs into multiple records.
832     #
833     # The following fields and functions are available to the template:
834     #
835     # Request: An http.Request (see https://golang.org/pkg/net/http/#Request)
836     # representing an HTTP request received by the server.
837     #
838     # Response:
839     # struct {
840     #   Code    int       // HTTP status code (see https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
841     #   Size    int       // An int representing the size of the response.
842     #   Latency float64   // A float64 representing the latency of the response in seconds.
843     # }
844     #
845     # Revision:
846     # struct {
847     #   Name          string  // Knative revision name
848     #   Namespace     string  // Knative revision namespace
849     #   Service       string  // Knative service name
850     #   Configuration string  // Knative configuration name
851     #   PodName       string  // Name of the pod hosting the revision
852     #   PodIP         string  // IP of the pod hosting the revision
853     # }
854     #
855     logging.request-log-template: '{"httpRequest": {"requestMethod": "{{ "{{" }}.Request.Method{{ "{{" }}", "requestUrl": "{{ "{{" }}js .Request.RequestURI{{ "{{" }}", "requestSize": "{{ "{{" }}.Request.ContentLength{{ "{{" }}", "status": {{ "{{" }}.Response.Code{{ "{{" }}, "responseSize": "{{ "{{" }}.Response.Size{{ "{{" }}", "userAgent": "{{ "{{" }}js .Request.UserAgent{{ "{{" }}", "remoteIp": "{{ "{{" }}js .Request.RemoteAddr{{ "{{" }}", "serverIp": "{{ "{{" }}.Revision.PodIP{{ "{{" }}", "referer": "{{ "{{" }}js .Request.Referer{{ "{{" }}", "latency": "{{ "{{" }}.Response.Latency{{ "{{" }}s", "protocol": "{{ "{{" }}.Request.Proto{{ "{{" }}"}, "traceId": "{{ "{{" }}index .Request.Header "X-B3-Traceid"{{ "{{" }}"}'
856
857     # metrics.backend-destination field specifies the system metrics destination.
858     # It supports either prometheus (the default) or stackdriver.
859     # Note: Using stackdriver will incur additional charges
860     metrics.backend-destination: prometheus
861
862     # metrics.request-metrics-backend-destination specifies the request metrics
863     # destination. If non-empty, it enables queue proxy to send request metrics.
864     # Currently supported values: prometheus, stackdriver.
865     metrics.request-metrics-backend-destination: prometheus
866
867     # metrics.stackdriver-project-id field specifies the stackdriver project ID. This
868     # field is optional. When running on GCE, application default credentials will be
869     # used if this field is not provided.
870     metrics.stackdriver-project-id: "<your stackdriver project id>"
871
872     # metrics.allow-stackdriver-custom-metrics indicates whether it is allowed to send metrics to
873     # Stackdriver using "global" resource type and custom metric type if the
874     # metrics are not supported by "knative_revision" resource type. Setting this
875     # flag to "true" could cause extra Stackdriver charge.
876     # If metrics.backend-destination is not Stackdriver, this is ignored.
877     metrics.allow-stackdriver-custom-metrics: "false"
878 kind: ConfigMap
879 metadata:
880   labels:
881     serving.knative.dev/release: devel
882   name: config-observability
883   namespace: knative-serving
884
885 ---
886 apiVersion: apps/v1
887 kind: Deployment
888 metadata:
889   labels:
890     serving.knative.dev/release: devel
891   name: controller
892   namespace: knative-serving
893 spec:
894   replicas: 1
895   selector:
896     matchLabels:
897       app: controller
898   template:
899     metadata:
900       annotations:
901         sidecar.istio.io/inject: "false"
902       labels:
903         app: controller
904     spec:
905       containers:
906         - env:
907             - name: SYSTEM_NAMESPACE
908               valueFrom:
909                 fieldRef:
910                   fieldPath: metadata.namespace
911             - name: CONFIG_LOGGING_NAME
912               value: config-logging
913           image: gcr.io/knative-releases/github.com/knative/serving/cmd/controller@sha256:25af5f3adad8b65db3126e0d6e90aa36835c124c24d9d72ffbdd7ee739a7f571
914           name: controller
915           ports:
916             - containerPort: 9090
917               name: metrics
918           resources:
919             limits:
920               cpu: 1000m
921               memory: 1000Mi
922             requests:
923               cpu: 100m
924               memory: 100Mi
925           volumeMounts:
926             - mountPath: /etc/config-logging
927               name: config-logging
928       serviceAccountName: controller
929       volumes:
930         - configMap:
931             name: config-logging
932           name: config-logging
933
934 ---
935 apiVersion: apps/v1
936 kind: Deployment
937 metadata:
938   labels:
939     serving.knative.dev/release: devel
940   name: webhook
941   namespace: knative-serving
942 spec:
943   replicas: 1
944   selector:
945     matchLabels:
946       app: webhook
947       role: webhook
948   template:
949     metadata:
950       annotations:
951         sidecar.istio.io/inject: "false"
952       labels:
953         app: webhook
954         role: webhook
955     spec:
956       containers:
957         - env:
958             - name: SYSTEM_NAMESPACE
959               valueFrom:
960                 fieldRef:
961                   fieldPath: metadata.namespace
962             - name: CONFIG_LOGGING_NAME
963               value: config-logging
964           image: gcr.io/knative-releases/github.com/knative/serving/cmd/webhook@sha256:d1ba3e2c0d739084ff508629db001619cea9cc8780685e85dd910363774eaef6
965           name: webhook
966           resources:
967             limits:
968               cpu: 200m
969               memory: 200Mi
970             requests:
971               cpu: 20m
972               memory: 20Mi
973           volumeMounts:
974             - mountPath: /etc/config-logging
975               name: config-logging
976       serviceAccountName: controller
977       volumes:
978         - configMap:
979             name: config-logging
980           name: config-logging
981
982 {{- end }}