Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

appliance: deploy cadvisor#62942

Merged
craigfurman merged 1 commit into
mainfrom
craig/rel-54-service-definition-cadvisor
May 29, 2024
Merged

appliance: deploy cadvisor#62942
craigfurman merged 1 commit into
mainfrom
craig/rel-54-service-definition-cadvisor

Conversation

@craigfurman

@craigfurman craigfurman commented May 28, 2024

Copy link
Copy Markdown
Contributor

Closes https://linear.app/sourcegraph/issue/REL-54/service-definition-cadvisor.

There are a few intentional differences from our Helm chart:

  • The cadvisor privileged option is removed. Cadvisor runs with a privileged containerSecurityContext by default, but the component is made opt-in (disabled by default).
  • The PodSecurityPolicy is removed entirely, since it was removed from recent versions of Kubernetes.

Test plan

Golden tests included.

@cla-bot cla-bot Bot added the cla-signed label May 28, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Annotated diff of:

❯ go run ./internal/appliance/dev/compare-helm \
  -deploy-sourcegraph-helm-path ../../deploy-sourcegraph-helm \
  -component cadvisor \
  -golden-file internal/appliance/reconciler/testdata/golden-fixtures/cadvisor/default.yaml
2c2
< # helm: ServiceAccount/cadvisor
---
> # golden: ServiceAccount/cadvisor
5a6,8
>   annotations:
>     appliance.sourcegraph.com/configHash: 6ad4c69be1e1c5d02dbd71d1f427fc7d197bf3d18c4acb8d53092dc659455920
>   creationTimestamp: "2024-04-19T00:00:00Z"
7,9d9
<     app: cadvisor
<     app.kubernetes.io/component: cadvisor
<     category: rbac
11a12,21
>   namespace: NORMALIZED_FOR_TESTING
>   ownerReferences:
>     - apiVersion: v1
>       blockOwnerDeletion: true
>       controller: true
>       kind: ConfigMap
>       name: sg
>       uid: NORMALIZED_FOR_TESTING
>   resourceVersion: NORMALIZED_FOR_TESTING
>   uid: NORMALIZED_FOR_TESTING
13c23
< # helm: DaemonSet/cadvisor
---
> # golden: DaemonSet/cadvisor
18,19c28,31
<     description: DaemonSet to ensure all nodes run a cAdvisor pod.
<     seccomp.security.alpha.kubernetes.io/pod: docker/default
---
>     appliance.sourcegraph.com/configHash: 6ad4c69be1e1c5d02dbd71d1f427fc7d197bf3d18c4acb8d53092dc659455920
>     deprecated.daemonset.template.generation: "1"
>   creationTimestamp: "2024-04-19T00:00:00Z"
>   generation: 1
22,23d33
<     app.kubernetes.io/instance: release-name
<     app.kubernetes.io/managed-by: Helm
25c35
<     app.kubernetes.io/version: 5.3.2
---
>     app.kubernetes.io/version: 5.3.9104
27d36
<     helm.sh/chart: sourcegraph-5.3.2
28a38,47
>   namespace: NORMALIZED_FOR_TESTING
>   ownerReferences:
>     - apiVersion: v1
>       blockOwnerDeletion: true
>       controller: true
>       kind: ConfigMap
>       name: sg
>       uid: NORMALIZED_FOR_TESTING
>   resourceVersion: NORMALIZED_FOR_TESTING
>   uid: NORMALIZED_FOR_TESTING
29a49,50
>   minReadySeconds: 10
>   revisionHistoryLimit: 10
33,34d53
<       app.kubernetes.io/instance: release-name
<       app.kubernetes.io/name: sourcegraph
38,39d56
<         description: Collects and exports container metrics.
<         kubectl.kubernetes.io/default-container: cadvisor
41a59
>       creationTimestamp: null
44,45d61
<         app.kubernetes.io/instance: release-name
<         app.kubernetes.io/name: sourcegraph
46a63
>       name: cadvisor
48d64
<       affinity: null
54d69
<           env: null
70a86,87
>           terminationMessagePath: /dev/termination-log
>           terminationMessagePolicy: FallbackToLogsOnError
90,91c107,111
<       nodeSelector: null
<       securityContext: null
---
>       dnsPolicy: ClusterFirst
>       restartPolicy: Always
>       schedulerName: default-scheduler
>       securityContext: {}
>       serviceAccount: cadvisor
94d113
<       tolerations: null
97a117
>             type: ""
100a121
>             type: ""
103a125
>             type: ""
106a129
>             type: ""
109a133
>             type: ""
112a137
>             type: ""
113a139,222
>   updateStrategy:
>     rollingUpdate:
>       maxSurge: 0
>       maxUnavailable: 1
>     type: RollingUpdate
> status:
>   currentNumberScheduled: 0
>   desiredNumberScheduled: 0
>   numberMisscheduled: 0
>   numberReady: 0
> ---
> # golden: ConfigMap/sg
> apiVersion: v1
> data:
>   spec: |
>     spec:
>       requestedVersion: "5.3.9104"
>
>       blobstore:
>         disabled: true
>
>       codeInsights:
>         disabled: true
>
>       codeIntel:
>         disabled: true
>
>       frontend:
>         disabled: true
>
>       gitServer:
>         disabled: true
>
>       indexedSearch:
>         disabled: true
>
>       indexedSearchIndexer:
>         disabled: true
>
>       pgsql:
>         disabled: true
>
>       postgresExporter:
>         disabled: true
>
>       preciseCodeIntel:
>         disabled: true
>
>       redisCache:
>         disabled: true
>
>       redisStore:
>         disabled: true
>
>       repoUpdater:
>         disabled: true
>
>       searcher:
>         disabled: true
>
>       symbols:
>         disabled: true
>
>       syntectServer:
>         disabled: true
>
>       worker:
>         disabled: true
>
>       prometheus:
>         disabled: true
>
>       cadvisor:
>         disabled: false
> kind: ConfigMap
> metadata:
>   annotations:
>     appliance.sourcegraph.com/currentVersion: 5.3.9104
>     appliance.sourcegraph.com/managed: "true"
>   creationTimestamp: "2024-04-19T00:00:00Z"
>   name: sg
>   namespace: NORMALIZED_FOR_TESTING
>   resourceVersion: NORMALIZED_FOR_TESTING
>   uid: NORMALIZED_FOR_TESTING

Nothing stands out.

@craigfurman craigfurman requested review from a team and Chickensoupwithrice and removed request for a team May 28, 2024 12:50
Base automatically changed from appliance-refactor-storage to main May 28, 2024 14:57
There are a few intentional differences from our Helm chart:

* The cadvisor privileged option is removed. Cadvisor runs with a
  privileged containerSecurityContext by default, but the component is
  made opt-in (disabled by default).
* The PodSecurityPolicy is removed entirely, since it was removed from
  recent versions of Kubernetes.
@craigfurman craigfurman force-pushed the craig/rel-54-service-definition-cadvisor branch from 7f7a406 to c76fcec Compare May 28, 2024 14:57
@craigfurman craigfurman marked this pull request as ready for review May 28, 2024 14:58
@craigfurman craigfurman merged commit 22832dc into main May 29, 2024
@craigfurman craigfurman deleted the craig/rel-54-service-definition-cadvisor branch May 29, 2024 09:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants