Skip to content

Commit

Permalink
replace chart
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Feb 4, 2024
1 parent 90cbc74 commit c43e0e3
Show file tree
Hide file tree
Showing 35 changed files with 1,737 additions and 504 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release-chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release Charts

on:
push:
branches:
- master

jobs:
release:
permissions:
contents: write # to push chart release and create a release (helm/chart-releaser-action)

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: charts
packages_with_index: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion README.md

This file was deleted.

8 changes: 4 additions & 4 deletions kubeovn-charts/Chart.yaml → charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: kubeovn
description: A Helm chart for Kubernetes
name: kube-ovn
description: Helm chart for Kube-OVN

# A chart can be either an 'application' or a 'library' chart.
#
Expand All @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 1.12.4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
appVersion: "1.12.4"
20 changes: 20 additions & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Kube-OVN-helm

Currently supported version: 1.9

Installation :

```bash
$ kubectl label node -lbeta.kubernetes.io/os=linux kubernetes.io/os=linux --overwrite
$ kubectl label node -lnode-role.kubernetes.io/control-plane kube-ovn/role=master --overwrite
$ kubectl label node -lovn.kubernetes.io/ovs_dp_type!=userspace ovn.kubernetes.io/ovs_dp_type=kernel --overwrite

# standard install
$ helm install --debug kubeovn ./charts --set MASTER_NODES=${Node0},

# high availability install
$ helm install --debug kubeovn ./charts --set MASTER_NODES=${Node0},${Node1},${Node2}, --set replicaCount=3

# upgrade to this version
$ helm upgrade --debug kubeovn ./charts --set MASTER_NODES=${Node0},${Node1},${Node2}, --set replicaCount=3
```
22 changes: 22 additions & 0 deletions charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- define "kubeovn.ovs-ovn.updateStrategy" -}}
{{- $ds := lookup "apps/v1" "DaemonSet" $.Values.namespace "ovs-ovn" -}}
{{- if $ds -}}
{{- if eq $ds.spec.updateStrategy.type "RollingUpdate" -}}
RollingUpdate
{{- else -}}
{{- $imageVersion := (index $ds.spec.template.spec.containers 0).image | splitList ":" | last | trimPrefix "v" -}}
{{- $versionRegex := `^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)` -}}
{{- if regexMatch $versionRegex $imageVersion -}}
{{- if regexFind $versionRegex $imageVersion | semverCompare ">= 1.12.0" -}}
RollingUpdate
{{- else -}}
OnDelete
{{- end -}}
{{- else -}}
OnDelete
{{- end -}}
{{- end -}}
{{- else -}}
RollingUpdate
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ spec:
app: ovn-central
topologyKey: kubernetes.io/hostname
priorityClassName: system-cluster-critical
serviceAccountName: ovn
serviceAccountName: ovn-ovs
hostNetwork: true
containers:
- name: ovn-central
image: {{ .Values.global.registry.address }}/{{ .Values.global.images.kubeovn.repository }}:{{ .Values.global.images.kubeovn.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/kube-ovn/start-db.sh"]
command:
- /kube-ovn/start-db.sh
securityContext:
capabilities:
add: ["SYS_NICE"]
Expand All @@ -71,13 +72,35 @@ spec:
fieldPath: status.podIPs
- name: ENABLE_BIND_LOCAL_IP
value: "{{- .Values.func.ENABLE_BIND_LOCAL_IP }}"
- name: PROBE_INTERVAL
value: "{{ .Values.networking.PROBE_INTERVAL }}"
- name: OVN_LEADER_PROBE_INTERVAL
value: "{{ .Values.networking.OVN_LEADER_PROBE_INTERVAL }}"
- name: OVN_NORTHD_N_THREADS
value: "{{ .Values.networking.OVN_NORTHD_N_THREADS }}"
- name: ENABLE_COMPACT
value: "{{ .Values.networking.ENABLE_COMPACT }}"
{{- if include "kubeovn.ovs-ovn.updateStrategy" . | eq "OnDelete" }}
- name: OVN_VERSION_COMPATIBILITY
value: "22.03"
{{- end }}
resources:
requests:
{{- if .Release.IsUpgrade }}
cpu: {{ (index (lookup "apps/v1" "Deployment" "kube-system" "ovn-central").spec.template.spec.containers 0).resources.requests.cpu | quote }}
memory: {{ (index (lookup "apps/v1" "Deployment" "kube-system" "ovn-central").spec.template.spec.containers 0).resources.requests.memory | quote }}
{{- else }}
cpu: {{ index .Values "ovn-central" "requests" "cpu" }}
memory: {{ index .Values "ovn-central" "requests" "memory" }}
{{- end }}
limits:
{{- if .Release.IsUpgrade }}
cpu: {{ (index (lookup "apps/v1" "Deployment" "kube-system" "ovn-central").spec.template.spec.containers 0).resources.limits.cpu | quote }}
memory: {{ (index (lookup "apps/v1" "Deployment" "kube-system" "ovn-central").spec.template.spec.containers 0).resources.limits.memory | quote }}
{{- else }}
cpu: {{ index .Values "ovn-central" "limits" "cpu" }}
memory: {{ index .Values "ovn-central" "limits" "memory" }}
{{- end }}
volumeMounts:
- mountPath: /var/run/openvswitch
name: host-run-ovs
Expand All @@ -96,6 +119,7 @@ spec:
name: host-log-ovn
- mountPath: /etc/localtime
name: localtime
readOnly: true
- mountPath: /var/run/tls
name: kube-ovn-tls
readinessProbe:
Expand Down Expand Up @@ -135,10 +159,10 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: {{ .Values.log_conf.LOG_DIR }}/openvswitch
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down
Loading

0 comments on commit c43e0e3

Please sign in to comment.