GoogleCloudPlatform / gke-network-policy-demo

This guide demonstrates how to improve the security of your Kubernetes Engine by applying fine-grained restrictions to network communication. You will provision a simple HTTP server and two client pods in a Kubernetes Engine cluster, then use a Network Policy restrict connections from client pods.
Apache License 2.0
99 stars 85 forks source link

Add Jenkins CI to the repo with code refactoring #5

Closed pydevops closed 6 years ago

pydevops commented 6 years ago
  1. Refactor for both CICD and laptop manual demo scenario. Key difference between CICD and manual demo:

    • gcloud zone, project
    • Terraform service account set up: GOOGLE_APPLICATION_CREDENTIALS (in Jenkinsfile)
    • gcloud compute ssh with explicit user both in shell script and Terraform local-exec provisioner. using /sh.
  2. Refactor for software engineering

    • script refactor: use common.sh to keep common variables, functions.
    • Follow makefile wrapper name convention: create/delete/validate as Makefile target, then each uses a script.
    • k8s manifest: create it as part of create.sh.
    • Validation: based on the k8s manifest deployment on hello-app
    • Found a bug in local-exec provisioner, that needs /bin/bash due to "[[" condition operator instead of
  3. Merge and resolved the conflict with upstream master branch.

  4. Tested with Jenkins on https://ci.gflocks.com/job/pydevops-gke-network-policy-demo/12/console as a successful run.

googlebot commented 6 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers
googlebot commented 6 years ago

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)