Skip to content

Commit 3951fd3

Browse files
committed
Merge branch 'main' into gmudumbai/sdo-2649-k8s-optimizer
# Conflicts: # README.md # charts/cloudhealth-collector/Chart.yaml # charts/cloudhealth-collector/templates/clusterrole.yaml # charts/cloudhealth-collector/templates/secrets.yaml
2 parents b630e7c + 8b53c9c commit 3951fd3

8 files changed

Lines changed: 80 additions & 10 deletions

File tree

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @CloudHealth/team-cheapsk8s @Cloudhealth/team-sudo
1+
* @Cloudhealth/team-sudo

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ Use the helm chart to deploy the CloudHealth Collector into each [Kubernetes](ht
2525

2626
## Installing the Collector Chart
2727

28-
To install the chart with the release name `cloudhealth-collector` in the `default` namespace, run the following commands:
28+
To install the chart with the release name `cloudhealth-collector` in a particular namespace `<target_namespace>` (create if it does not exist), run the following commands:
2929

3030
```console
3131
$ helm repo add cloudhealth https://cloudhealth.github.io/helm/
32-
$ helm install cloudhealth-collector --set apiToken=<Unique Customer API Token>,clusterName=<Cluster Name>,chtEndpointPrefix=<Cloudhealth Endpoint Prefix> cloudhealth/cloudhealth-collector
32+
$ helm install cloudhealth-collector -n <target_namespace> --create-namespace --set apiToken=<Unique Customer API Token>,clusterName=<Cluster Name>,chtEndpointPrefix=<Cloudhealth Endpoint Prefix> cloudhealth/cloudhealth-collector --debug
3333
```
3434

35-
To install the chart with the release name `cloudhealth-collector` in a specified namespace `<target_namespace>`, run the following commands:
35+
To install the chart with the release name `cloudhealth-collector` in `default` namespace, run the following command:
3636

3737
```console
3838
$ helm repo add cloudhealth https://cloudhealth.github.io/helm/
39-
$ helm install cloudhealth-collector -n <target_namespace> --set apiToken=<Unique Customer API Token>,clusterName=<Cluster Name>,chtEndpointPrefix=<Cloudhealth Endpoint Prefix> cloudhealth/cloudhealth-collector
39+
$ helm install cloudhealth-collector --set apiToken=<Unique Customer API Token>,clusterName=<Cluster Name>,chtEndpointPrefix=<Cloudhealth Endpoint Prefix> cloudhealth/cloudhealth-collector
4040
```
4141

4242
The `apiToken` is required for `cloudhealth-collector` to work and should be either set while running helm install command as in the example above or in a secret object with the following data structure:

charts/cloudhealth-collector/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ apiVersion: v2
55
name: cloudhealth-collector
66
description: A Helm chart for CloudHealth's Kubernetes Collector and Optimizer Agent
77
type: application
8-
version: 5.9.0-beta
9-
appVersion: "5.4.0"
8+
version: 5.9.1-beta
9+
appVersion: "7.0.0"
1010
dependencies:
1111
- name: k8s-optimization
1212
repository: oci://projects.registry.vmware.com/kubernetes-optimization

charts/cloudhealth-collector/templates/clusterrole.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
{{- include "cloudhealth-collector.labels" . | nindent 4 }}
1212
rules:
1313
- apiGroups: [""]
14-
resources: ["pods", "nodes", "namespaces", "services", "resourcequotas", "limitranges"]
14+
resources: ["pods", "nodes", "namespaces", "services", "resourcequotas", "limitranges", "persistentvolumes", "persistentvolumeclaims"]
1515
verbs: ["get", "list"]
1616
- apiGroups: ["metrics.k8s.io"]
1717
resources: ["pods", "nodes"]
@@ -22,6 +22,9 @@ rules:
2222
- apiGroups: ["batch"]
2323
resources: ["cronjobs", "jobs"]
2424
verbs: ["get", "list"]
25+
- apiGroups: ["networking.k8s.io"]
26+
resources: ["ingresses"]
27+
verbs: ["get", "list"]
2528
{{- if .Values.optimizer.enabled }}
2629
- apiGroups: ["cloudhealth.containers.com"]
2730
resources: ["rz-recommendation-settings"]

charts/cloudhealth-collector/templates/deployment.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@ spec:
3232
securityContext: {{- toYaml . | nindent 8 }}
3333
{{- end }}
3434
priorityClassName: {{ .Values.priorityClassName }}
35+
{{- if .Values.proxy.sslCert }}
36+
initContainers:
37+
- name: "{{ .Chart.Name }}-pem-to-truststore"
38+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
39+
env:
40+
- name: ca_bundle
41+
value: {{ .Values.proxy.caBundlePath }}
42+
- name: truststore_jks
43+
value: {{ .Values.proxy.truststorePath }}
44+
- name: truststore_pwd
45+
valueFrom:
46+
secretKeyRef:
47+
name: {{ include "cloudhealth-collector.secretName" . }}
48+
key: certPassword
49+
command: ['/bin/bash']
50+
args: ['-c', "csplit -z -f crt- $ca_bundle '/-----BEGIN CERTIFICATE-----/' '{*}' && for file in crt-*; do keytool -import -noprompt -keystore $truststore_jks -file $file -storepass $truststore_pwd -alias service-$file; done"]
51+
volumeMounts:
52+
- name: truststore-volume
53+
mountPath: /etc/ssl/certs
54+
{{- end }}
3555
containers:
3656
- name: {{ .Chart.Name }}
3757
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default "latest" }}"
@@ -69,6 +89,10 @@ spec:
6989
value: {{ .Values.collectionIntervalSecs | quote }}
7090
- name: CHT_JVM_MEM
7191
value: {{ .Values.jvmMemory }}
92+
{{- if .Values.proxy.sslCert }}
93+
- name: JAVA_OPTS
94+
value: {{ .Values.proxy.params }}
95+
{{- end }}
7296
{{- range .Values.customEnvVars}}
7397
- name: {{ .name }}
7498
value: {{ .value }}
@@ -101,4 +125,8 @@ spec:
101125
volumes:
102126
- name: tmpfs
103127
emptyDir: {}
128+
{{- if .Values.proxy.sslCert }}
129+
- name: truststore-volume
130+
emptyDir: {}
131+
{{- end }}
104132
{{- end }}

