Skip to content

Commit

Permalink
remove cniChainingMode helm parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclinder committed Oct 31, 2023
1 parent ca6f14c commit f6140ff
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 67 deletions.
4 changes: 2 additions & 2 deletions charts/cilium-chaining/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.12.7
version: 1.12.8

# 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.12.7"
appVersion: "1.12.8"
8 changes: 1 addition & 7 deletions charts/cilium-chaining/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: CILIUM_CNI_CHAINING_MODE
value: {{ .Values.cilium.cniChainingMode | quote }}
- name: IN_CLUSTER_LOADBALANCE
value: {{ .Values.cilium.enableInClusterLoadbalance | quote }}
- name: POLICY_ENFORCEMENT
Expand All @@ -77,12 +75,8 @@ spec:
value: {{ .Values.cilium.kubeProxyReplacement | quote }}
- name: ENABLE_HUBBLE
value: {{ .Values.hubble.enabled | quote }}
- name: HUBBLE_LISTEN_ADDRESS
value: {{ .Values.hubble.listenAddress | quote }}
- name: HUBBLE_METRICS_SERVER
value: {{ .Values.hubble.metricsAddress | quote }}
- name: HUBBLE_METRICS
value: {{ .Values.hubble.metricsAddress | quote }}
value: {{ .Values.hubble.metrics | quote }}
image: {{ include "cilium-chaining.image" . }}
imagePullPolicy: {{ .Values.cilium.image.pullPolicy }}
livenessProbe:
Expand Down
13 changes: 2 additions & 11 deletions charts/cilium-chaining/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ cilium:
# cilium.kubeProxyReplacement enable only selected features ("partial"), or enable all features ("strict"), or completely disable it (ignores any selected feature) ("disabled") (default "partial")
kubeProxyReplacement: partial

# cilium.cniChainingMode configures which CNI plugin Cilium is chained with
cniChainingMode: spidernet

# cilium.labels the labels of the cilium-chaining pod
labels: {}

Expand Down Expand Up @@ -71,14 +68,8 @@ hubble:
# hubble.enabled enable hubble
enabled: false

# hubble.listenAddress An additional address for Hubble server to listen to
listenAddress: ":4244"

# hubble.metricsAddress Address to serve Hubble metrics on
metricsAddress: ":9091"

# hubble.metricsList List of Hubble metrics to enable, multi metrics separated by common
metricsList: ""
# hubble.metrics List of Hubble metrics to enable, multi metrics separated by common
metrics: ""

serviceAccount:
# serviceAccount.create create serviceAccount for cilium-chaining pod
Expand Down
68 changes: 28 additions & 40 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
set -o errexit
set -o nounset

HUBBLE_METRICS_SERVER=${HUBBLE_METRICS_SERVER:-9091}
HUBBLE_LISTEN_ADDRESS=${HUBBLE_LISTEN_ADDRESS:-4244}

formatENV() {
value=$1
echo $value | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]'
Expand All @@ -28,6 +31,7 @@ copy_cni_bin() {
rm -f /opt/cni/bin/cilium-cni.old || true
mv /opt/cni/bin/cilium-cni /opt/cni/bin/cilium-cni.old || true
cp -f /usr/bin/cilium-cni /opt/cni/bin
rm -f /opt/cni/bin/cilium-cni.old || true
}

