Skip to content

Commit

Permalink
feat: migrate helm charts repo from odigos-charts to here (#1429)
Browse files Browse the repository at this point in the history
After merging this we will be managing helm charts in this repo fully.
The old index will then stay up and working but will be stale.

This has a benefit of being able to update helm and code in the same PR,
simplifying the whole release process and having e2e tests run on the
latest unreleased helm version.

This PR will also change the chart versioning(currently `0.3.x`) to
match the application version(currently `1.0.x`) on every release.

This includes
[2bd8d7b](odigos-io/odigos-charts@2bd8d7b)
of odigos-charts which is the last commit at the moment of creation of
this PR.

Commits:

- **feat: migrate helm chart over as is**
- **feat: default image tags to Chart.AppVersion**
- **feat: point references to external chart repository to this repo**

---------

Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
  • Loading branch information
rauno56 and blumamir authored Aug 8, 2024
1 parent eb63dff commit 6d35b17
Show file tree
Hide file tree
Showing 63 changed files with 3,470 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}

# TODO: Remove once we are ready to fully sunset managing charts in a separate repo
- name: Trigger Release PR in Odigos Charts
run: |
curl -X POST \
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/odigos_install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ odigos install [flags]
-n, --namespace target k8s namespace for Odigos installation
--nowait skip waiting for odigos pods to be ready
--telemetry send general telemetry regarding Odigos usage (default true)
--openshift configure selinux in Openshift environemnt (default false)
--openshift configure selinux in Openshift environment (default false)
--sidecar-instrumentation use sidecars for eBPF instrumentations
--odiglet-image odiglet container image name
--instrumentor-image instrumentor container image name
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ At this point, odigos is installed in your cluster. You can now add sources and
### Add Helm Repoistory

```shell
helm repo add odigos https://odigos-io.github.io/odigos-charts/
helm repo add odigos https://odigos-io.github.io/odigos/
```

### Install Odigos
Expand Down
5 changes: 3 additions & 2 deletions helm/odigos/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
apiVersion: v2
name: odigos
description: Odigos distribution for Kubernetes
description: Instant Distributed Tracing
type: application
# 0.0.0 will be replaced by the git tag version on release
version: "0.0.0"
appVersion: "0.0.0"
# docker image and git tags prefix the version with "v"
appVersion: "v0.0.0"
icon: https://d2q89wckrml3k4.cloudfront.net/logo.png
10 changes: 10 additions & 0 deletions helm/odigos/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Odigos installed successfully. For getting started go to the UI by running:

kubectl port-forward svc/ui -n {{ .Release.Namespace }} 3000:3000

or

brew install odigos-io/homebrew-odigos-cli/odigos
odigos ui

