Skip to content

Commit 07ae5d2

Browse files
authored
feat: Add AKS Support (besides OpenShift) (CP-3881) (#83)
JIRA: https://cloudbolt.atlassian.net/browse/CP-3881 Related: CloudBoltSoftware/cloudbolt-collector#51
2 parents 3002869 + e353ea4 commit 07ae5d2

File tree

5 files changed

+114
-5
lines changed

5 files changed

+114
-5
lines changed

.github/workflows/jira-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
continue-on-error: true
2727
run: |
2828
PR_TITLE=$(jq -r .pull_request.title "$GITHUB_EVENT_PATH")
29-
JIRA_TICKET_REGEX="(CMP|IN)-[0-9]+"
29+
JIRA_TICKET_REGEX="(CMP|CP|IN)-[0-9]+"
3030
if ! [[ $PR_TITLE =~ $JIRA_TICKET_REGEX ]]; then
31-
echo "PR title does not contain a valid JIRA ticket format (CMP-xxxx) or (IN-xxxx)."
31+
echo "PR title does not contain a valid JIRA ticket format (CMP-xxxx), (CP-xxxx) or (IN-xxxx)."
3232
exit 1
3333
fi
3434
env:

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ and sends it to the CloudBolt platform.
1616

1717
Below is a table of various parameters that can be set in the `values.yaml` file of the `cloudbolt-collector-helm` chart, along with their required status and default values:
1818

19-
| Parameter | Required | Description | Default Value |
19+
| Helm Parameter | Required | Description | Default Value |
2020
|------------------------------------|------------|--------------------------------------|---------------------|
21+
| `INGESTION_API_URL` | Yes | Ingestion API URL | `""` (empty string) |
2122
| `DEBUG` | No | Debug mode flag | `""` (empty string) |
2223
| `IMAGE_VERSION` | No | Version of the image | `"<helm-chart-version>"`|
23-
| `INGESTION_API_URL` | Yes | Ingestion API URL | `""` (empty string) |
24+
| `PROMETHEUS_BASE_URL` | No | URL to prometheus service | `""` (defaults to OpenShift prometheus URL) |
25+
| `COREAPI_BASE_URL`. | No | URL to core api. | `""` (defaults to OpenShift coreapi URL) |
2426

2527
## Prerequisites
2628

@@ -79,6 +81,7 @@ oc create secret generic cb-ingestion-token \
7981
--from-literal=INGESTION_API_TOKEN=<ingestion-api-token> \
8082
-n cloudbolt-collector
8183
```
84+
8285
### 7. Install the Chart
8386

8487
Install the latest CloudBolt Collector Helm chart from the `cloudbolt-collector` repository.
@@ -112,3 +115,29 @@ helm upgrade cloudbolt-collector cloudbolt-collector/cloudbolt-collector \
112115
--set IMAGE_VERSION=$IMAGE_VERSION \
113116
--set INGESTION_API_URL=$INGESTION_API_URL
114117
```
118+
119+
## Installation on Microsoft Azure
120+
121+
This helm chart was also succesfully used on Azure's Kubernetes cluster (AKS) and might even work on other Kubernetes offerings.
122+
123+
As an additional prerequisite a Prometheus installation scraping node and pod metrics is required.
124+
125+
```console
126+
export PROMETHEUS_BASE_URL="http://prometheus-kube-prometheus-prometheus.monitoring.svc.cluster.local:9090"
127+
export COREAPI_BASE_URL="https://kubernetes.default.svc"
128+
export INGESTION_API_URL="<cloudbolt-ingestion-api-url>"
129+
130+
# create a secret with the CloudBolt API token
131+
kubectl create secret generic cb-ingestion-token \
132+
--from-literal=INGESTION_API_TOKEN=<cloudbolt-ingestion-api-token> \
133+
-n cloudbolt-collector
134+
135+
# Updates or installs the cloudbolt-collector helm chart
136+
helm upgrade --install cloudbolt-collector cloudbolt-collector/cloudbolt-collector \
137+
--namespace cloudbolt-collector --create-namespace \
138+
--set INGESTION_API_URL=$INGESTION_API_URL \
139+
--set PROMETHEUS_BASE_URL=$PROMETHEUS_BASE_URL \
140+
--set COREAPI_BASE_URL=$COREAPI_BASE_URL \
141+
--set clusterRole.create=true \
142+
--set securityContext.runAsUser=1001
143+
```

templates/clusterrolebinding.yaml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
1+
{{/* ClusterRoles don't seem to be required on OpenShift */}}
2+
{{- if .Values.clusterRole.create -}}
3+
---
4+
apiVersion: rbac.authorization.k8s.io/v1
5+
kind: ClusterRole
6+
metadata:
7+
name: {{ include "cloudbolt-collector-helm.fullname" . }}-nodes-access
8+
rules:
9+
- apiGroups: [""]
10+
resources: ["nodes"]
11+
verbs: ["get", "list"]
12+
---
13+
apiVersion: rbac.authorization.k8s.io/v1
14+
kind: ClusterRole
15+
metadata:
16+
name: {{ include "cloudbolt-collector-helm.fullname" . }}-pv-access
17+
rules:
18+
- apiGroups: [""]
19+
resources: ["persistentvolumes"]
20+
verbs: ["get", "list"]
21+
{{ end }}
22+
123
{{- if .Values.serviceAccount.create -}}
24+
---
225
kind: ClusterRoleBinding
326
apiVersion: rbac.authorization.k8s.io/v1
427
metadata:
@@ -37,4 +60,44 @@ roleRef:
3760
apiGroup: rbac.authorization.k8s.io
3861
kind: ClusterRole
3962
name: admin
40-
{{- end }}
63+
{{- end }}
64+
65+
---
66+
apiVersion: rbac.authorization.k8s.io/v1
67+
kind: ClusterRoleBinding
68+
metadata:
69+
name: {{ include "cloudbolt-collector-helm.fullname" . }}-pv-access
70+
labels:
71+
{{- include "cloudbolt-collector-helm.labels" . | nindent 4 }}
72+
{{- with .Values.serviceAccount.annotations }}
73+
annotations:
74+
{{- toYaml . | nindent 4 }}
75+
{{- end }}
76+
roleRef:
77+
apiGroup: rbac.authorization.k8s.io
78+
kind: ClusterRole
79+
name: {{ include "cloudbolt-collector-helm.fullname" . }}-pv-access
80+
subjects:
81+
- kind: ServiceAccount
82+
name: {{ include "cloudbolt-collector-helm.serviceAccountName" . }}
83+
namespace: {{ include "cloudbolt-collector-helm.namespace" . }}
84+
85+
---
86+
apiVersion: rbac.authorization.k8s.io/v1
87+
kind: ClusterRoleBinding
88+
metadata:
89+
name: {{ include "cloudbolt-collector-helm.fullname" . }}-nodes-access
90+
labels:
91+
{{- include "cloudbolt-collector-helm.labels" . | nindent 4 }}
92+
{{- with .Values.serviceAccount.annotations }}
93+
annotations:
94+
{{- toYaml . | nindent 4 }}
95+
{{- end }}
96+
roleRef:
97+
apiGroup: rbac.authorization.k8s.io
98+
kind: ClusterRole
99+
name: {{ include "cloudbolt-collector-helm.fullname" . }}-nodes-access
100+
subjects:
101+
- kind: ServiceAccount
102+
name: {{ include "cloudbolt-collector-helm.serviceAccountName" . }}
103+
namespace: {{ include "cloudbolt-collector-helm.namespace" . }}

templates/deployment.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ spec:
5151
secretKeyRef:
5252
name: cb-ingestion-token
5353
key: INGESTION_API_TOKEN
54+
{{- with .Values.PROMETHEUS_BASE_URL }}
55+
- name: PROMETHEUS_BASE_URL
56+
value: "{{ . }}"
57+
{{- end }}
58+
{{- with .Values.COREAPI_BASE_URL }}
59+
- name: COREAPI_BASE_URL
60+
value: "{{ . }}"
61+
{{- end }}
5462
livenessProbe:
5563
httpGet:
5664
path: {{ .Values.liveness.httpGet_path }}

values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ replicaCount: 1
55
DEBUG: ""
66
IMAGE_VERSION: ""
77
INGESTION_API_URL: ""
8+
9+
# Optional: Base URL for Prometheus and CoreAPI (e.g. "http://prometheus.monitoring.svc.cluster.local:9090")
10+
PROMETHEUS_BASE_URL: ""
11+
COREAPI_BASE_URL: ""
12+
13+
clusterRole:
14+
# Set to true to create a ClusterRoles for the collector
15+
create: false
816
image:
917
repository: cloudboltsoftware/cloudbolt-collector
1018
pullPolicy: Always
@@ -29,6 +37,7 @@ securityContext:
2937
capabilities:
3038
drop: ["ALL"]
3139
runAsNonRoot: true
40+
runAsUser:
3241
seccompProfile:
3342
type: "RuntimeDefault"
3443
service:

0 commit comments

Comments
 (0)