forked from kubernetes-sigs/kubespray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new addon Istio (kubernetes-sigs#1744)
* add istio addon * add addons to a ci job
- Loading branch information
Showing
12 changed files
with
1,495 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
istio_enabled: false | ||
|
||
istio_namespace: istio-system | ||
istio_version: "0.2.6" | ||
|
||
istioctl_download_url: "https://storage.googleapis.com/istio-release/releases/{{ istio_version }}/istioctl/istioctl-linux" | ||
istioctl_checksum: fd703063c540b8c0ab943f478c05ab257d88ae27224c746a27d0526ddbf7c370 | ||
|
||
istio_proxy_image_repo: docker.io/istio/proxy | ||
istio_proxy_image_tag: "{{ istio_version }}" | ||
|
||
istio_proxy_init_image_repo: docker.io/istio/proxy_init | ||
istio_proxy_init_image_tag: "{{ istio_version }}" | ||
|
||
istio_ca_image_repo: docker.io/istio/istio-ca | ||
istio_ca_image_tag: "{{ istio_version }}" | ||
|
||
istio_mixer_image_repo: docker.io/istio/mixer | ||
istio_mixer_image_tag: "{{ istio_version }}" | ||
|
||
istio_pilot_image_repo: docker.io/istio/pilot | ||
istio_pilot_image_tag: "{{ istio_version }}" | ||
|
||
istio_proxy_debug_image_repo: docker.io/istio/proxy_debug | ||
istio_proxy_debug_image_tag: "{{ istio_version }}" | ||
|
||
istio_sidecar_initializer_image_repo: docker.io/istio/sidecar_initializer | ||
istio_sidecar_initializer_image_tag: "{{ istio_version }}" | ||
|
||
istio_statsd_image_repo: prom/statsd-exporter | ||
istio_statsd_image_tag: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
dependencies: | ||
- role: download | ||
file: "{{ downloads.istioctl }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
- name: istio | Create addon dir | ||
file: | ||
path: "{{ kube_config_dir }}/addons/istio" | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
recurse: yes | ||
|
||
- name: istio | Lay out manifests | ||
template: | ||
src: "{{item.file}}.j2" | ||
dest: "{{kube_config_dir}}/addons/istio/{{item.file}}" | ||
with_items: | ||
- {name: istio-mixer, file: istio.yml, type: deployment } | ||
- {name: istio-initializer, file: istio-initializer.yml, type: deployment } | ||
register: manifests | ||
when: inventory_hostname == groups['kube-master'][0] | ||
|
||
- name: istio | Copy istioctl binary from download dir | ||
command: rsync -piu "{{ local_release_dir }}/istio/istioctl" "{{ bin_dir }}/istioctl" | ||
changed_when: false | ||
|
||
- name: istio | Set up bash completion | ||
shell: "{{ bin_dir }}/istioctl completion >/etc/bash_completion.d/istioctl.sh" | ||
when: ansible_os_family in ["Debian","RedHat"] | ||
|
||
- name: istio | Set bash completion file | ||
file: | ||
path: /etc/bash_completion.d/istioctl.sh | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
when: ansible_os_family in ["Debian","RedHat"] | ||
|
||
- name: istio | apply manifests | ||
kube: | ||
name: "{{item.item.name}}" | ||
namespace: "{{ istio_namespace }}" | ||
kubectl: "{{bin_dir}}/kubectl" | ||
resource: "{{item.item.type}}" | ||
filename: "{{kube_config_dir}}/addons/istio/{{item.item.file}}" | ||
state: "latest" | ||
with_items: "{{ manifests.results }}" | ||
when: inventory_hostname == groups['kube-master'][0] |
84 changes: 84 additions & 0 deletions
84
roles/kubernetes-apps/istio/templates/istio-initializer.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# GENERATED FILE. Use with Kubernetes 1.7+ | ||
# TO UPDATE, modify files in install/kubernetes/templates and run install/updateVersion.sh | ||
################################ | ||
# Istio initializer | ||
################################ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: istio-inject | ||
namespace: {{ istio_namespace }} | ||
data: | ||
config: |- | ||
policy: "enabled" | ||
namespaces: [""] # everything, aka v1.NamepsaceAll, aka cluster-wide | ||
initializerName: "sidecar.initializer.istio.io" | ||
params: | ||
initImage: {{ istio_proxy_init_image_repo }}:{{ istio_proxy_init_image_tag }} | ||
proxyImage: {{ istio_proxy_image_repo }}:{{ istio_proxy_image_tag }} | ||
verbosity: 2 | ||
version: 0.2.6 | ||
meshConfigMapName: istio | ||
imagePullPolicy: IfNotPresent | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: istio-initializer-service-account | ||
namespace: {{ istio_namespace }} | ||
--- | ||
apiVersion: apps/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: istio-initializer | ||
namespace: {{ istio_namespace }} | ||
annotations: | ||
sidecar.istio.io/inject: "false" | ||
initializers: | ||
pending: [] | ||
labels: | ||
istio: istio-initializer | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
name: istio-initializer | ||
labels: | ||
istio: initializer | ||
annotations: | ||
sidecar.istio.io/inject: "false" | ||
spec: | ||
serviceAccountName: istio-initializer-service-account | ||
containers: | ||
- name: initializer | ||
image: {{ istio_sidecar_initializer_image_repo }}:{{ istio_sidecar_initializer_image_tag }} | ||
imagePullPolicy: IfNotPresent | ||
args: | ||
- --port=8083 | ||
- --namespace={{ istio_namespace }} | ||
- -v=2 | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/istio/config | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: istio | ||
--- | ||
apiVersion: admissionregistration.k8s.io/v1alpha1 | ||
kind: InitializerConfiguration | ||
metadata: | ||
name: istio-sidecar | ||
initializers: | ||
- name: sidecar.initializer.istio.io | ||
rules: | ||
- apiGroups: | ||
- "*" | ||
apiVersions: | ||
- "*" | ||
resources: | ||
- deployments | ||
- statefulsets | ||
- jobs | ||
- daemonsets | ||
--- |
Oops, something went wrong.