Then, go to: http://localhost:3000
111 changes: 111 additions & 0 deletions helm/odigos/templates/autoscaler/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: odigos-autoscaler
rules:
- apiGroups:
- ""
resources:
- configmaps
- services
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
verbs:
- get
- list
- watch
- apiGroups:
- odigos.io
resources:
- instrumentedapplications
- collectorsgroups
- odigosconfigurations
- destinations
- processors
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- odigos.io
resources:
- collectorsgroups/finalizers
- instrumentedapplications/finalizers
- destinations/finalizers
verbs:
- update
- apiGroups:
- odigos.io
resources:
- collectorsgroups/status
- instrumentedapplications/status
- destinations/status
verbs:
- get
- patch
- update
- apiGroups:
- actions.odigos.io
resources:
- addclusterinfos
- deleteattributes
- renameattributes
- probabilisticsamplers
- latencysamplers
- errorsamplers
- piimaskings
verbs:
- watch
- get
- list
- apiGroups:
- actions.odigos.io
resources:
- addclusterinfos/status
- deleteattributes/status
- renameattributes/status
- probabilisticsamplers/status
- latencysamplers/status
- errorsamplers/status
- piimaskings/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
- configmaps
- services
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
verbs:
- get
- list
- watch
- apiGroups:
- odigos.io
resources:
- odigosconfigurations
verbs:
- get
- list
- watch
12 changes: 12 additions & 0 deletions helm/odigos/templates/autoscaler/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: odigos-autoscaler
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: odigos-autoscaler
subjects:
- kind: ServiceAccount
name: odigos-autoscaler
namespace: {{ .Release.Namespace }}
82 changes: 82 additions & 0 deletions helm/odigos/templates/autoscaler/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: odigos-autoscaler
name: odigos-autoscaler
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: odigos-autoscaler
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
app.kubernetes.io/name: odigos-autoscaler
spec:
containers:
- args:
- --health-probe-bind-address=:8081
- --metrics-bind-address=127.0.0.1:8080
- --leader-elect
{{ if .Values.imagePrefix }}
- --image-prefix={{ .Values.imagePrefix }}
{{ end }}
command:
- /app
{{- if .Values.imagePrefix }}
image: "{{ .Values.imagePrefix }}/{{ .Values.autoscaler.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- else }}
image: "{{ .Values.autoscaler.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- end }}
env:
- name: OTEL_SERVICE_NAME
value: auto-scaler
- name: CURRENT_NS
valueFrom:
fieldRef:
fieldPath: metadata.namespace
envFrom:
- configMapRef:
name: odigos-own-telemetry-otel-config
optional: true
- configMapRef:
name: odigos-deployment
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
name: manager
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 10m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
securityContext:
runAsNonRoot: true
serviceAccountName: odigos-autoscaler
terminationGracePeriodSeconds: 10
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 6 }}
{{- end }}
{{- with .Values.autoscaler }}
{{- if .nodeSelector }}
nodeSelector: {{ toYaml .nodeSelector | nindent 8 }}
{{- end }}
{{- if .tolerations }}
tolerations: {{ toYaml .tolerations | nindent 8 }}
{{- end }}
{{- if .affinity }}
affinity: {{ toYaml .affinity | nindent 8 }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions helm/odigos/templates/autoscaler/leader-election-rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: odigos-autoscaler-leader-election
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: odigos-leader-election-role
subjects:
- kind: ServiceAccount
name: odigos-autoscaler
58 changes: 58 additions & 0 deletions helm/odigos/templates/autoscaler/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: odigos-autoscaler
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- ""
resources:
- configmaps
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- daemonsets/status
- deployments/status
verbs:
- get
- patch
- update
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- create
- patch
- update
- delete
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
12 changes: 12 additions & 0 deletions helm/odigos/templates/autoscaler/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: odigos-autoscaler
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: odigos-autoscaler
subjects:
- kind: ServiceAccount
name: odigos-autoscaler
5 changes: 5 additions & 0 deletions helm/odigos/templates/autoscaler/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: odigos-autoscaler
namespace: {{ .Release.Namespace }}
24 changes: 24 additions & 0 deletions helm/odigos/templates/cleanup/cleanup-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: batch/v1
kind: Job
metadata:
name: cleanup-job
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": hook-succeeded
spec:
ttlSecondsAfterFinished: 30
activeDeadlineSeconds: 240
backoffLimit: 0
template:
spec:
serviceAccountName: cleanup-sa
containers:
- name: cleanup
{{- if .Values.imagePrefix }}
image: "{{ .Values.imagePrefix }}/{{ .Values.cli.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- else }}
image: "{{ .Values.cli.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- end }}
args: ["uninstall", "--yes"]
restartPolicy: Never
20 changes: 20 additions & 0 deletions helm/odigos/templates/cleanup/cleanup-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cleanup-clusterrole
rules:
- apiGroups: ["apps"]
resources: ["deployments", "statefulsets", "daemonsets", "customresourcedefinitions"]
verbs: ["get", "list", "patch"]
- apiGroups: [""]
resources: ["namespaces", "configmaps", "services", "secrets"]
verbs: ["get", "list", "patch"]
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get", "list", "patch", "delete"]
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["clusterroles", "clusterrolebindings"]
verbs: ["get", "list", "patch"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["list"]
Loading

0 comments on commit 6d35b17

Please sign in to comment.