Skip to content
Permalink
Browse files

Add Flux install script and namespace

  • Loading branch information...
stefanprodan committed Apr 30, 2019
1 parent bdc848c commit 41a75fcfbb092d6bd2f515cdda8188f3e0f8b521
Showing with 79 additions and 1 deletion.
  1. +6 −0 namespaces/flux.yaml
  2. +1 −1 namespaces/{test.yaml → prod.yaml}
  3. +72 −0 scripts/flux-init.sh
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
istio-injection: disabled
name: flux
@@ -3,4 +3,4 @@ kind: Namespace
metadata:
labels:
istio-injection: enabled
name: test
name: prod
@@ -0,0 +1,72 @@
#!/usr/bin/env bash

set -e

if [[ ! -x "$(command -v kubectl)" ]]; then
echo "kubectl not found"
exit 1
fi

if [[ ! -x "$(command -v helm)" ]]; then
echo "helm not found"
exit 1
fi

REPO_ROOT=$(git rev-parse --show-toplevel)
REPO_URL=git@github.com:stefanprodan/gitops-istio
REPO_BRANCH=1.1
TEMP=${REPO_ROOT}/temp

rm -rf ${TEMP} && mkdir ${TEMP}

cat <<EOF >> ${TEMP}/flux-values.yaml
helmOperator:
create: true
createCRD: true
configureRepositories:
enable: true
volumeName: repositories-yaml
secretName: flux-helm-repositories
cacheVolumeName: repositories-cache
repositories:
- caFile: ""
cache: stable-index.yaml
certFile: ""
keyFile: ""
name: stable
password: ""
url: https://kubernetes-charts.storage.googleapis.com
username: ""
- caFile: ""
cache: istio.io-index.yaml
certFile: ""
keyFile: ""
name: istio.io
password: ""
url: https://storage.googleapis.com/istio-release/releases/1.1.4/charts
username: ""
- caFile: ""
cache: flagger-index.yaml
certFile: ""
keyFile: ""
name: flagger
password: ""
url: https://flagger.app
username: ""
EOF

helm repo add weaveworks https://weaveworks.github.io/flux

helm upgrade -i flux --wait \
--set git.url=${REPO_URL} \
--set git.branch=${REPO_BRANCH} \
--set git.pollInterval=1m \
--set registry.pollInterval=1m \
--namespace flux \
-f ${TEMP}/flux-values.yaml \
weaveworks/flux

kubectl -n flux rollout status deployment/flux

echo '>>> GitHub deploy key'
kubectl -n flux logs deployment/flux | grep identity.pub | cut -d '"' -f2

0 comments on commit 41a75fc

Please sign in to comment.
You can’t perform that action at this time.