Skip to content

Commit 368b682

Browse files
authored
Merge pull request #65 from stefanprodan/helm-migration
Migrate Istio control plane to Flux managed Helm releases
2 parents 992d192 + 6cc5620 commit 368b682

30 files changed

+304
-1001
lines changed

.github/actions/helm/action.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/analyze-istio.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/analyze.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: analyze
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
istio:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
- name: Get Istio current version
20+
id: get-istio-version
21+
run: |
22+
ISTIO_VERSION=$(yq eval '.data.version' ./clusters/my-cluster/istio-version.yaml)
23+
echo "ISTIO_VERSION=$ISTIO_VERSION" >> $GITHUB_ENV
24+
- name: Get Istio CTL URL
25+
id: get-istioctl
26+
uses: istio/get-istioctl@e9b2b82bc1cecf150ec6aee77ceee8c256f4faf4
27+
with:
28+
version: ${{ env.ISTIO_VERSION }}
29+
- name: Download Istio CTL
30+
run: |
31+
curl -o istioctl.tar.gz -fsLO ${{ steps.get-istioctl.outputs.istioctl-url }}
32+
tar -xzf istioctl.tar.gz
33+
./istioctl version --remote=false
34+
- name: Analyze manifests
35+
run: |
36+
./istioctl analyze -A --use-kube=false \
37+
--failure-threshold ERROR \
38+
$(find . -not -path "*/.git*/*" -not -path "*/clusters/*" -name "*.yaml" -type f)

.github/workflows/e2e.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches: [ '*' ]
77
tags-ignore: [ '*' ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
kubernetes:
1114
runs-on: ubuntu-latest
@@ -20,6 +23,9 @@ jobs:
2023
version: v0.11.1
2124
- name: Install Flux in Kubernetes Kind
2225
run: flux install
26+
- name: Set Istio Gateway service type
27+
run: |
28+
kubectl -n flux-system create cm istio-version --from-literal=service=NodePort
2329
- name: Setup cluster reconciliation
2430
run: |
2531
flux create source git flux-system \
@@ -30,16 +36,19 @@ jobs:
3036
--path=./clusters/my-cluster
3137
- name: Verify cluster reconciliation
3238
run: |
33-
kubectl -n flux-system wait kustomization/istio-operator --for=condition=ready --timeout=2m
3439
kubectl -n flux-system wait kustomization/istio-system --for=condition=ready --timeout=2m
40+
kubectl -n flux-system wait kustomization/istio-gateway --for=condition=ready --timeout=2m
3541
kubectl -n flux-system wait kustomization/apps --for=condition=ready --timeout=2m
3642
kubectl -n prod wait canary/frontend --for=condition=promoted --timeout=1m
3743
kubectl -n prod rollout status deployment/frontend --timeout=1m
3844
kubectl -n prod wait canary/backend --for=condition=promoted --timeout=1m
3945
kubectl -n prod rollout status deployment/backend --timeout=1m
46+
- name: List Flux managed objects
47+
run: |
48+
flux get all --all-namespaces
4049
- name: Test canary release
4150
run: |
42-
kubectl -n prod set image deployment/backend backend=stefanprodan/podinfo:5.0.1
51+
kubectl -n prod set image deployment/backend backend=ghcr.io/stefanprodan/podinfo:6.1.1
4352
echo '>>> Waiting for canary finalization'
4453
retries=25
4554
count=0

.github/workflows/update-istio.yaml

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: update-istio
1+
name: update
22

33
on:
44
workflow_dispatch:
@@ -8,39 +8,32 @@ on:
88
branches:
99
- 'main'
1010

11+
permissions:
12+
contents: write
13+
1114
jobs:
12-
check-istio:
15+
istio:
1316
runs-on: ubuntu-latest
1417
steps:
1518
- name: Checkout
1619
uses: actions/checkout@v2
1720
with:
1821
ref: main
19-
- name: Setup Helm
20-
uses: ./.github/actions/helm
22+
- name: Find Istio latest version
23+
id: get-istioctl
24+
uses: istio/get-istioctl@e9b2b82bc1cecf150ec6aee77ceee8c256f4faf4
2125
with:
22-
version: 3.5.3
23-
- name: Check for updates
26+
version: "1.*"
27+
- name: Set the Istio version
2428
id: check
29+
env:
30+
ISTIO_VERSION: ${{ steps.get-istioctl.outputs.istioctl-url }}
2531
run: |
26-
git config user.name github-actions
27-
git config user.email [email protected]
28-
29-
curl -sL https://istio.io/downloadIstio | sh -
30-
ISTIO_DIR=$(find . -name 'istio-*' -type d -maxdepth 1 -print | head -n1)
31-
ISTIO_VER=${ISTIO_DIR##./istio-}
32-
33-
echo "Build manifests for ${ISTIO_VER} in dir ${ISTIO_DIR}"
34-
helm template --include-crds \
35-
--namespace istio-operator \
36-
${ISTIO_DIR}/manifests/charts/istio-operator/ > ./istio/operator/manifests.yaml
37-
38-
cat ${ISTIO_DIR}/samples/addons/prometheus.yaml > ./istio/system/prometheus.yaml
39-
40-
rm -rf ${ISTIO_DIR}
32+
echo "Found Istio version ${ISTIO_VERSION}"
33+
yq eval '.data.version=env(ISTIO_VERSION)' -i ./clusters/my-cluster/istio-version.yaml
4134
4235
if [[ $(git diff --stat) != '' ]]; then
43-
echo ::set-output name=version::${ISTIO_VER}
36+
echo ::set-output name=version::${ISTIO_VERSION}
4437
fi
4538
- name: Create Pull Request
4639
uses: peter-evans/create-pull-request@v3
@@ -52,5 +45,5 @@ jobs:
5245
commit-message: Update Istio to ${{ steps.check.outputs.version }}
5346
title: Update Istio to ${{ steps.check.outputs.version }}
5447
body: |
55-
Istio operator v${{ steps.check.outputs.version }}
48+
Istio v${{ steps.check.outputs.version }}
5649
branch: update-istio

.sourceignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Flux ignore
2+
# https://fluxcd.io/docs/components/source/gitrepositories/#excluding-files
3+
4+
# Exclude dirs and files which don't contain Kubernetes resources
5+
.github/
6+
docs/
7+
*.md

0 commit comments

Comments
 (0)