Page tree
Skip to end of metadata
Go to start of metadata

https://cloud.google.com/docs/ci-cd


Moving to https://github.com/fmichaelobrien as soon as I can move it over later this week 20220216

Google Cloud Deploy

Use Cloud Deploy going forward (over spinnaker)

https://cloud.google.com/deploy/docs/deploy-app-gke

https://cloud.google.com/blog/products/devops-sre/google-cloud-deploy-now-ga

Uses

https://skaffold.dev/

https://github.com/GoogleContainerTools/kpt

see also Config Controller and Config Sync

https://cloud.google.com/anthos-config-management/docs/config-sync-overview

https://cloud.google.com/anthos-config-management/docs/concepts/config-controller-overview

Google Cloud Spinnaker

There are at least 2 options for testing out spinnaker (Google cloud marketplace) or the labs.

Github Repo for Google Cloud Marketplace

https://github.com/GoogleCloudPlatform/spinnaker-for-gcp

Labs

Codelabs - https://codelabs.developers.google.com/codelabs/cloud-builder-gke-continuous-deploy#0

Cloud Architecture - Google Skills Boost

https://www.cloudskillsboost.google/quests/24

Continuous Delivery Pipelines with Spinnaker and Kubernetes Engine

https://www.cloudskillsboost.google/focuses/75?parent=catalog

https://www.cloudskillsboost.google/focuses/552?catalog_rank=%7B%22rank%22%3A2%2C%22num_filters%22%3A0%2C%22has_search%22%3Atrue%7D&parent=catalog&search_id=15481209



Configuring a new Google Cloud Project for Spinnaker - via Cloudskillsboost.google lab - run 1

Started looking at spinnaker - it is in the architecture quest and very nice - did that one last night https://www.cloudskillsboost.google/quests/24

Cloud deploy https://cloud.google.com/deploy/docs/deploy-app-gke is the CD platform going forward but for spinnaker https://github.com/GoogleCloudPlatform/spinnaker-for-gcp - I raised the system as per instructions on the gcp marketplace https://github.com/GoogleCloudPlatform/spinnaker-for-gcp on a private system - it came up

Writing objects: 100% (4/4), 476 bytes | 476.00 KiB/s, done. Total 4 (delta 0), reused 0 (delta 0) To https://source.developers.google.com/p/biometric-dev/r/spinnaker-1-config 91b184b..bc3d0fa master -> master ~/cloudshell_open/spinnaker-for-gcp/scripts/install

Details pending - but being recreated in the next 2 sections


Qwiklabs/Cloudskillsboost in an incognito browser using a lab account


















Configuring a new Google Cloud Project for Spinnaker - via Cloudskillsboost.google lab - run 2

Managing users and groups in Cloud Identity (manually and automated)


gcloud auth list


Service Grid

servicestateAPIs
GCEdisabled
GKEdisabled
pubsubenabled
Memorystore (redis)
https://cloud.google.com/memorystore


Enabling APIs within projects




https://cloud.google.com/endpoints/docs/openapi/enable-api

TODO: script to enable all 670 services

TODO: script to get diff of service additions (671 1 day later)

# instead of enabling each service one at a time - enable all first
michael@cloudshell:~ (spinnaker-cd-dev)$ gcloud config set compute/zone us-central1-f
Updated property [compute/zone].
API [compute.googleapis.com] not enabled on project [523304717651]. Would you like to enable and retry (this will take a few minutes)? (y/N)?

# get list of apis michael@cloudshell:~ (spinnaker-cd-dev)$ gcloud services list --available | grep NAME | wc -l
671

# list of services enabled by default = 14 and does not include gce
michael@cloudshell:~ (spinnaker-cd-dev)$ gcloud services list --enabled | grep NAME
NAME: bigquery.googleapis.com
NAME: bigquerystorage.googleapis.com
NAME: cloudapis.googleapis.com
NAME: clouddebugger.googleapis.com
NAME: cloudtrace.googleapis.com
NAME: datastore.googleapis.com
NAME: logging.googleapis.com
NAME: monitoring.googleapis.com
NAME: servicemanagement.googleapis.com
NAME: serviceusage.googleapis.com
NAME: sql-component.googleapis.com
NAME: storage-api.googleapis.com
NAME: storage-component.googleapis.com
NAME: storage.googleapis.com

# enable google compute engine - 30 sec
michael@cloudshell:~ (spinnaker-cd-dev)$ gcloud services list --available | grep compute
NAME: compute.googleapis.com
NAME: prisma-cloud-compute-paloaltonetworks-public.cloudpartnerservices.goog
michael@cloudshell:~ (spinnaker-cd-dev)$ gcloud services enable compute.googleapis.com
Operation "operations/acf.p2-523304717651-77a94020-3cce-41de-ac11-8b2d1911c409" finished successfully.  


