Skip to content

Commit

Permalink
Sync CNI charts from istio/cni 1.4 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jwendell committed Nov 2, 2019
1 parent a6e4a4b commit 519041b
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 203 deletions.
8 changes: 4 additions & 4 deletions istio-cni/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: v1
name: istio-cni
version: 0.2.0
appVersion: 0.2.0
tillerVersion: ">=2.7.2-0"
version: 1.1.0
appVersion: 1.1.0
tillerVersion: ">=2.7.2"
description: Helm chart for istio-cni components
keywords:
- istio-cni
- istio
- cni
sources:
- http://github.com/istio/cni
engine: gotpl
Expand Down
10 changes: 10 additions & 0 deletions istio-cni/templates/_labels.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- define "common_labels" }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
version: {{ .Chart.Version }}
heritage: {{ .Release.Service }}
{{- end }}

{{- define "common_template_labels" }}
version: {{ .Chart.Version }}
{{- end }}
14 changes: 0 additions & 14 deletions istio-cni/templates/clusterrole.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions istio-cni/templates/clusterrolebinding.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions istio-cni/templates/configmap-cni.yaml

This file was deleted.

81 changes: 0 additions & 81 deletions istio-cni/templates/daemonset.yaml

This file was deleted.

163 changes: 163 additions & 0 deletions istio-cni/templates/istio-cni.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Istio-CNI Version v0.1-dev
#
# This manifest installs the following component versions:
# istio-cni:v0.1


kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: istio-cni
rules:
- apiGroups: [""]
resources:
- pods
- nodes
verbs:
- get

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: istio-cni
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: istio-cni
subjects:
- kind: ServiceAccount
name: istio-cni
namespace: {{ .Release.Namespace }}

---
# This ConfigMap is used to configure a self-hosted Istio CNI installation.
kind: ConfigMap
apiVersion: v1
metadata:
name: istio-cni-config
namespace: {{ .Release.Namespace }}
labels:
{{- template "common_labels" . }}
data:
# The CNI network configuration to add to the plugin chain on each node. The special
# values in this config will be automatically populated.
cni_network_config: |-
{
"type": "istio-cni",
"log_level": {{ quote .Values.logLevel }},
"kubernetes": {
"kubeconfig": "__KUBECONFIG_FILEPATH__",
"cni_bin_dir": {{ quote .Values.cniBinDir }},
"exclude_namespaces": [ {{ range $idx, $ns := .Values.excludeNamespaces }}{{ if $idx }}, {{ end }}{{ quote $ns }}{{ end }} ]
}
}
---

# This manifest installs the Istio install-cni container, as well
# as the Istio CNI plugin and config on
# each master and worker node in a Kubernetes cluster.
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: istio-cni-node
namespace: {{ .Release.Namespace }}
labels:
k8s-app: istio-cni-node
{{- template "common_labels" . }}
spec:
selector:
matchLabels:
k8s-app: istio-cni-node
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
template:
metadata:
labels:
k8s-app: istio-cni-node
annotations:
# This, along with the CriticalAddonsOnly toleration below,
# marks the pod as a critical add-on, ensuring it gets
# priority scheduling and that its resources are reserved
# if it ever gets evicted.
scheduler.alpha.kubernetes.io/critical-pod: ''
spec:
nodeSelector:
beta.kubernetes.io/os: linux
hostNetwork: true
tolerations:
# Make sure istio-cni-node gets scheduled on all nodes.
- effect: NoSchedule
operator: Exists
# Mark the pod as a critical add-on for rescheduling.
- key: CriticalAddonsOnly
operator: Exists
- effect: NoExecute
operator: Exists
priorityClassName: system-cluster-critical
serviceAccountName: istio-cni
# Minimize downtime during a rolling upgrade or deletion; tell Kubernetes to do a "force
# deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
terminationGracePeriodSeconds: 5
containers:
# This container installs the Istio CNI binaries
# and CNI network config file on each node.
- name: install-cni
image: {{ .Values.hub }}/install-cni:{{ .Values.tag }}
imagePullPolicy: {{ .Values.pullPolicy }}
command: ["/install-cni.sh"]
env:
{{- if .Values.cniConfFileName }}
# Name of the CNI config file to create.
- name: CNI_CONF_NAME
value: "{{ .Values.cniConfFileName }}"
{{- end }}
# The CNI network config to install on each node.
- name: CNI_NETWORK_CONFIG
valueFrom:
configMapKeyRef:
name: istio-cni-config
key: cni_network_config
- name: CNI_NET_DIR
value: {{ default "/etc/cni/net.d" .Values.cniConfDir }}
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
- mountPath: /host/etc/cni/net.d
name: cni-net-dir
volumes:
# Used to install CNI.
- name: cni-bin-dir
hostPath:
path: {{ default "/opt/cni/bin" .Values.cniBinDir }}
- name: cni-net-dir
hostPath:
path: {{ default "/etc/cni/net.d" .Values.cniConfDir }}
---

apiVersion: v1
kind: ServiceAccount
metadata:
name: istio-cni
namespace: {{ .Release.Namespace }}

---
{{- if ne .Values.psp_cluster_role "" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: istio-cni-psp
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ .Values.psp_cluster_role }}
subjects:
- kind: ServiceAccount
name: istio-cni
namespace: {{ .Release.Namespace }}
{{- end }}
14 changes: 0 additions & 14 deletions istio-cni/templates/serviceaccount.yaml

This file was deleted.

Loading

0 comments on commit 519041b

Please sign in to comment.