Skip to content

Commit

Permalink
Update Helm charts to use Atomix v1beta3 API (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuujo authored Apr 22, 2020
1 parent a302c0f commit d7e6629
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 86 deletions.
18 changes: 8 additions & 10 deletions onos-config/templates/consensus.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.store.consensus.enabled }}
{{- $name := ternary .Values.store.consensus.database (printf "%s-consensus" (include "onos-config.fullname" .)) (not (eq .Values.store.consensus.database "")) }}
apiVersion: cloud.atomix.io/v1beta2
apiVersion: cloud.atomix.io/v1beta3
kind: Database
metadata:
name: {{ $name }}
Expand All @@ -10,15 +10,12 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
clusters: {{ .Values.store.consensus.clusters }}
template:
spec:
partitions: {{ .Values.store.consensus.partitions }}
storage:
group: storage.cloud.atomix.io
version: v1beta1
kind: RaftStorageClass
name: {{ $name }}
partitions: {{ .Values.store.consensus.partitions }}
storageClass:
group: storage.cloud.atomix.io
version: v1beta1
kind: RaftStorageClass
name: {{ $name }}
---
apiVersion: storage.cloud.atomix.io/v1beta1
kind: RaftStorageClass
Expand All @@ -33,4 +30,5 @@ spec:
image: {{ .Values.store.consensus.image }}
imagePullPolicy: {{ .Values.store.consensus.imagePullPolicy }}
replicas: {{ .Values.store.consensus.replicas }}
partitionsPerCluster: {{ .Values.store.consensus.partitionsPerCluster }}
{{- end }}
8 changes: 4 additions & 4 deletions onos-config/tests/onos-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ type ONOSConfigSuite struct {
// TestInstall tests installing the onos-config chart
func (s *ONOSConfigSuite) TestInstall(t *testing.T) {
atomix := helm.Chart("kubernetes-controller", "https://charts.atomix.io").
Release("atomix-controller").
Release("onos-config-atomix").
Set("scope", "Namespace")
assert.NoError(t, atomix.Install(true))

raft := helm.Chart("raft-storage-controller", "https://charts.atomix.io").
Release("raft-storage-controller").
Release("onos-config-raft").
Set("scope", "Namespace")
assert.NoError(t, raft.Install(true))

topo := helm.Chart("onos-topo").
Release("onos-topo").
Set("store.controller", "atomix-controller:5679")
Set("store.controller", "onos-config-atomix-kubernetes-controller:5679")
assert.NoError(t, topo.Install(false))

config := helm.Chart("onos-config").
Release("onos-config").
Set("store.controller", "atomix-controller:5679")
Set("store.controller", "onos-config-atomix-kubernetes-controller:5679")
assert.NoError(t, config.Install(true))
}
2 changes: 1 addition & 1 deletion onos-config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ store:
image: atomix/raft-storage-node:v0.1.0
imagePullPolicy: IfNotPresent
partitions: 1
clusters: 1
replicas: 1
partitionsPerCluster: 1

ingress:
enabled: false
Expand Down
17 changes: 7 additions & 10 deletions onos-ric/templates/cache.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.store.cache.enabled }}
{{- $name := ternary .Values.store.cache.database (printf "%s-cache" (include "onos-ric.fullname" .)) (not (eq .Values.store.cache.database "")) }}
apiVersion: cloud.atomix.io/v1beta2
apiVersion: cloud.atomix.io/v1beta3
kind: Database
metadata:
name: {{ $name }}
Expand All @@ -10,15 +10,12 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
clusters: {{ .Values.store.cache.clusters }}
template:
spec:
partitions: {{ .Values.store.cache.partitions }}
storage:
group: storage.cloud.atomix.io
version: v1beta1
kind: CacheStorageClass
name: {{ $name }}
partitions: {{ .Values.store.cache.partitions }}
storageClass:
group: storage.cloud.atomix.io
version: v1beta1
kind: CacheStorageClass
name: {{ $name }}
---
apiVersion: storage.cloud.atomix.io/v1beta1
kind: CacheStorageClass
Expand Down
18 changes: 8 additions & 10 deletions onos-ric/templates/consensus.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.store.consensus.enabled }}
{{- $name := ternary .Values.store.consensus.database (printf "%s-consensus" (include "onos-ric.fullname" .)) (not (eq .Values.store.consensus.database "")) }}
apiVersion: cloud.atomix.io/v1beta2
apiVersion: cloud.atomix.io/v1beta3
kind: Database
metadata:
name: {{ $name }}
Expand All @@ -10,15 +10,12 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
clusters: {{ .Values.store.consensus.clusters }}
template:
spec:
partitions: {{ .Values.store.consensus.partitions }}
storage:
group: storage.cloud.atomix.io
version: v1beta1
kind: RaftStorageClass
name: {{ $name }}
partitions: {{ .Values.store.consensus.partitions }}
storageClass:
group: storage.cloud.atomix.io
version: v1beta1
kind: RaftStorageClass
name: {{ $name }}
---
apiVersion: storage.cloud.atomix.io/v1beta1
kind: RaftStorageClass
Expand All @@ -33,4 +30,5 @@ spec:
image: {{ .Values.store.consensus.image }}
imagePullPolicy: {{ .Values.store.consensus.imagePullPolicy }}
replicas: {{ .Values.store.consensus.replicas }}
partitionsPerCluster: {{ .Values.store.consensus.partitionsPerCluster }}
{{- end }}
25 changes: 0 additions & 25 deletions onos-ric/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,6 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
- name: ric-depcheck
image: {{ .Values.image.depCheck | quote }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
runAsUser: 0
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: PATH
value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
- name: COMMAND
value: "echo done"
- name: DEPENDENCY_POD_JSON
value: '[{"labels": {"name": "atomix-controller"}, "requireSameNode": false}, {"labels": {"name": "onos-topo"}, "requireSameNode": false}]'
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand Down
10 changes: 5 additions & 5 deletions onos-ric/tests/onos-ric.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ type ONOSRICSuite struct {
// TestInstall tests installing the onos-ric chart
func (s *ONOSRICSuite) TestInstall(t *testing.T) {
atomix := helm.Chart("kubernetes-controller", "https://charts.atomix.io").
Release("atomix-controller").
Release("onos-ric-atomix").
Set("scope", "Namespace")
assert.NoError(t, atomix.Install(true))

raft := helm.Chart("raft-storage-controller", "https://charts.atomix.io").
Release("raft-storage-controller").
Release("onos-ric-raft").
Set("scope", "Namespace")
assert.NoError(t, raft.Install(true))

cache := helm.Chart("cache-storage-controller", "https://charts.atomix.io").
Release("cache-storage-controller").
Release("onos-ric-cache").
Set("scope", "Namespace")
assert.NoError(t, cache.Install(true))

topo := helm.Chart("onos-topo").
Release("onos-topo").
Set("store.controller", "atomix-controller:5679")
Set("store.controller", "onos-ric-atomix-kubernetes-controller:5679")
assert.NoError(t, topo.Install(false))

ric := helm.Chart("onos-ric").
Release("onos-ric").
Set("store.controller", "atomix-controller:5679")
Set("store.controller", "onos-ric-atomix-kubernetes-controller:5679")
assert.NoError(t, ric.Install(true))
}
2 changes: 1 addition & 1 deletion onos-ric/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ store:
image: atomix/raft-storage-node:v0.1.0
imagePullPolicy: IfNotPresent
partitions: 1
clusters: 1
replicas: 1
partitionsPerCluster: 1

service:
type: ClusterIP
Expand Down
18 changes: 8 additions & 10 deletions onos-topo/templates/consensus.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.store.consensus.enabled }}
{{- $name := ternary .Values.store.consensus.database (printf "%s-consensus" (include "onos-topo.fullname" .)) (not (eq .Values.store.consensus.database "")) }}
apiVersion: cloud.atomix.io/v1beta2
apiVersion: cloud.atomix.io/v1beta3
kind: Database
metadata:
name: {{ $name }}
Expand All @@ -10,15 +10,12 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
clusters: {{ .Values.store.consensus.clusters }}
template:
spec:
partitions: {{ .Values.store.consensus.partitions }}
storage:
group: storage.cloud.atomix.io
version: v1beta1
kind: RaftStorageClass
name: {{ $name }}
partitions: {{ .Values.store.consensus.partitions }}
storageClass:
group: storage.cloud.atomix.io
version: v1beta1
kind: RaftStorageClass
name: {{ $name }}
---
apiVersion: storage.cloud.atomix.io/v1beta1
kind: RaftStorageClass
Expand All @@ -33,4 +30,5 @@ spec:
image: {{ .Values.store.consensus.image }}
imagePullPolicy: {{ .Values.store.consensus.imagePullPolicy }}
replicas: {{ .Values.store.consensus.replicas }}
partitionsPerCluster: {{ .Values.store.consensus.partitionsPerCluster }}
{{- end }}
6 changes: 3 additions & 3 deletions onos-topo/tests/onos-topo.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ type ONOSTopoSuite struct {
// TestInstall tests installing the onos-topo chart
func (s *ONOSTopoSuite) TestInstall(t *testing.T) {
atomix := helm.Chart("kubernetes-controller", "https://charts.atomix.io").
Release("atomix-controller").
Release("onos-topo-atomix").
Set("scope", "Namespace")
assert.NoError(t, atomix.Install(true))

raft := helm.Chart("raft-storage-controller", "https://charts.atomix.io").
Release("raft-storage-controller").
Release("onos-topo-raft").
Set("scope", "Namespace")
assert.NoError(t, raft.Install(true))

topo := helm.Chart("onos-topo").
Release("onos-topo").
Set("store.controller", "atomix-controller:5679")
Set("store.controller", "onos-topo-atomix-kubernetes-controller:5679")
assert.NoError(t, topo.Install(true))
}
2 changes: 1 addition & 1 deletion onos-topo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ store:
image: atomix/raft-storage-node:v0.1.0
imagePullPolicy: IfNotPresent
partitions: 1
clusters: 1
replicas: 1
partitionsPerCluster: 1

ingress:
enabled: false
Expand Down
6 changes: 3 additions & 3 deletions sd-ran/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ dependencies:
- name: kubernetes-controller
condition: import.atomix-controller.enabled
repository: https://charts.atomix.io
version: 0.3.4
version: 0.4.1
- name: raft-storage-controller
condition: import.atomix-raft-storage-controller.enabled
repository: https://charts.atomix.io
version: 0.2.3
version: 0.3.1
- name: cache-storage-controller
condition: import.atomix-cache-storage-controller.enabled
repository: https://charts.atomix.io
version: 0.2.3
version: 0.3.1
- name: onos-ric
condition: import.onos-ric.enabled
repository: file://../onos-ric
Expand Down
6 changes: 3 additions & 3 deletions sd-ran/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

import:
atomix-controller:
enabled: true
enabled: false
atomix-raft-storage-controller:
enabled: true
enabled: false
atomix-cache-storage-controller:
enabled: true
enabled: false
nem-monitoring:
enabled: true
onos-ric:
Expand Down

0 comments on commit d7e6629

Please sign in to comment.