Skip to content

Commit

Permalink
install odigos in openshift
Browse files Browse the repository at this point in the history
  • Loading branch information
esara committed May 27, 2024
1 parent 6c49ac4 commit 4de4a78
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 19 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ helm upgrade --install odigos odigos/odigos --namespace odigos-system --create-n
kubectl label namespace odigos-system odigos.io/system-object="true"
```

### Upgrade Existing Odigos Installation
### Install Odigos Odigos in Openshift

```console
helm repo update
helm upgrade odigos odigos/odigos --namespace odigos-system
helm upgrade --install odigos odigos/odigos --namespace odigos-system --create-namespace --set openshift.enabled=true
kubectl label namespace odigos-system odigos.io/system-object="true"
```

### Uninstall Odigos
Expand Down
30 changes: 13 additions & 17 deletions charts/odigos/templates/autoscaler/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,29 @@ metadata:
name: odigos-autoscaler
rules:
- apiGroups:
- odigos.io
- ""
resources:
- instrumentedapplications
- configmaps
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- odigos.io
resources:
- instrumentedapplications/finalizers
verbs:
- update
- apiGroups:
- odigos.io
- apps
resources:
- instrumentedapplications/status
- daemonsets
- deployments
verbs:
- get
- patch
- update
- list
- watch
- apiGroups:
- odigos.io
resources:
- instrumentedapplications
- collectorsgroups
- odigosconfigurations
- destinations
- processors
verbs:
Expand All @@ -47,13 +41,15 @@ rules:
- odigos.io
resources:
- collectorsgroups/finalizers
- instrumentedapplications/finalizers
- destinations/finalizers
verbs:
- update
- apiGroups:
- odigos.io
resources:
- collectorsgroups/status
- instrumentedapplications/status
- destinations/status
verbs:
- get
Expand Down Expand Up @@ -104,4 +100,4 @@ rules:
verbs:
- get
- list
- watch
- watch
2 changes: 2 additions & 0 deletions charts/odigos/templates/crds/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ spec:
type: object
telemetryEnabled:
type: boolean
openshiftEnabled:
type: boolean
required:
- configVersion
- odigosVersion
Expand Down
8 changes: 8 additions & 0 deletions charts/odigos/templates/odiglet/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ rules:
- get
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets/finalizers
- deployments/finalizers
- statefulsets/finalizers
verbs:
- update
- apiGroups:
- apps
resources:
Expand Down
15 changes: 15 additions & 0 deletions charts/odigos/templates/odiglet/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,18 @@ roleRef:
kind: ClusterRole
name: odiglet
apiGroup: rbac.authorization.k8s.io
---
{{ if .Values.openshift.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: system:openshift:scc:anyuid:{{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:openshift:scc:anyuid
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:serviceaccounts:{{ .Release.Namespace }}
{{- end }}
16 changes: 16 additions & 0 deletions charts/odigos/templates/odiglet/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ spec:
- name: run-dir
mountPath: /run
mountPropagation: Bidirectional
{{ if .Values.openshift.enabled }}
- name: host
mountPath: /host
readOnly: true
- name: selinux
mountPath: /host/etc/selinux
mountPropagation: Bidirectional
{{ end }}
- name: var-dir
mountPath: /var
mountPropagation: Bidirectional
Expand All @@ -78,6 +86,14 @@ spec:
- name: run-dir
hostPath:
path: /run
{{ if .Values.openshift.enabled }}
- name: host
hostPath:
path: /
- name: selinux
hostPath:
path: /etc/selinux
{{- end }}
- name: var-dir
hostPath:
path: /var
Expand Down
18 changes: 18 additions & 0 deletions charts/odigos/templates/odiglet/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ if .Values.openshift.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: system:openshift:scc:privileged
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:openshift:scc:privileged
subjects:
- kind: ServiceAccount
name: odiglet
namespace: {{ .Release.Namespace }}
- kind: ServiceAccount
name: odigos-data-collection
namespace: {{ .Release.Namespace }}
{{- end }}
1 change: 1 addition & 0 deletions charts/odigos/templates/odigos-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ spec:
instrumentorImage: {{ .Values.instrumentor.image.repository }}
odigosVersion: {{ .Values.image.tag }}
telemetryEnabled: {{ .Values.telemetry.enabled }}
openshiftEnabled: {{ .Values.openshift.enabled }}
psp: {{ .Values.psp.enabled }}
ignoredNamespaces:
{{- toYaml .Values.ignoredNamespaces | nindent 8 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/odigos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ psp:

telemetry:
enabled: true

openshift:
enabled: false

0 comments on commit 4de4a78

Please sign in to comment.