#Enable kubernetes
michael@cloudshell:~ (spinnaker-cd-dev)$ gcloud services list --available | grep gke
NAME: anthosgke.googleapis.com
NAME: gkebackup.googleapis.com
NAME: gkeconnect.googleapis.com
NAME: gkehub.googleapis.com
NAME: gkemulticloud.googleapis.com

#enable gke via the console
michael@cloudshell:~ (spinnaker-cd-dev)$ gcloud services list --enabled | grep NAME                                                                                                   
NAME: autoscaling.googleapis.com
NAME: bigquery.googleapis.com
NAME: bigquerystorage.googleapis.com
NAME: cloudapis.googleapis.com
NAME: clouddebugger.googleapis.com
NAME: cloudtrace.googleapis.com
NAME: compute.googleapis.com
NAME: container.googleapis.com
NAME: containerfilesystem.googleapis.com
NAME: containerregistry.googleapis.com
NAME: datastore.googleapis.com
NAME: iam.googleapis.com
NAME: iamcredentials.googleapis.com
NAME: logging.googleapis.com
NAME: monitoring.googleapis.com
NAME: oslogin.googleapis.com
NAME: pubsub.googleapis.com
NAME: servicemanagement.googleapis.com
NAME: serviceusage.googleapis.com
NAME: sql-component.googleapis.com
NAME: storage-api.googleapis.com
NAME: storage-component.googleapis.com
NAME: storage.googleapis.com


Set region

michael@cloudshell:~ (spinnaker-cd-dev)$ gcloud config set compute/zone us-central1-f
Updated property [compute/zone].

Get a list of currently enabled services


Start GKE Cluster


gcloud container clusters create spinnaker-tutorial --machine-type=n1-standard-2
Default change: VPC-native is the default mode during cluster creation for versions greater than 1.21.0-gke.1500. To create advanced routes based clusters, please pass the `--no-enable-ip-alias` flag
Note: Your Pod address range (`--cluster-ipv4-cidr`) can accommodate at most 1008 node(s).
Creating cluster spinnaker-tutorial in us-central1-f... Cluster is being configured...working   

