# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. apiVersion: v1 kind: ServiceAccount metadata: name: controller-manager --- apiVersion: v1 kind: Service metadata: name: manager labels: cnrm.cloud.google.com/monitored: "true" annotations: prometheus.io/scrape: 'true' prometheus.io/port: '8888' spec: selector: cnrm.cloud.google.com/component: cnrm-controller-manager ports: - port: 443 name: controller-manager - port: 8888 name: metrics --- apiVersion: apps/v1 kind: StatefulSet metadata: name: controller-manager labels: cnrm.cloud.google.com/component: cnrm-controller-manager spec: selector: matchLabels: cnrm.cloud.google.com/component: cnrm-controller-manager serviceName: manager template: metadata: labels: cnrm.cloud.google.com/component: cnrm-controller-manager spec: serviceAccountName: controller-manager containers: - command: - /configconnector/manager args: ["--prometheus-scrape-endpoint=:8888"] image: controller:latest imagePullPolicy: Always name: manager ports: # Port used for readiness probe - containerPort: 23232 resources: limits: memory: 512Mi requests: # This value was tuned to run on a GKE cluster with # default node settings. Increasing this value may # result in a backwards-incompatible change that breaks # add-on updates by not allowing new versions to schedule themselves. cpu: 100m memory: 512Mi securityContext: privileged: false runAsUser: 1000 runAsNonRoot: true allowPrivilegeEscalation: false readinessProbe: httpGet: path: /ready port: 23232 initialDelaySeconds: 7 periodSeconds: 3 enableServiceLinks: false terminationGracePeriodSeconds: 10