--- apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: k8smetricalarms.containerinsights.eks.com spec: group: containerinsights.eks.com version: v1 versions: - name: v1 served: true storage: true scope: Namespaced names: kind: K8sMetricAlarm plural: k8smetricalarms singular: k8smetricalarm shortNames: - k8sma preserveUnknownFields: false validation: openAPIV3Schema: type: object properties: spec: type: object properties: minReplicas: type: integer maxReplicas: type: integer scaleUpBehavior: type: object properties: coolDown: type: integer policies: type: array items: type: object properties: type: type: string value: type: integer scaleDownBehavior: type: object properties: coolDown: type: integer policies: type: array items: type: object properties: type: type: string value: type: integer deployment: type: string scaleUpAlarmConfig: type: string scaleDownAlarmConfig: type: string --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: cloudwatchalarm-controller-role labels: app.kubernetes.io/component: controller app.kubernetes.io/name: cloudwatchalarm-controller rules: - apiGroups: - containerinsights.eks.com resources: - k8smetricalarms verbs: - '*' --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: cloudwatchalarm-controller-rolebinding labels: app.kubernetes.io/component: controller app.kubernetes.io/name: cloudwatchalarm-controller roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cloudwatchalarm-controller-role subjects: - kind: ServiceAccount name: cloudwatchalarm-controller namespace: kube-system --- apiVersion: apps/v1 kind: Deployment metadata: name: cloudwatchalarm-controller namespace: kube-system spec: replicas: 1 selector: matchLabels: app: cloudwatchalarm role: operator template: metadata: labels: app: cloudwatchalarm role: operator annotations: prometheus.io/scrape: 'false' spec: serviceAccountName: cloudwatchalarm-controller containers: - name: java image: vijisarathy/k8s-cloudwatch-controller:latest imagePullPolicy: Always ports: - containerPort: 8080 name: http protocol: TCP resources: requests: cpu: "100m" memory: "256Mi" limits: cpu: "500m" memory: "500Mi" livenessProbe: httpGet: path: /live port: 8080 initialDelaySeconds: 15 timeoutSeconds: 1 periodSeconds: 10 failureThreshold: 3 readinessProbe: httpGet: path: /ready port: 8080 initialDelaySeconds: 15 timeoutSeconds: 1 periodSeconds: 10 failureThreshold: 3 --- apiVersion: v1 kind: Service metadata: name: cloudwatchalarm-svc namespace: kube-system spec: sessionAffinity: None type: ClusterIP ports: - port: 80 protocol: TCP targetPort: 8080 selector: app: cloudwatchalarm role: operator