charts/cloudhealth-collector/templates/secrets.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ metadata:
1313
type: Opaque
1414
data:
1515
apiToken: {{ .Values.apiToken | b64enc | quote }}
16+
{{- if .Values.proxy.sslCert }}
17+
certPassword: {{ .Values.proxy.certPassword | quote }}
18+
{{- end }}
1619
{{- if .Values.optimizer.enabled }}
1720
chapiKey: {{ .Values.optimizer.chapiKey | b64enc | quote }}
1821
{{- end }}

charts/cloudhealth-collector/values.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jvmMemory: "-Xmx891M"
2727

2828
image:
2929
repository: cloudhealth/container-collector
30-
tag: "1423"
30+
tag: "1458"
3131

3232
imagePullSecrets: []
3333
nameOverride: ""
@@ -64,6 +64,14 @@ containerSecurityContext:
6464
capabilities:
6565
drop: [all]
6666

67+
proxy:
68+
sslCert: false
69+
#-Dhttps.proxyHost=$PROXY_SERVER -Dhttps.proxyPort=$PROXY_PORT -Dhttps.nonProxyHosts=kubernetes.default.svc -Djavax.net.ssl.trustStore=/etc/ssl/certs/truststore.jks -Djavax.net.ssl.trustStorePassword=changeit
70+
params: ""
71+
certPassword: ""
72+
caBundlePath: "/etc/ssl/certs/bundle.pem"
73+
truststorePath: "/etc/ssl/certs/truststore.jks"
74+
6775
resources:
6876
limits:
6977
cpu: 1000m

cloudhealth-collector-image-docs/CHANGELOG.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,39 @@ All notable changes for each upgraded tag of the CloudHealth Container Collector
55
The agent has been verified against:
66

77
[Kubernetes Versions ≥ 1.12](https://kubernetes.io/releases/)</br>
8-
[Kubernetes Versions ≤ 1.26](https://kubernetes.io/releases/)</br>
8+
[Kubernetes Versions ≤ 1.29](https://kubernetes.io/releases/)</br>
99
[OC Version ≥ 4.1](https://docs.openshift.com/container-platform)
1010

1111
All versions before June 20, 2022 have been deprecated.
1212

13+
## [1458] - 2024-03-11
14+
15+
### Added
16+
17+
* PersistentVolumes, PersistentVolumeClaims, Ingress and Service collected to prepare for comprehensive Kubernetes Cost Calculation
18+
19+
### Security
20+
21+
* Vulnerabilities patched:
22+
* [CVE-2023-0767](https://avd.aquasec.com/nvd/cve-2023-0767)
23+
* [CVE-2023-3320](https://avd.aquasec.com/nvd/cve-2023-3320)
24+
* [CVE-2023-4641](https://avd.aquasec.com/nvd/cve-2023-4641)
25+
* [CVE-2023-5981](https://avd.aquasec.com/nvd/cve-2023-5981)
26+
* [CVE-2023-6246](https://avd.aquasec.com/nvd/cve-2023-6246)
27+
* [CVE-2023-6779](https://avd.aquasec.com/nvd/cve-2023-6779)
28+
* [CVE-2023-6780](https://avd.aquasec.com/nvd/cve-2023-6780)
29+
* [CVE-2023-7104](https://avd.aquasec.com/nvd/cve-2023-7104)
30+
* [CVE-2023-29383](https://avd.aquasec.com/nvd/cve-2023-29383)
31+
* [CVE-2023-33201](https://avd.aquasec.com/nvd/cve-2023-33201)
32+
* [CVE-2023-33202](https://avd.aquasec.com/nvd/cve-2023-33202)
33+
* [CVE-2023-48795](https://avd.aquasec.com/nvd/cve-2023-48795)
34+
* [CVE-2023-52425](https://avd.aquasec.com/nvd/cve-2023-52425)
35+
* [CVE-2023-52426](https://avd.aquasec.com/nvd/cve-2023-52426)
36+
* [CVE-2024-0553](https://avd.aquasec.com/nvd/cve-2024-0553)
37+
* [CVE-2024-0567](https://avd.aquasec.com/nvd/cve-2024-0567)
38+
* [CVE-2024-0727](https://avd.aquasec.com/nvd/cve-2024-0727)
39+
* [CVE-2024-22365](https://avd.aquasec.com/nvd/cve-2024-22365)
40+
1341
## [1423] - 2023-12-14
1442

1543
### Added

0 commit comments

Comments
 (0)