fluxcd / kustomize-controller

The GitOps Toolkit Kustomize reconciler
https://fluxcd.io
Apache License 2.0
254 stars 182 forks source link

kustomization creation fails during bootstrap command #345

Closed sivaramsk closed 3 years ago

sivaramsk commented 3 years ago

While issuing bootstrap command, I am getting the below error. I did see the reported similar error and the solution for the same - https://fluxcd.io/docs/components/source/gitrepositories/#excluding-files. But I understand the solution works after the installation, not sure how I can make it work during the bootstrap command.

✗ kustomize create failed: failed to decode Kubernetes YAML from /tmp/flux-system484007358/_travis.yml: error unmarshaling JSON: while decoding JSON: Object 'Kind' is missing in '{"_docker_push":{"install":"skip","script":["cd $DIR","echo $TRAVIS_BRANCH\necho $TRAVIS_TAG\nif [[ $TRAVIS_BRANCH == \"master\" ]]; then\n  local_tag=\"stable\"\nelif [[ ${TRAVIS_TAG:0:1} == \"v\" ]]; then\n  local_tag=$TAG_PREFIX${TRAVIS_TAG:1}\nelse\n  local_tag=$TAG_PREFIX\"latest\"\nfi\n","echo $local_tag","echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin","docker build $ARGS -t $IMAGE_NAME:$local_tag .","docker push $IMAGE_NAME:$local_tag"],"stage":"Build"},"_molecule":{"install":["pip install molecule==3.0.6 yamllint ansible-lint docker==4.2.2 openshift","export DOCKER_API_VERSION='1.38'"],"language":"python","python":["3.6"],"script":["cd $DIR","molecule test -s $SCENARIO"],"stage":"Unit Tests"},"_node_build":{"install":["curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -","sudo apt-get install -y nodejs"],"script":["cd $DIR","mvn clean install","echo $TRAVIS_BRANCH\necho $TRAVIS_TAG\nif [[ $TRAVIS_BRANCH == \"master\" ]]; then\n  local_tag=\"stable\"\nelif [[ ${TRAVIS_TAG:0:1} == \"v\" ]]; then\n  local_tag=$TAG_PREFIX${TRAVIS_TAG:1}\nelse\n  local_tag=$TAG_PREFIX\"latest\"\nfi\n","echo $local_tag","echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin","docker build $ARGS -t $IMAGE_NAME:$local_tag .","docker push $IMAGE_NAME:$local_tag"],"stage":"Build"},"dist":"xenial","jdk":["openjdk8"],"jobs":{"fast_finish":true,"include":[{"install":"skip","name":"Test Cordapps","script":["cd examples/supplychain-app/corda/cordApps_springBoot","./gradlew test"],"stage":"Unit Tests"},{"env":[{"DIR":"platforms/shared/configuration"},{"SCENARIO":"default"}],"install":["pip install molecule==3.0.6 yamllint ansible-lint docker==4.2.2 openshift","export DOCKER_API_VERSION='1.38'"],"language":"python","name":"Shared test","python":["3.6"],"script":["cd $DIR","molecule test -s $SCENARIO"],"stage":"Unit Tests"},{"env":[{"DIR":"platforms/shared/configuration"},{"SCENARIO":"kubernetes-corda"}],"install":["pip install molecule==3.0.6 yamllint ansible-lint docker==4.2.2 openshift","export DOCKER_API_VERSION='1.38'"],"language":"python","name":"Corda test","python":["3.6"],"script":["cd $DIR","molecule test -s $SCENARIO"],"stage":"Unit Tests"},{"env":[{"DIR":"platforms/shared/configuration"},{"SCENARIO":"kubernetes-fabric"}],"install":["pip install molecule==3.0.6 yamllint ansible-lint docker==4.2.2 openshift","export DOCKER_API_VERSION='1.38'"],"language":"python","name":"Fabric test","python":["3.6"],"script":["cd $DIR","molecule test -s $SCENARIO"],"stage":"Unit Tests"},{"env":[{"DIR":"platforms/shared/configuration"},{"SCENARIO":"kubernetes-indy"}],"install":["pip install molecule==3.0.6 yamllint ansible-lint docker==4.2.2 openshift","export DOCKER_API_VERSION='1.38'"],"language":"python","name":"Indy test","python":["3.6"],"script":["cd $DIR","molecule test -s $SCENARIO"],"stage":"Unit Tests"},{"env":[{"DIR":"platforms/r3-corda/images/doorman"},{"IMAGE_NAME":"hyperledgerlabs/doorman-linuxkit"}],"install":["curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -","sudo apt-get install -y nodejs"],"name":"Corda Doorman build","script":["cd $DIR","mvn clean install","echo $TRAVIS_BRANCH\necho $TRAVIS_TAG\nif [[ $TRAVIS_BRANCH == \"master\" ]]; then\n  local_tag=\"stable\"\nelif [[ ${TRAVIS_TAG:0:1} == \"v\" ]]; then\n  local_tag=$TAG_PREFIX${TRAVIS_TAG:1}\nelse\n  local_tag=$TAG_PREFIX\"latest\"\nfi\n","echo $local_tag","echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin","docker build $ARGS -t $IMAGE_NAME:$local_tag .","docker push $IMAGE_NAME:$local_tag"],"stage":"Build"},{"env":[{"DIR":"platforms/r3-corda/images/networkmap"},{"IMAGE_NAME":"hyperledgerlabs/networkmap-linuxkit"}],"install":["curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -","sudo apt-get install -y nodejs"],"name":"Corda Networkmap build","script":["cd $DIR","mvn clean install","echo $TRAVIS_BRANCH\necho $TRAVIS_TAG\nif [[ $TRAVIS_BRANCH == \"master\" ]]; then\n  local_tag=\"stable\"\nelif [[ ${TRAVIS_TAG:0:1} == \"v\" ]]; then\n  local_tag=$TAG_PREFIX${TRAVIS_TAG:1}\nelse\n  local_tag=$TAG_PREFIX\"latest\"\nfi\n","echo $local_tag","echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin","docker build $ARGS -t $IMAGE_NAME:$local_tag .","docker push $IMAGE_NAME:$local_tag"],"stage":"Build"},{"env":[{"IMAGE_NAME":"hyperledgerlabs/supplychain_corda"},{"TAG_PREFIX":"springboot_"}],"install":"skip","name":"Build Corda springboot-web and release Cordapps","script":["echo $TRAVIS_TAG\nif [[ -z $TRAVIS_TAG ]]; then\n  VERSION=\"0.1\"\nelif [[ ${TRAVIS_TAG:0:1} == \"v\" ]]; then\n  VERSION=${TRAVIS_TAG:1}\nelse\n  VERSION=\"0.1\"\nfi\n","cd examples/supplychain-app/corda/cordApps_springBoot","echo $VERSION","./gradlew -Pversion=$VERSION deployWebapps","./gradlew -Pversion=$VERSION build","echo $TRAVIS_BRANCH\necho $TRAVIS_TAG\nif [[ $TRAVIS_BRANCH == \"master\" ]]; then\n  local_tag=\"stable\"\nelif [[ ${TRAVIS_TAG:0:1} == \"v\" ]]; then\n  local_tag=$TAG_PREFIX${TRAVIS_TAG:1}\nelse\n  local_tag=$TAG_PREFIX\"latest\"\nfi\n","echo $local_tag","echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin","docker build --build-arg var_WEBAPP_NAME=webserver-supply-chain-$VERSION.jar -t $IMAGE_NAME:$local_tag .","docker push $IMAGE_NAME:$local_tag"],"stage":"Build"},{"env":[{"DIR":"examples/supplychain-app/corda/express_nodeJS"},{"IMAGE_NAME":"hyperledgerlabs/supplychain_corda"},{"TAG_PREFIX":"express_app_"}],"install":"skip","name":"Build Corda express_app image","script":["cd $DIR","echo $TRAVIS_BRANCH\necho $TRAVIS_TAG\nif [[ $TRAVIS_BRANCH == \"master\" ]]; then\n  local_tag=\"stable\"\nelif [[ ${TRAVIS_TAG:0:1} == \"v\" ]]; then\n  local_tag=$TAG_PREFIX${TRAVIS_TAG:1}\nelse\n  local_tag=$TAG_PREFIX\"latest\"\nfi\n","echo $local_tag","echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin","docker build $ARGS -t $IMAGE_NAME:$local_tag .","docker push $IMAGE_NAME:$local_tag"],"stage":"Build"},{"env":[{"DIR":"examples/supplychain-app/supplychain-frontend"},{"IMAGE_NAME":"hyperledgerlabs/supplychain_frontend"}],"install":"skip","name":"Build Supplychain frontend image","script":["cd $DIR","echo $TRAVIS_BRANCH\necho $TRAVIS_TAG\nif [[ $TRAVIS_BRANCH == \"master\" ]]; then\n  local_tag=\"stable\"\nelif [[ ${TRAVIS_TAG:0:1} == \"v\" ]]; then\n  local_tag=$TAG_PREFIX${TRAVIS_TAG:1}\nelse\n  local_tag=$TAG_PREFIX\"latest\"\nfi\n","echo $local_tag","echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin","docker build $ARGS -t $IMAGE_NAME:$local_tag .","docker push $IMAGE_NAME:$local_tag"],"stage":"Build"},{"env":[{"DIR":"examples/supplychain-app/fabric/chaincode_rest_server/rest-server"},{"IMAGE_NAME":"hyperledgerlabs/supplychain_fabric"},{"TAG_PREFIX":"rest_server_"}],"install":"skip","name":"Build Fabric rest_server image","script":["cd $DIR","echo $TRAVIS_BRANCH\necho $TRAVIS_TAG\nif [[ $TRAVIS_BRANCH == \"master\" ]]; then\n  local_tag=\"stable\"\nelif [[ ${TRAVIS_TAG:0:1} == \"v\" ]]; then\n  local_tag=$TAG_PREFIX${TRAVIS_TAG:1}\nelse\n  local_tag=$TAG_PREFIX\"latest\"\nfi\n","echo $local_tag","echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin","docker build $ARGS -t $IMAGE_NAME:$local_tag .","docker push $IMAGE_NAME:$local_tag"],"stage":"Build"},{"env":[{"DIR":"examples/supplychain-app/fabric/express_nodeJs"},{"IMAGE_NAME":"hyperledgerlabs/supplychain_fabric"},{"TAG_PREFIX":"express_app_"}],"install":"skip","name":"Build Fabric express_app image","script":["cd $DIR","echo $TRAVIS_BRANCH\necho $TRAVIS_TAG\nif [[ $TRAVIS_BRANCH == \"master\" ]]; then\n  local_tag=\"stable\"\nelif [[ ${TRAVIS_TAG:0:1} == \"v\" ]]; then\n  local_tag=$TAG_PREFIX${TRAVIS_TAG:1}\nelse\n  local_tag=$TAG_PREFIX\"latest\"\nfi\n","echo $local_tag","echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin","docker build $ARGS -t $IMAGE_NAME:$local_tag .","docker push $IMAGE_NAME:$local_tag"],"stage":"Build"}]},"language":"java","os":"linux","services":["docker"],"stages":[{"if":"tag IS blank","name":"Unit Tests"},{"if":"(branch IN (\"master\", \"develop\") AND type != pull_request) OR tag =~ /^(v)/","name":"Build"}]}'
sivaramsk commented 3 years ago

Once I had the clusters folder structure created, the bootstrap command went through successfully.

I created the folder structure like in the below link. https://github.com/fluxcd/flux2-kustomize-helm-example#repository-structure