Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
rc4
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegoodier committed Nov 3, 2022
1 parent 4c4e8a3 commit ab56b31
Show file tree
Hide file tree
Showing 19 changed files with 194 additions and 317 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ Update CLUSTER_NAME and other configuration in [values-openshift.yaml](values-op
Then install against the local cost-analyzer repo using following helm install command:

```bash
helm upgrade --install kubecost --repo https://raw.githubusercontent.com/kubecost/openshift-helm-chart/main cost-analyzer --namespace kubecost --create-namespace -f https://raw.githubusercontent.com/kubecost/openshift-helm-chart/main/values-openshift.yaml
helm upgrade --install kubecost \
--repo https://raw.githubusercontent.com/kubecost/openshift-helm-chart/1.98.0-rc.4/ cost-analyzer \
--namespace kubecost --create-namespace \
-f https://raw.githubusercontent.com/kubecost/openshift-helm-chart/1.98.0-rc.4/cost-analyzer/values-thanos.yaml
-f https://raw.githubusercontent.com/kubecost/openshift-helm-chart/1.98.0-rc.4/cost-analyzer/disable-psps.yaml
```

Wait for all pods to be ready.
Expand All @@ -55,9 +59,9 @@ Kubecost will be collecting data, please wait 5-15 minutes before the UI to refl
#### Prerequisites:

- You have created a Grafana Cloud account & You have permissions to create Grafana Cloud API keys
- Add required service account for grafana-agent to `hostmount-anyuid` SCC:
- Add required service account for grafana-agent to `hostmount-65532` SCC:

`oc adm policy add-scc-to-user hostmount-anyuid system:serviceaccount:kubecost:grafana-agent`
`oc adm policy add-scc-to-user hostmount-65532 system:serviceaccount:kubecost:grafana-agent`

#### Installation:

Expand Down
Binary file removed archive/cost-analyzer-ocp-1.92.0.tgz
Binary file not shown.
Binary file removed archive/cost-analyzer-ocp-1.95.0.tgz
Binary file not shown.
Binary file removed archive/cost-analyzer-ocp-1.96.0.tgz
Binary file not shown.
Binary file modified cost-analyzer-1.98.0-rc.4.tgz
Binary file not shown.
4 changes: 1 addition & 3 deletions cost-analyzer/charts/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ image:
# pullSecrets:
# - myRegistrKeySecretName

securityContext:
runAsUser: 472
fsGroup: 472
securityContext: {}

downloadDashboardsImage:
repository: curlimages/curl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ podSecurityPolicy:
# apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'


securityContext:
enabled: true
runAsUser: 65534
fsGroup: 65534
securityContext: {}

## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,7 @@ spec:
{{ toYaml .Values.server.affinity | indent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.server.terminationGracePeriodSeconds }}
securityContext:
runAsUser: 1001020000
runAsNonRoot: true
runAsGroup: 1001020000
fsGroup: 1001020000
securityContext: {}
volumes:
{{- if .Values.selfsignedCertConfigMapName }}
- name: {{ .Values.selfsignedCertConfigMapName }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ metadata:
labels:
{{- include "prometheus.server.labels" . | nindent 4 }}
name: {{ template "prometheus.serviceAccountName.server" . }}
{{- if .Values.serviceAccount.annotations }}
annotations:
{{ toYaml .Values.serviceAccount.annotations | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
{{ end }}
18 changes: 3 additions & 15 deletions cost-analyzer/charts/prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,7 @@ alertmanager:

## Security context to be added to alertmanager pods
##
securityContext:
runAsUser: 65534
runAsNonRoot: true
runAsGroup: 65534
fsGroup: 65534
securityContext: {}

service:
annotations: {}
Expand Down Expand Up @@ -858,11 +854,7 @@ server:

## Security context to be added to server pods
##
securityContext:
runAsUser: 65534
runAsNonRoot: true
runAsGroup: 65534
fsGroup: 65534
securityContext: {}

service:
annotations: {}
Expand Down Expand Up @@ -1018,11 +1010,7 @@ pushgateway:

## Security context to be added to push-gateway pods
##
securityContext:
runAsUser: 65534
runAsNonRoot: true
runAsGroup: 65534
fsGroup: 65534
securityContext: {}

service:
annotations:
Expand Down
30 changes: 5 additions & 25 deletions cost-analyzer/charts/thanos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@ store:
# hosts:
# - chart-example.local
# Optional securityContext
securityContext:
runAsUser: 1001020000
runAsNonRoot: true
runAsGroup: 1001020000
fsGroup: 1001020000
securityContext: {}

resources: {}
# limits:
Expand Down Expand Up @@ -295,11 +291,7 @@ queryFrontend:
labels: {}

# Optional securityContext
securityContext:
runAsUser: 1001020000
runAsNonRoot: true
runAsGroup: 1001020000
fsGroup: 1001020000
securityContext: {}

resources: {}
# limits:
Expand Down Expand Up @@ -462,11 +454,7 @@ query:
labels: {}

# Optional securityContext
securityContext:
runAsUser: 1001020000
runAsNonRoot: true
runAsGroup: 1001020000
fsGroup: 1001020000
securityContext: {}

resources: {}
# limits:
Expand Down Expand Up @@ -593,11 +581,7 @@ compact:
serviceAccount: ""

# Optional securityContext
securityContext:
runAsUser: 1001020000
runAsNonRoot: true
runAsGroup: 1001020000
fsGroup: 1001020000
securityContext: {}

resources: {}
# limits:
Expand Down Expand Up @@ -700,11 +684,7 @@ bucket:
# maxUnavailable: 50%

# Optional securityContext
securityContext:
runAsUser: 1001020000
runAsNonRoot: true
runAsGroup: 1001020000
fsGroup: 1001020000
securityContext: {}

resources: {}
# limits:
Expand Down
18 changes: 18 additions & 0 deletions cost-analyzer/disable-psps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Kubecost PSP
podSecurityPolicy:
enabled: false

# Network Costs PSP
networkCosts:
podSecurityPolicy:
enabled: false

# Prometheus PSP
prometheus:
podSecurityPolicy:
enabled: false

# Grafana PSP
grafana:
rbac:
pspEnabled: false
12 changes: 2 additions & 10 deletions cost-analyzer/templates/cost-analyzer-deployment-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ spec:
{{- end }}
{{- end }}
spec:
securityContext:
runAsUser: 1001020000
runAsNonRoot: true
runAsGroup: 1001020000
fsGroup: 1001020000
securityContext: {}
restartPolicy: Always
serviceAccountName: {{ template "cost-analyzer.serviceAccountName" . }}
volumes:
Expand Down Expand Up @@ -257,11 +253,7 @@ spec:
- name: persistent-db
mountPath: /var/db
{{- end }}
securityContext:
runAsUser: 1001020000
runAsNonRoot: true
runAsGroup: 1001020000
fsGroup: 1001020000
securityContext: {}
{{ end }}
containers:
{{- if .Values.global.amp.enabled }}
Expand Down
8 changes: 2 additions & 6 deletions cost-analyzer/values-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ prometheus:
storage.tsdb.min-block-duration: 2h
storage.tsdb.max-block-duration: 2h
storage.tsdb.retention: 10h
securityContext:
runAsNonRoot: true
runAsUser: 1001
securityContext: {}
extraSecretMounts:
- name: object-store-volume
mountPath: /etc/thanos/config
Expand All @@ -51,9 +49,7 @@ prometheus:
sidecarContainers:
- name: thanos-sidecar
image: thanosio/thanos:v0.22.0
securityContext:
runAsNonRoot: true
runAsUser: 1001
securityContext: {}
args:
- sidecar
- --log.level=debug
Expand Down
22 changes: 9 additions & 13 deletions cost-analyzer/values-thanos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ global:
# will greatly assist in reduction memory bloat in query.
kubecostModel:
maxQueryConcurrency: 5
# This configuration is applied to thanos only. Expresses the resolution to
# This configuration is applied to thanos only. Expresses the resolution to
# use for longer query ranges. Options: raw, 5m, 1h - Default: raw
maxSourceResolution: 5m

Expand All @@ -17,11 +17,7 @@ prometheus:
storage.tsdb.min-block-duration: 2h
storage.tsdb.max-block-duration: 2h
storage.tsdb.retention: 2w
securityContext:
runAsUser: 1001020000
runAsNonRoot: true
runAsGroup: 1001020000
fsGroup: 1001020000
securityContext: {}
extraVolumes:
- name: object-store-volume
secret:
Expand Down Expand Up @@ -68,7 +64,7 @@ prometheus:
subPath: ""
- name: object-store-volume
mountPath: /etc/config

thanos:
store:
enabled: true
Expand All @@ -79,10 +75,10 @@ thanos:
value: "100"
- name: GODEBUG
value: "madvdontneed=1"
resources:
resources:
requests:
memory: "2.5Gi"
query:
query:
enabled: true
timeout: 3m
# Maximum number of queries processed concurrently by query node.
Expand All @@ -105,7 +101,7 @@ thanos:
compressResponses: true
# Downstream Tripper Configuration
downstreamTripper:
enabled: true
enabled: true
idleConnectionTimeout: 90s
responseHeaderTimeout: 2m
tlsHandshakeTimeout: 10s
Expand All @@ -114,10 +110,10 @@ thanos:
maxIdleConnectionsPerHost: 100
maxConnectionsPerHost: 0
# Response Cache Configuration
# Configure either a max size constraint or max items.
# Configure either a max size constraint or max items.
responseCache:
enabled: true
# Maximum memory size of the cache in bytes. A unit suffix (KB, MB, GB) may be applied.
# Maximum memory size of the cache in bytes. A unit suffix (KB, MB, GB) may be applied.
maxSize: 1.25GB
# Maximum number of entries in the cache.
maxSizeItems: 0
Expand All @@ -134,7 +130,7 @@ thanos:

# Thanos Sidecar Service Discovery
# Disabling removes the prometheus sidecar from querier store discovery. This ensures
# that all clusters read from the same data in remote store.
# that all clusters read from the same data in remote store.
sidecar:
enabled: true
bucket:
Expand Down
8 changes: 3 additions & 5 deletions cost-analyzer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ prometheus:
- source_labels: [__meta_kubernetes_pod_label_app]
action: keep
regex: {{ template "cost-analyzer.networkCostsName" . }}
serviceAccount:
annotations: {}
server:
# If clusterIDConfigmap is defined, instead use user-generated configmap with key CLUSTER_ID
# to use as unique cluster ID in kubecost cost-analyzer deployment.
Expand Down Expand Up @@ -733,11 +735,7 @@ grafana:
rbac:
# Manage the Grafana Pod Security Policy
pspEnabled: true
securityContext:
runAsUser: 1001020000
runAsNonRoot: true
runAsGroup: 1001020000
fsGroup: 1001020000
securityContext: {}
datasources:
datasources.yaml:
apiVersion: 1
Expand Down
Loading

0 comments on commit ab56b31

Please sign in to comment.