929....
Creating cluster spinnaker-tutorial in us-central1-f... Cluster is being health-checked (master is healthy)...done.     
Created [https://container.googleapis.com/v1/projects/spinnaker-cd-dev/zones/us-central1-f/clusters/spinnaker-tutorial].
To inspect the contents of your cluster, go to: https://console.cloud.google.com/kubernetes/workload_/gcloud/us-central1-f/spinnaker-tutorial?project=spinnaker-cd-dev
kubeconfig entry generated for spinnaker-tutorial.
NAME: spinnaker-tutorial
LOCATION: us-central1-f
MASTER_VERSION: 1.21.6-gke.1500
MASTER_IP: 34.71.253.119
MACHINE_TYPE: n1-standard-2
NODE_VERSION: 1.21.6-gke.1500
NUM_NODES: 3
STATUS: RUNNING


following tutorial....


Access Spinnaker

Follow instructions "access spinnaker" in https://github.com/GoogleCloudPlatform/spinnaker-for-gcp - midway through the lab around section 8 https://www.cloudskillsboost.google/focuses/552?catalog_rank=%7B%22rank%22%3A2%2C%22num_filters%22%3A0%2C%22has_search%22%3Atrue%7D&parent=catalog&search_id=15481209 before building the docker image



Spinnaker via GCP repo

start at https://github.com/GoogleCloudPlatform/spinnaker-for-gcp



create an empty project

Reset the cloud shell / default project (close and reopen) - or use cli

follow https://github.com/GoogleCloudPlatform/spinnaker-for-gcp

select https://console.cloud.google.com/marketplace/details/google-cloud-platform/spinnaker

actually, relaunch and verify that the correct project is selected - in this case marketplace

Select project, enable GCE (GKE, should be enabled by the script)

click start



michael@cloudshell:~ (spinnaker-marketplace-dev)$ git config --global user.email "michael@obrienlabs.cloud"
michael@cloudshell:~ (spinnaker-marketplace-dev)$ git config --global user.name "Michael OBrien" 

clean up /rerun in different project
michael@cloudshell:~ (spinnaker-marketplace-dev)$ PROJECT_ID=spinnaker-marketplace-dev \
    ~/cloudshell_open/spinnaker-for-gcp/scripts/install/setup_properties.sh
It looks like you might have cloned the spinnaker-for-gcp repository into more than one directory. If you have any directories other than /home/michael/cloudshell_open/spinnaker-for-gcp that contain the repo, delete them in order to avoid unwanted behavior. 
If you have any directory that starts with spinnaker-for-gcp-*, even if it doesn't contain a clone of the repo, you have to delete or move that in order for this script to run. 
Conflicting directories: 
/home/michael/cloudshell_open/spinnaker-for-gcp-1
/home/michael/cloudshell_open/spinnaker-for-gcp-0 
All Spinnaker for GCP commands are required to be run within the ~/cloudshell_open/spinnaker-for-gcp directory. 
michael@cloudshell:~ (spinnaker-marketplace-dev)$ PROJECT_ID=spinnaker-marketplace-dev     ~/cloudshell_open/spinnaker-for-gcp/scripts/install/setup_properties.sh
.  The properties file already exists at /home/michael/cloudshell_open/spinnaker-for-gcp/scripts/install/properties. Please move it out of the way if you want to generate a new properties file. 
michael@cloudshell:~ (spinnaker-marketplace-dev)$ PROJECT_ID=spinnaker-marketplace-dev     ~/cloudshell_open/spinnaker-for-gcp/scripts/install/setup_properties.sh
.  The properties file already exists at /home/michael/cloudshell_open/spinnaker-for-gcp/scripts/install/properties. Please move it out of the way if you want to generate a new properties file. 
michael@cloudshell:~ (spinnaker-marketplace-dev)$ PROJECT_ID=spinnaker-marketplace-dev     ~/cloudshell_open/spinnaker-for-gcp/scripts/install/setup_properties.sh
michael@cloudshell:~ (spinnaker-marketplace-dev)$


cloudshell edit ~/cloudshell_open/spinnaker-for-gcp/scripts/install/properties
don't change anything
example


# These are only considered if a new GKE cluster is being created.
export GKE_RELEASE_CHANNEL=stable
export GKE_MACHINE_TYPE=n1-highmem-4
export GKE_DISK_TYPE=pd-standard
export GKE_DISK_SIZE=100
export GKE_NUM_NODES=3

# See TZ column in https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
export TIMEZONE=Etc/UTC

# If service account does not exist, it will be created.
export SERVICE_ACCOUNT_NAME="$DEPLOYMENT_NAME-acc-1644420526"

# If Cloud Memorystore Redis instance does not exist, it will be created.
export REDIS_INSTANCE=$DEPLOYMENT_NAME

# If bucket does not exist, it will be created.
export BUCKET_NAME="$DEPLOYMENT_NAME-93vhlkx30b5bqehl87fp-1644420526"
export BUCKET_URI="gs://$BUCKET_NAME"

# If CSR repo does not exist, it will be created.
export CONFIG_CSR_REPO=$DEPLOYMENT_NAME-config

# Used to authenticate calls to the audit log Cloud Function.
export AUDIT_LOG_UNAME="4hr2vk6ljbxl6opnrsmd-1644420526"
export AUDIT_LOG_PW="h09n93xemmm2qe198m70-1644420526"

export CLOUD_FUNCTION_NAME="${DEPLOYMENT_NAME//-}AuditLog"

export GCR_PUBSUB_SUBSCRIPTION=$DEPLOYMENT_NAME-gcr-pubsub-subscription
export GCB_PUBSUB_SUBSCRIPTION=$DEPLOYMENT_NAME-gcb-pubsub-subscription

export PUBSUB_NOTIFICATION_PUBLISHER=$DEPLOYMENT_NAME-publisher
export PUBSUB_NOTIFICATION_TOPIC=$DEPLOYMENT_NAME-notifications-topic

# The properties following this line are only relevant if you intend to expose your new Spinnaker instance.
export STATIC_IP_NAME=$DEPLOYMENT_NAME-external-ip
export MANAGED_CERT=$DEPLOYMENT_NAME-managed-cert
export SECRET_NAME=$DEPLOYMENT_NAME-oauth-client-secret

# If you own a domain name and want to use that instead of this automatically-assigned one,
# specify it here (you must be able to configure the dns settings).
export DOMAIN_NAME=$DEPLOYMENT_NAME.endpoints.$PROJECT_ID.cloud.goog

# This email address will be granted permissions as an IAP-Secured Web App User.
export IAP_USER=michael@containerized.org

Run installation

michael@cloudshell:~ (spinnaker-marketplace-dev)$ ~/cloudshell_open/spinnaker-for-gcp/scripts/install/setup.sh
.  Enabling required APIs (cloudbuild.googleapis.com cloudfunctions.googleapis.com container.googleapis.com endpoints.googleapis.com iap.googleapis.com monitoring.googleapis.com redis.googleapis.com sourcerepo.googleapis.com) in spinnaker-marketplace-dev... 
.  This phase will take a few minutes (progress will not be reported during this operation). 
.   
.  Once the required APIs are enabled, the remaining components will be installed and configured. The entire installation may take 10 minutes or more. 

Operation "operations/acf.p2-29288697183-6bc79d47-e0ae-4e03-ae96-90e2c3c3cffa" finished successfully.
.  Checking for existing cluster spinnaker-1... 
WARNING: The following filter keys were not present in any resource : name
.  Creating service account spinnaker-1-acc-1645023561... 
Created service account [spinnaker-1-acc-1645023561].
.  Assigning required roles to spinnaker-1-acc-1645023561... 
.  Assigning role cloudbuild.builds.editor... 
Updated IAM policy for project [spinnaker-marketplace-dev].
.  Assigning role container.admin... 
Updated IAM policy for project [spinnaker-marketplace-dev].
.  Assigning role logging.logWriter... 
Updated IAM policy for project [spinnaker-marketplace-dev].
.  Assigning role monitoring.admin... 
Updated IAM policy for project [spinnaker-marketplace-dev].
.  Assigning role pubsub.admin... 
Updated IAM policy for project [spinnaker-marketplace-dev].
.  Assigning role storage.admin... 
Updated IAM policy for project [spinnaker-marketplace-dev].
WARNING: The following filter keys were not present in any resource : name
.  Creating redis instance spinnaker-1 in project spinnaker-marketplace-dev... 
Create request issued for: [spinnaker-1]
Waiting for operation [projects/spinnaker-marketplace-dev/locations/us-east1/operations/operation-1645023798614-5d823f329d91c-eb7f296f-a0d1350b
] to complete...done.     
Created instance [spinnaker-1].
BucketNotFoundException: 404 gs://spinnaker-1-p2f9l4l1bbg7no5c3ny3-1645023561 bucket does not exist.
.  Creating bucket gs://spinnaker-1-p2f9l4l1bbg7no5c3ny3-1645023561... 
Creating gs://spinnaker-1-p2f9l4l1bbg7no5c3ny3-1645023561/...
Enabling versioning for gs://spinnaker-1-p2f9l4l1bbg7no5c3ny3-1645023561/...
.  Creating GKE cluster spinnaker-1... 
WARNING: The `--enable-stackdriver-kubernetes` flag is deprecated and will be removed in an upcoming release. Please use `--logging` and `--monitoring` instead. For more information, please read: https://cloud.google.com/stackdriver/docs/solutions/gke/installing.
Note: The Pod address range limits the maximum size of the cluster. Please refer to https://cloud.google.com/kubernetes-engine/docs/how-to/flexible-pod-cidr to learn how to optimize IP address allocation.
Creating cluster spinnaker-1 in us-east1-c... Cluster is being health-checked (master is healthy)...done.     
Created [https://container.googleapis.com/v1beta1/projects/spinnaker-marketplace-dev/zones/us-east1-c/clusters/spinnaker-1].
To inspect the contents of your cluster, go to: https://console.cloud.google.com/kubernetes/workload_/gcloud/us-east1-c/spinnaker-1?project=spinnaker-marketplace-dev
kubeconfig entry generated for spinnaker-1.
NAME: spinnaker-1
LOCATION: us-east1-c
MASTER_VERSION: 1.20.12-gke.1500
MASTER_IP: 34.74.29.83
MACHINE_TYPE: n1-highmem-4
NODE_VERSION: 1.20.12-gke.1500
NUM_NODES: 3
STATUS: RUNNING
.  Retrieving credentials for GKE cluster spinnaker-1... 
Fetching cluster endpoint and auth data.
kubeconfig entry generated for spinnaker-1.
WARNING: The following filter keys were not present in any resource : name
.  Creating pubsub topic projects/spinnaker-marketplace-dev/topics/gcr for GCR... 
Created topic [projects/spinnaker-marketplace-dev/topics/gcr].
WARNING: The following filter keys were not present in any resource : name
.  Creating pubsub subscription spinnaker-1-gcr-pubsub-subscription for GCR... 
Created subscription [projects/spinnaker-marketplace-dev/subscriptions/spinnaker-1-gcr-pubsub-subscription].
.  Creating pubsub topic projects/spinnaker-marketplace-dev/topics/cloud-builds for GCB... 
Created topic [projects/spinnaker-marketplace-dev/topics/cloud-builds].
.  Creating pubsub subscription spinnaker-1-gcb-pubsub-subscription for GCB... 
Created subscription [projects/spinnaker-marketplace-dev/subscriptions/spinnaker-1-gcb-pubsub-subscription].
.  Creating pubsub topic projects/spinnaker-marketplace-dev/topics/spinnaker-1-notifications-topic for notifications... 
Created topic [projects/spinnaker-marketplace-dev/topics/spinnaker-1-notifications-topic].
.  Provisioning Spinnaker resources... 
namespace/halyard created
namespace/spinnaker created
clusterrolebinding.rbac.authorization.k8s.io/spinnaker-admin created
persistentvolumeclaim/halyard-pv-claim created
statefulset.apps/spin-halyard created
service/spin-halyard created
configmap/halconfig created
job.batch/hal-deploy-apply created
Waiting on job hal-deploy-apply to complete.................
.  Updating Cloud Shell landing page for unsecured Spinnaker... 
customresourcedefinition.apiextensions.k8s.io/applications.app.k8s.io created
application.app.k8s.io/spinnaker-1 created
.  Labeling resources as components of application spinnaker-1... 
service/spin-clouddriver
service/spin-deck
service/spin-echo
service/spin-front50
service/spin-gate
service/spin-igor
service/spin-kayenta
service/spin-orca
service/spin-rosco
deployment.apps/spin-clouddriver
deployment.apps/spin-deck
deployment.apps/spin-echo
deployment.apps/spin-front50
deployment.apps/spin-gate
deployment.apps/spin-igor
deployment.apps/spin-kayenta
deployment.apps/spin-orca
deployment.apps/spin-rosco
WARNING: The following filter keys were not present in any resource : entryPoint
.  Deploying audit log cloud function spinnaker1AuditLog... 
WARNING: The nodejs8 runtime is deprecated on Cloud Functions. Please migrate to a newer Node.js version (--runtime=nodejs12). See https://cloud.google.com/functions/docs/migrating/nodejs-runtimes
Deploying function (may take a while - up to 2 minutes)...working..
For Cloud Build Logs, visit: https://console.cloud.google.com/cloud-build/builds;region=us-east1/80d192a6-b425-4b40-a527-260f86b83be1?project=29288697183
Deploying function (may take a while - up to 2 minutes)...done.     
availableMemoryMb: 2048
buildId: 80d192a6-b425-4b40-a527-260f86b83be1
buildName: projects/29288697183/locations/us-east1/builds/80d192a6-b425-4b40-a527-260f86b83be1
dockerRegistry: CONTAINER_REGISTRY
entryPoint: spinnaker1AuditLog
httpsTrigger:
  securityLevel: SECURE_ALWAYS
  url: https://us-east1-spinnaker-marketplace-dev.cloudfunctions.net/spinnaker1AuditLog
ingressSettings: ALLOW_ALL
labels:
  deployment-tool: cli-gcloud
name: projects/spinnaker-marketplace-dev/locations/us-east1/functions/spinnaker1AuditLog
runtime: nodejs8
serviceAccountEmail: spinnaker-marketplace-dev@appspot.gserviceaccount.com
sourceUploadUrl: https://storage.googleapis.com/gcf-upload-us-east1-1c5b6cbd-9729-4613-b790-2aaf6069484b/3ef5f65d-a948-414b-a056-efd3965ce088.zip
status: ACTIVE
timeout: 60s
updateTime: '2022-02-16T15:17:18.059Z'
versionId: '1'
bindings:
- members:
  - allUsers
  role: roles/cloudfunctions.invoker
etag: BwXYJCWJQDs=
version: 1
/tmp/halyard.UXbcQ ~
.  Removing /home/michael/.hal... 
.  Copying halyard/spin-halyard-0:/home/spinnaker/.hal into /home/michael/.hal... 
tar: removing leading '/' from member names
~
.  Updating Cloud Shell landing page for unsecured Spinnaker... 
.  Checking for existing cluster spinnaker-1... 
/tmp/halyard.g2tC2 ~
WARNING: The following filter keys were not present in any resource : name
.  Creating Cloud Source Repository spinnaker-1-config... 
Created [spinnaker-1-config].
WARNING: You may be billed for this repository. See https://cloud.google.com/source-repositories/docs/pricing for details.
Cloning into '/tmp/halyard.g2tC2/spinnaker-1-config'...
warning: You appear to have cloned an empty repository.
Project [spinnaker-marketplace-dev] repository [spinnaker-1-config] was cloned to [/tmp/halyard.g2tC2/spinnaker-1-config].
.  Backing up /home/michael/.hal... 
.  Backing up Spinnaker deployment config files... 
.  Removing halyard/spin-halyard-0:/home/spinnaker/.hal... 
.  Copying /home/michael/.hal into halyard/spin-halyard-0:/home/spinnaker/.hal... 
.  Creating Kubernetes secret spinnaker-deployment containing Spinnaker deployment config files... 
secret/spinnaker-deployment created
[master (root-commit) 10b5fa9] Automated backup.
 14 files changed, 554 insertions(+)
 create mode 100644 .hal/config
 create mode 100644 .hal/default/profiles/clouddriver-local.yml
 create mode 100644 .hal/default/profiles/echo-local.yml
 create mode 100644 .hal/default/profiles/front50-local.yml
 create mode 100644 .hal/default/profiles/gate-local.yml
 create mode 100644 .hal/default/profiles/igor-local.yml
 create mode 100644 .hal/default/service-settings/deck.yml
 create mode 100644 .hal/default/service-settings/fiat.yml
 create mode 100644 .hal/default/service-settings/gate.yml
 create mode 100644 .hal/default/service-settings/redis.yml
 create mode 100644 deployment_config_files/config
 create mode 100644 deployment_config_files/config.json
 create mode 100644 deployment_config_files/index.js
 create mode 100644 deployment_config_files/properties
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 4 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (21/21), 7.08 KiB | 1.77 MiB/s, done.
Total 21 (delta 0), reused 0 (delta 0), pack-reused 0
To https://source.developers.google.com/p/spinnaker-marketplace-dev/r/spinnaker-1-config
 * [new branch]      master -> master
~
Waiting on API server to come online
Waiting on storage server to come online
Waiting on orchestration engine to come online
Waiting on canary analysis engine to come online
Waiting on UI server to come online
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9188  100  9188    0     0  67065      0 --:--:-- --:--:-- --:--:-- 67065
user
non-interactive
version
Halyard version will be 1.33.0 
Halyard will be downloaded from gs://spinnaker-artifacts/halyard 
Halyard config will come from bucket gs://halconfig 
Halconfig will be stored at /home/michael/.hal/config
Uninstall script is located at /home/michael/.hal/uninstall.sh
/home/michael/installhalyard.07ln /home/michael
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  322M  100  322M    0     0   102M      0  0:00:03  0:00:03 --:--:--  102M
halyard/
halyard/config/
halyard/config/halyard.yml
halyard/bin/
halyard/bin/hal.bat
halyard/bin/halyard.bat
halyard/bin/hal
halyard/bin/halyard
halyard/lib/
halyard/lib/jul-to-slf4j-1.7.30.jar
...
halyard/lib/okhttp-urlconnection-3.14.2.jar
hal
update-halyard
/home/michael
Welcome to Cloud Shell! Type "help" to get started.
To set your Cloud Platform project in this session use “gcloud config set project [PROJECT_ID]”
The halyard daemon isn't running yet... starting it manually....
1.33.0-20200325200017

Bash auto-completion configured.
To use the auto-completion either restart your shell, or run
. /home/michael/.bashrc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14.3M  100 14.3M    0     0  68.2M      0 --:--:-- --:--:-- --:--:-- 68.2M
mv: 'spin' and '/home/michael/spin' are the same file
.  Checking for existing cluster spinnaker-1... 
/tmp/halyard.OfAI9 ~
Cloning into '/tmp/halyard.OfAI9/spinnaker-1-config'...
remote: Total 21 (delta 0), reused 21 (delta 0)
Receiving objects: 100% (21/21), 7.08 KiB | 7.08 MiB/s, done.
Project [spinnaker-marketplace-dev] repository [spinnaker-1-config] was cloned to [/tmp/halyard.OfAI9/spinnaker-1-config].
.  Backing up /home/michael/.hal... 
.  Backing up Spinnaker deployment config files... 
.  Removing halyard/spin-halyard-0:/home/spinnaker/.hal... 
.  Copying /home/michael/.hal into halyard/spin-halyard-0:/home/spinnaker/.hal... 
.  Deleting Kubernetes secret spinnaker-deployment... 
secret "spinnaker-deployment" deleted
.  Creating Kubernetes secret spinnaker-deployment containing Spinnaker deployment config files... 
secret/spinnaker-deployment created
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
Everything up-to-date
~

.  Installation complete. 

.  Sign up for Spinnaker for GCP updates and announcements: 
.    https://groups.google.com/forum/#!forum/spinnaker-for-gcp-announce 

michael@cloudshell:~ (spinnaker-marketplace-dev)$




Proceed to step 2 of 3



Follow instructions "access spinnaker" in https://github.com/GoogleCloudPlatform/spinnaker-for-gcp - midway through the lab around section 8 https://www.cloudskillsboost.google/focuses/552?catalog_rank=%7B%22rank%22%3A2%2C%22num_filters%22%3A0%2C%22has_search%22%3Atrue%7D&parent=catalog&search_id=15481209 before building the docker image

Expose port

michael@cloudshell:~ (spinnaker-marketplace-dev)$ ~/cloudshell_open/spinnaker-for-gcp/scripts/manage/connect_unsecured.sh
.  Locating Deck pod... 
.  Forwarding localhost port 8080 to 9000 on spin-deck-79c6bfd867-p522p... 

Web preview on 8080






Configure Spinnaker

Navigate to applications | Kubernetes


Manage Spinnaker

~/cloudshell_open/spinnaker-for-gcp/scripts/manage/update_console.sh

On the right tutorial side - hit applications - this will bring up the GKE cluster - select it


Add a sample container

see tutorial lab

michael@cloudshell:~ (spinnaker-marketplace-dev)$ gsutil -m cp -r gs://spls/gsp114/sample-app.tar .
Copying gs://spls/gsp114/sample-app.tar...
/ [1/1 files][824.7 KiB/824.7 KiB] 100% Done
Operation completed over 1 objects/824.7 KiB.
michael@cloudshell:~ (spinnaker-marketplace-dev)$ mkdir sample-app
tar xvf sample-app.tar -C ./sample-app
./
./.dockerignore
./cloudbuild.yaml
./pkg/
./pkg/stackdriver/
./pkg/stackdriver/monitoring.go
./docs/
./docs/img/
./docs/img/image19.png
./docs/img/image16.png
./docs/img/image23.png
./docs/img/image17.png
./docs/img/image10.png
./docs/img/image1.png
./docs/img/image22.png
./docs/img/image20.png
./docs/img/image6.png
./docs/img/image7.png
./docs/img/image13.png
./docs/img/image24.png
./docs/img/image2.png
./docs/img/image14.png
./docs/img/image15.png
./docs/img/image25.png
./docs/img/image3.png
./docs/img/image11.png
./docs/img/image8.png
./docs/img/image12.png
./docs/img/image9.png
./docs/img/image5.png
./docs/img/image4.png
./docs/img/info_card.png
./docs/img/image21.png
./docs/img/image18.png
./spinnaker/
./spinnaker/pipeline-deploy.json
./cmd/
./cmd/gke-info/
./cmd/gke-info/html.go
./cmd/gke-info/transport.go
./cmd/gke-info/stackdriver.go
./cmd/gke-info/common-service.go
./cmd/gke-info/main.go
./cmd/gke-info/messages.go
./glide.yaml
./glide.lock
./CONTRIBUTING.md
./.gitignore
./k8s/
./k8s/services/
./k8s/services/sample-backend-canary.yaml
./k8s/services/sample-frontend-prod.yaml
./k8s/services/sample-backend-prod.yaml
./k8s/services/sample-frontend-canary.yaml
./k8s/deployments/
./k8s/deployments/sample-frontend-production.yaml
./k8s/deployments/sample-backend-canary.yaml
./k8s/deployments/sample-backend-production.yaml
./k8s/deployments/sample-frontend-canary.yaml
./README.md
./pipeline.json
./LICENSE
./tests/
./tests/pipelines/
./tests/pipelines/spinnaker-tutorial-prs.yaml
./tests/pipelines/spinnaker-tutorial.yaml
./tests/tasks/
./tests/tasks/install-spinnaker.yaml
./tests/tasks/build-gke-info.yaml
./tests/scripts/
./tests/scripts/cleanup.sh
./tests/scripts/install-spinnaker.sh
./Dockerfile
./Jenkinsfile
./labs/
./labs/triggering-deployments.md
./labs/installing-spinnaker.md
./labs/building-container-images.md
./labs/creating-your-pipeline.md
./labs/workshop-cleanup.md
./labs/workshop-setup.md
michael@cloudshell:~ (spinnaker-marketplace-dev)$ cd sample-app
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ git config --global user.email "$(gcloud config get-value core/account)"
Your active configuration is: [cloudshell-7807]
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ git config --global user.name "obriensystems"
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /home/michael/sample-app/.git/
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ git add .
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ git commit -m "Initial commit"
[master (root-commit) 8490f94] Initial commit
 65 files changed, 2855 insertions(+)
 create mode 100644 .dockerignore
 create mode 100644 .gitignore
 create mode 100644 CONTRIBUTING.md
 create mode 100644 Dockerfile
 create mode 100644 Jenkinsfile
 create mode 100644 LICENSE
 create mode 100644 README.md
 create mode 100644 cloudbuild.yaml
 create mode 100644 cmd/gke-info/common-service.go
 create mode 100644 cmd/gke-info/html.go
 create mode 100644 cmd/gke-info/main.go
 create mode 100644 cmd/gke-info/messages.go
 create mode 100644 cmd/gke-info/stackdriver.go
 create mode 100644 cmd/gke-info/transport.go
 create mode 100644 docs/img/image1.png
 create mode 100644 docs/img/image10.png
 create mode 100644 docs/img/image11.png
 create mode 100644 docs/img/image12.png
 create mode 100644 docs/img/image13.png
 create mode 100644 docs/img/image14.png
 create mode 100644 docs/img/image15.png
 create mode 100644 docs/img/image16.png
 create mode 100644 docs/img/image17.png
 create mode 100644 docs/img/image18.png
 create mode 100644 docs/img/image19.png
 create mode 100644 docs/img/image2.png
 create mode 100644 docs/img/image20.png
 create mode 100644 docs/img/image21.png
 create mode 100644 docs/img/image22.png
 create mode 100644 docs/img/image23.png
 create mode 100644 docs/img/image24.png
 create mode 100644 docs/img/image25.png
 create mode 100644 docs/img/image3.png
 create mode 100644 docs/img/image4.png
 create mode 100644 docs/img/image5.png
 create mode 100644 docs/img/image6.png
 create mode 100644 docs/img/image7.png
 create mode 100644 docs/img/image8.png
 create mode 100644 docs/img/image9.png
 create mode 100644 docs/img/info_card.png
 create mode 100644 glide.lock
 create mode 100644 glide.yaml
 create mode 100644 k8s/deployments/sample-backend-canary.yaml
 create mode 100644 k8s/deployments/sample-backend-production.yaml
 create mode 100644 k8s/deployments/sample-frontend-canary.yaml
 create mode 100644 k8s/deployments/sample-frontend-production.yaml
 create mode 100644 k8s/services/sample-backend-canary.yaml
 create mode 100644 k8s/services/sample-backend-prod.yaml
 create mode 100644 k8s/services/sample-frontend-canary.yaml
 create mode 100644 k8s/services/sample-frontend-prod.yaml
 create mode 100644 labs/building-container-images.md
 create mode 100644 labs/creating-your-pipeline.md
 create mode 100644 labs/installing-spinnaker.md
 create mode 100644 labs/triggering-deployments.md
 create mode 100644 labs/workshop-cleanup.md
 create mode 100644 labs/workshop-setup.md
 create mode 100644 pipeline.json
 create mode 100644 pkg/stackdriver/monitoring.go
 create mode 100644 spinnaker/pipeline-deploy.json
 create mode 100644 tests/pipelines/spinnaker-tutorial-prs.yaml
 create mode 100644 tests/pipelines/spinnaker-tutorial.yaml
 create mode 100755 tests/scripts/cleanup.sh
 create mode 100755 tests/scripts/install-spinnaker.sh
 create mode 100644 tests/tasks/build-gke-info.yaml
 create mode 100644 tests/tasks/install-spinnaker.yaml
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ gcloud source repos create sample-app
Created [sample-app].
WARNING: You may be billed for this repository. See https://cloud.google.com/source-repositories/docs/pricing for details.
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ git config credential.helper gcloud.sh
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ export PROJECT=$(gcloud info --format='value(config.project)')
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ git remote add origin https://source.developers.google.com/p/$PROJECT/r/sample-app
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ git push origin master
Enumerating objects: 82, done.
Counting objects: 100% (82/82), done.
Delta compression using up to 4 threads
Compressing objects: 100% (75/75), done.
Writing objects: 100% (82/82), 822.03 KiB | 15.22 MiB/s, done.
Total 82 (delta 8), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (8/8)
To https://source.developers.google.com/p/spinnaker-marketplace-dev/r/sample-app
 * [new branch]      master -> master

Add a Trigger in Cloud Build


Build and Push tags


michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ export PROJECT=$(gcloud info --format='value(config.project)')
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ gsutil mb -l us-central1 gs://$PROJECT-kubernetes-manifests
Creating gs://spinnaker-marketplace-dev-kubernetes-manifests/...
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ gsutil versioning set on gs://$PROJECT-kubernetes-manifests
Enabling versioning for gs://spinnaker-marketplace-dev-kubernetes-manifests/...
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ sed -i s/PROJECT/$PROJECT/g k8s/deployments/*
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ git commit -a -m "Set project ID"
[master 7e51dda] Set project ID
 4 files changed, 4 insertions(+), 4 deletions(-)
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ git tag v1.0.0
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ git push --tags
Enumerating objects: 14, done.
Counting objects: 100% (14/14), done.
Delta compression using up to 4 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 755 bytes | 755.00 KiB/s, done.
Total 8 (delta 5), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (5/5)
To https://source.developers.google.com/p/spinnaker-marketplace-dev/r/sample-app
 * [new tag]         v1.0.0 -> v1.0.0


Install Spin CLI

michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ curl -LO https://storage.googleapis.com/spinnaker-artifacts/spin/1.14.0/linux/amd64/spin
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13.5M  100 13.5M    0     0  79.6M      0 --:--:-- --:--:-- --:--:-- 79.6M
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ chmod +x spin
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ ./spin application save --application-name sample \
                        --owner-email "$(gcloud config get-value core/account)" \
                        --cloud-providers kubernetes \
                        --gate-endpoint http://localhost:8080/gate
Your active configuration is: [cloudshell-7807]
Application save succeeded
michael@cloudshell:~/sample-app (spinnaker-marketplace-dev)$ export PROJECT=$(gcloud info --format='value(config.project)')
sed s/PROJECT/$PROJECT/g spinnaker/pipeline-deploy.json > pipeline.json
./spin pipeline save --gate-endpoint http://localhost:8080/gate -f pipeline.json
Pipeline save succeeded


Trigger Pipeline

refresh applications view in spinnaker

select the app, pipelines, manual trigger


continuing




Links

Google Cloud Icon/Diagram library at https://cloud.google.com/icons

  • No labels