Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding OpenShift SCC clusterController, removing hostPort #3677

Open
wants to merge 47 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
724d957
Bump to 2.4.0-rc.0
cliffcolvin Aug 21, 2024
c187fdf
Merge pull request #3601 from kubecost/bump-2.4.0-rc.0
cliffcolvin Aug 21, 2024
161e3bc
Merge pull request #3606 from kubecost/bump-kubecost-modeling-0.1.14
cliffcolvin Aug 23, 2024
d9308f2
Merge pull request #3608 from kubecost/cherry-pick-c9dd5f-v2.4
cliffcolvin Aug 23, 2024
3af663d
Set up InstanceAllowLists ConfigMap (#3605) (#3616)
biancaburtoiu Aug 28, 2024
1f9678e
Merge pull request #3615 from kubecost/bump-modeling-0.1.15-CVE-2024-…
cliffcolvin Aug 28, 2024
b0f8421
Merge pull request #3617 from kubecost/cherry-pick-0b62f3-v2.4
cliffcolvin Aug 28, 2024
89b1cec
Bump to 2.4.0-rc.1
cliffcolvin Aug 28, 2024
e3603ff
Merge pull request #3620 from kubecost/bump-2.4.0-rc.1
cliffcolvin Aug 28, 2024
0f88313
Merge pull request #3629 from kubecost/bump-networking-0.17.5
cliffcolvin Sep 3, 2024
a725016
Merge pull request #3630 from kubecost/cherry-pick-6c269a-v2.4
cliffcolvin Sep 3, 2024
2dd5ffc
Bump to 2.4.0-rc.2
cliffcolvin Sep 3, 2024
5889ff4
Merge pull request #3632 from kubecost/bump-2.4.0-rc.2
cliffcolvin Sep 3, 2024
2c454c1
Merge pull request #3627 from kubecost/fix-grafana-CVE
cliffcolvin Sep 4, 2024
4809710
Merge pull request #3633 from kubecost/cherry-pick-25f336-v2.4
cliffcolvin Sep 4, 2024
0f57e2d
Merge pull request #3625 from kubecost/fix-prom-CVE-2024-41110
cliffcolvin Sep 4, 2024
f959466
Merge pull request #3634 from kubecost/cherry-pick-5af713-v2.4
cliffcolvin Sep 4, 2024
cfa1f6e
Add ingestion config for standard discount (#3591) (#3636)
kaelanspatel Sep 4, 2024
8702209
fix diagnostics and federatedStorageConfig (#3637) (#3639)
gcp-cherry-pick-bot[bot] Sep 5, 2024
4690dd7
Bump to 2.4.0-rc.3
cliffcolvin Sep 5, 2024
412c20f
Merge pull request #3640 from kubecost/bump-2.4.0-rc.3
cliffcolvin Sep 5, 2024
35f6195
[ENG-2674] Add routes for savings recommendations allow list validati…
biancaburtoiu Sep 6, 2024
31ab7f6
tmp dir for new base image (#3647) (#3648)
gcp-cherry-pick-bot[bot] Sep 9, 2024
f77ce5c
[ENG-2729] Add resource reference files for kubecostProductConfigs.sa…
gcp-cherry-pick-bot[bot] Sep 10, 2024
a22da27
bump cluster-controller 0.16.9 (#3652)
cliffcolvin Sep 10, 2024
a646e09
Merge pull request #3654 from kubecost/cherry-pick-42d25f-v2.4
cliffcolvin Sep 10, 2024
4db00bb
Merge pull request #3655 from kubecost/bump-kubecost-modeling-0.1.16
cliffcolvin Sep 10, 2024
ed5b2ea
Merge pull request #3656 from kubecost/cherry-pick-3e7cd9-v2.4
cliffcolvin Sep 10, 2024
df19179
remove helm rollout restarter (#3658) (#3659)
gcp-cherry-pick-bot[bot] Sep 11, 2024
a7780ad
Enhance Pod utilization Grafana dashboard with GPU utilization widget…
gcp-cherry-pick-bot[bot] Sep 12, 2024
2832455
Merge pull request #3662 from kubecost/bump-network-costs-0.17.6
cliffcolvin Sep 12, 2024
b21e1ce
Merge pull request #3664 from kubecost/cherry-pick-7274aa-v2.4
cliffcolvin Sep 12, 2024
1886a60
Add new container costs and resources endpoints to nginx (#3642) (#3665)
gcp-cherry-pick-bot[bot] Sep 13, 2024
3957f27
Bump to 2.4.0-rc.4
cliffcolvin Sep 13, 2024
9bbbe34
Merge pull request #3666 from kubecost/bump-2.4.0-rc.4
cliffcolvin Sep 13, 2024
8c68c3b
Bump to 2.4.0-rc.5
cliffcolvin Sep 13, 2024
1c3e8fe
Merge pull request #3667 from kubecost/bump-2.4.0-rc.5
cliffcolvin Sep 13, 2024
404c42b
bump k8s-sidcar to cgr for cve
cliffcolvin Sep 13, 2024
50abead
Merge pull request #3668 from kubecost/cp-2.4-cp-k8s-sidecar
cliffcolvin Sep 13, 2024
c87dc0b
Bump to 2.4.0-rc.6
cliffcolvin Sep 13, 2024
d6437f4
Merge pull request #3669 from kubecost/bump-2.4.0-rc.6
cliffcolvin Sep 13, 2024
c9ea798
Merge pull request #3670 from kubecost/custom-service-labels (#3671)
gcp-cherry-pick-bot[bot] Sep 13, 2024
387ef4f
Bump to 2.4.0
cliffcolvin Sep 16, 2024
b98b245
Merge pull request #3675 from kubecost/bump-2.4.0
cliffcolvin Sep 16, 2024
00818bf
Adding OpenShift SCC for clusterController, removing hostPort on clus…
kc-adawson Sep 19, 2024
0cb474a
Update cost-analyzer/values.yaml
chipzoller Sep 21, 2024
80d669f
Merge branch 'develop' into openshift-scc-for-clustercontroller
chipzoller Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ jobs:
--set global.platforms.openshift.route.enabled=true \
--set global.platforms.openshift.scc.nodeExporter=true \
--set global.platforms.openshift.scc.networkCosts=true \
--set global.platforms.openshift.scc.clusterController=true \
--set networkCosts.enabled=true \
--set prometheus.nodeExporter.enabled=true
# run: ct install --namespace kubecost --chart-dirs=cost-analyzer/ --charts cost-analyzer/
Expand Down
4 changes: 2 additions & 2 deletions cost-analyzer/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
appVersion: development
appVersion: "2.4.0"
description: Kubecost Helm chart - monitor your cloud costs!
name: cost-analyzer
version: 2.3.3
version: "2.4.0"
icon: https://raw.githubusercontent.com/kubecost/.github/9602bea0c06773da66ba43cb9ce5e1eb2b797c32/kubecost_logo.png
annotations:
"artifacthub.io/links": |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ data:
"carbonEstimatesEnabled": "{{ template "carbonEstimatesEnabled" . }}",
"clusterControllerEnabled": "{{ template "clusterControllerEnabled" . }}",
"forecastingEnabled": "{{ template "forecastingEnabled" . }}",
"chartVersion": "DEVELOP_BRANCH",
"chartVersion": "2.4.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to change this now it's targeting develop.

"hourlyDataRetention": "{{ (.Values.kubecostAggregator.etlHourlyStoreDurationHours) }}",
"dailyDataRetention": "{{ (.Values.kubecostAggregator.etlDailyStoreDurationDays) }}",
"hideDiagnostics": "{{ default false ((.Values.kubecostProductConfigs).hideDiagnostics) }}",
Expand Down
33 changes: 33 additions & 0 deletions cost-analyzer/templates/kubecost-cluster-controller-ocp-scc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if and (.Capabilities.APIVersions.Has "security.openshift.io/v1/SecurityContextConstraints") (.Values.global.platforms.openshift.scc.clusterController) (.Values.clusterController.enabled) }}
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: {{ template "kubecost.clusterControllerName" . }}
priority: 10
allowPrivilegedContainer: true
allowHostDirVolumePlugin: true
allowHostNetwork: true
allowHostPorts: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this would now be false, right, if there are no hostPorts?

allowHostPID: false
allowHostIPC: false
readOnlyRootFilesystem: false
runAsUser:
type: RunAsAny
fsGroup:
type: RunAsAny
seLinuxContext:
type: RunAsAny
supplementalGroups:
type: RunAsAny
seccompProfiles:
- runtime/default
volumes:
- hostPath
- projected
- configMap
hostPorts:
Copy link
Collaborator

@jessegoodier jessegoodier Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can kill these hostPort lines if Alex is good with removing hostPort.

- min: 9731
max: 9731
users:
- system:serviceaccount:{{ .Release.Namespace }}:{{ template "kubecost.clusterControllerName" . }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ spec:
ports:
- name: http-server
containerPort: 9731
hostPort: 9731
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexkubecost I can dig here, but do you know off hand why we would need hostPort?

I don't understand why anything would be connecting to the clusterController that doesn't know the service name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't currently think of any reason why hostPort would be needed. @ameijer ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll bet you that this yaml was written from an example where they exposed an http port on a node and the ingress controller routed to that. I agree there is rarely if ever a use case for a host port on non daemon set controllers. I think getting rid of it is a great idea

serviceAccount: {{ template "kubecost.clusterControllerName" . }}
serviceAccountName: {{ template "kubecost.clusterControllerName" . }}
{{- with .Values.clusterController.tolerations }}
Expand Down
7 changes: 2 additions & 5 deletions cost-analyzer/values-openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ global:
scc:
nodeExporter: false # Creates an SCC for Prometheus Node Exporter. This requires Node Exporter be enabled.
networkCosts: false # Creates an SCC for Kubecost network-costs. This requires network-costs be enabled.
clusterController: false # Creates an SCC for Kubecost clusterContoller. This requires clusterController be enabled.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
clusterController: false # Creates an SCC for Kubecost clusterContoller. This requires clusterController be enabled.
clusterController: false # Creates an SCC for Kubecost clusterController. This requires clusterController be enabled.


# When OpenShift is enabled, the following securityContext will be applied to all resources unless they define their own.
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault

# networkCosts:
# enabled: true # Enable network costs.
# prometheus:
# nodeExporter:
# enabled: true # Enable Prometheus Node Exporter.
1 change: 1 addition & 0 deletions cost-analyzer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ global:
scc:
nodeExporter: false # Creates an SCC for Prometheus Node Exporter. This requires Node Exporter be enabled.
networkCosts: false # Creates an SCC for Kubecost network-costs. This requires network-costs be enabled.
clusterController: false # Creates an SCC for Kubecost clusterContoller. This requires clusterController be enabled.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
clusterController: false # Creates an SCC for Kubecost clusterContoller. This requires clusterController be enabled.
clusterController: false # Creates an SCC for Kubecost clusterController. This requires clusterController be enabled.

# When OpenShift is enabled, the following securityContext will be applied to all resources unless they define their own.
securityContext:
runAsNonRoot: true
Expand Down