Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability do deploy Istio #1925

Merged
merged 12 commits into from
Jan 4, 2021
6 changes: 6 additions & 0 deletions core/src/epicli/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM python:3.7-slim

ARG HELM_VERSION=3.3.1
ARG KUBECTL_VERSION=1.18.8
ARG ISTIOCTL_VERSION=1.8.1

ARG USERNAME=vscode
ARG USER_UID=1000
Expand Down Expand Up @@ -35,6 +36,11 @@ RUN chmod +x /config-pre.sh \
&& chmod +x ./kubectl \
&& mv ./kubectl /usr/local/bin/kubectl \
&& kubectl version --client \
&& echo "Installing istioctl binary ..." \
to-bar marked this conversation as resolved.
Show resolved Hide resolved
&& curl -fsSLO https://github.com/istio/istio/releases/download/${ISTIOCTL_VERSION}/istioctl-${ISTIOCTL_VERSION}-linux-amd64.tar.gz \
&& tar -xzof istioctl-${ISTIOCTL_VERSION}-linux-amd64.tar.gz -C /usr/local/bin \
rpudlowski93 marked this conversation as resolved.
Show resolved Hide resolved
&& rm istioctl-${ISTIOCTL_VERSION}-linux-amd64.tar.gz \
&& chmod +x /usr/local/bin/istioctl \
\
&& setcap 'cap_net_bind_service=+ep' /usr/bin/ssh \
\
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---

- name: Decide if internal docker registry will be used
set_fact:
use_epiphany_image_registry: >-
{{ (not _k8s_as_cloud_service) and _use_local_image_registry }}
vars:
# Be extra paranoid
_k8s_as_cloud_service: >-
{{ k8s_as_cloud_service | bool }}
# Enable by default
_use_local_image_registry: >-
{{ (data.use_local_image_registry is undefined) or (data.use_local_image_registry | bool) }}

- name: Init istio operator
command: "istioctl operator init --hub {{ image_registry_address }}/istio --watchedNamespaces={{ data.namespaces.watched | join(',') }} --operatorNamespace={{ data.namespaces.operator }} --istioNamespace={{ data.namespaces.istio }}"
when: use_epiphany_image_registry

- name: Init istio operator
command: "istioctl operator init --watchedNamespaces={{ data.namespaces.watched | join(',') }} --operatorNamespace={{ data.namespaces.operator }} --istioNamespace={{ data.namespaces.istio }}"
when: not use_epiphany_image_registry
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

- name: Deploy Istio operator
include_tasks: deploy-istio-operator.yml

- name: Deploy Istio
include_tasks: deploy-k8s-app.yml
vars:
app_dir_name: "{{ data.name }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% for namespace in data.namespaces.watched %}
---
apiVersion: v1
kind: Namespace
metadata:
name: {{ namespace }}
{% endfor %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: {{ data.namespaces.watched[0] }}
name: {{ data.istio_spec.name }}
spec:
profile: {{ data.istio_spec.profile }}
{% if use_epiphany_image_registry %}
hub: {{ image_registry_address }}/{{ data.image_path }}
{% endif %}
values:
global:
istioNamespace: {{ data.namespaces.istio }}
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ vault:1.3.2
apacheignite/ignite:2.5.0
bitnami/pgpool:4.1.1-debian-10-r29
brainsam/pgbouncer:1.12
# istio
istio/pilot:1.8.1
istio/proxyv2:1.8.1
istio/operator:1.8.1
# TODO remove?
jboss/keycloak:4.8.3.Final
jboss/keycloak:9.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ vault:1.3.2
apacheignite/ignite:2.5.0
bitnami/pgpool:4.1.1-debian-10-r29
brainsam/pgbouncer:1.12
# istio
istio/pilot:1.8.1
istio/proxyv2:1.8.1
istio/operator:1.8.1
# TODO remove?
jboss/keycloak:4.8.3.Final
jboss/keycloak:9.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ vault:1.3.2
apacheignite/ignite:2.5.0
bitnami/pgpool:4.1.1-debian-10-r29
brainsam/pgbouncer:1.12
# istio
istio/pilot:1.8.1
istio/proxyv2:1.8.1
istio/operator:1.8.1
# TODO remove?
jboss/keycloak:4.8.3.Final
jboss/keycloak:9.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,18 @@ specification:
DEFAULT_POOL_SIZE: 25
RESERVE_POOL_SIZE: 25
POOL_MODE: transaction

## --- istio ---

- name: istio
enabled: yes
rpudlowski93 marked this conversation as resolved.
Show resolved Hide resolved
namespaces:
operator: istio-operator # namespace where operator will be deployed
watched: # namespaces which operator will watch
- istio-operator-resource1
- istio-operator-resource2
istio: istio-system # namespace where istio control plane will be deployed
use_local_image_registry: true
istio_spec:
profile: default # Check all possibilites https://istio.io/latest/docs/setup/additional-setup/config-profiles/
name: istiocontrolplane