start_cilium() {
Expand All @@ -39,58 +43,43 @@ start_cilium() {
mount -o remount rw /proc/sys
}'

enable_in_cluster_loadbalance=false
policy_enforcement=default
kube_proxy_replacement=partial
enable_hubble=false

# service loadbalance
enable_in_cluster_loadbalance=$(formatENV $IN_CLUSTER_LOADBALANCE)
enable_in_cluster_loadbalance=${enable_in_cluster_loadbalance:-false}
if [ -n "$IN_CLUSTER_LOADBALANCE" ]; then
enable_in_cluster_loadbalance=$(formatENV $IN_CLUSTER_LOADBALANCE)
fi
echo "enable_in_cluster_loadbalance: $enable_in_cluster_loadbalance"

policy_enforcement=$(formatENV $POLICY_ENFORCEMENT)
if [ -z "$policy_enforcement" ] ; then
policy_enforcement=default
if [ -n "$POLICY_ENFORCEMENT" ] ; then
policy_enforcement=$(formatENV $POLICY_ENFORCEMENT)
fi
echo "policy_enforcement: $policy_enforcement"

# kube-proxy replacement
kube_proxy_replacement=$(formatENV $KUBE_PROXY_REPLACEMENT)
if [ -z "$kube_proxy_replacement" ]; then
kube_proxy_replacement=partial
if [ -n "$KUBE_PROXY_REPLACEMENT" ]; then
kube_proxy_replacement=$(formatENV $KUBE_PROXY_REPLACEMENT)
fi
echo "kube_proxy_replacement: ${kube_proxy_replacement}"

# cni-chain-mode
cni_chain_mode=$(formatENV $CILIUM_CNI_CHAINING_MODE)
if [ -z "$cni_chain_mode" ]; then
cni_chain_mode=spidernet
fi

# hubble
enable_hubble=$(formatENV $ENABLE_HUBBLE)
if [ -z "$enable_hubble" ]; then
enable_hubble=false
if [ -n "$ENABLE_HUBBLE" ]; then
enable_hubble=$(formatENV $ENABLE_HUBBLE)
fi

hubble_args=""
enable_hubble_arg=""
if [ "$enable_hubble" = "true" ]; then
printf "%s %s " "$hubble_args" " --enable-hubble=true --hubble-disable-tls=true"
enable_hubble_arg="--enable-hubble=true --hubble-disable-tls=true"
fi

hubble_listen_address=$(formatENV $HUBBLE_LISTEN_ADDRESS)
if [ -z "$hubble_listen_address" ]; then
hubble_listen_address=":4244"
hubble_metrics_arg=""
if [ -n "$HUBBLE_METRICS" ]; then
hubble_metrics=$(formatENV $HUBBLE_METRICS)
hubble_metrics_arg="--hubble-metrics=${hubble_metrics}"
fi
printf "%s %s " "$hubble_args" " --hubble-listen-address=${hubble_listen_address} "

hubble_metrics_server=$(formatENV $HUBBLE_METRICS_SERVER)
if [ -z "$hubble_metrics_server" ]; then
hubble_metrics_server=":9091"
fi
printf "%s %s " "$hubble_args" " --hubble-metrics-server=${hubble_metrics_server} "

hubble_metrics=$(formatENV $HUBBLE_METRICS)
if [ ! -z "$hubble_metrics" ] ; then
printf "%s %s \n" "$hubble_args" " --hubble-metrics=${hubble_metrics} "
fi
echo "hubble_options: $hubble_args"

# register crd
cilium preflight register-crd
Expand All @@ -116,12 +105,11 @@ start_cilium() {
--enable-policy=${policy_enforcement} \
--enable-in-cluster-loadbalance=${enable_in_cluster_loadbalance} \
--kube-proxy-replacement=${kube_proxy_replacement} \
--cni-chaining-mode=${cni_chain_mode} \
${hubble_args}

--hubble-metrics-server=${HUBBLE_METRICS_SERVER} \
--hubble-listen-address=${HUBBLE_LISTEN_ADDRESS} \
${enable_hubble_arg} ${hubble_metrics}
}

kernel_version
copy_cni_bin
start_cilium

start_cilium
8 changes: 1 addition & 7 deletions manifests/cilium-chaining.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: CILIUM_CNI_CHAINING_MODE
value: "spidernet"
- name: IN_CLUSTER_LOADBALANCE
value: "true"
- name: POLICY_ENFORCEMENT
Expand All @@ -157,12 +155,8 @@ spec:
value: "partial"
- name: ENABLE_HUBBLE
value: "false"
- name: HUBBLE_LISTEN_ADDRESS
value: ":4244"
- name: HUBBLE_METRICS_SERVER
value: ":9091"
- name: HUBBLE_METRICS
value: ":9091"
value: ""
image: ghcr.io/spidernet-io/cilium-chaining:latest
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down

0 comments on commit f6140ff

Please sign in to comment.