How do I change Spinnaker configs after an installation with helm?

3/5/2019

I'm new to using Spinnaker and Halyard. I'm following this guide by Google.

When installing Spinnaker, they use helm and attach on a spinnaker-config.yaml file that looks like this:

./helm install -n cd stable/spinnaker -f spinnaker-config.yaml --timeout 600 \
    --version 1.1.6 --wait

spinnaker-config.yaml:

export SA_JSON=$(cat spinnaker-sa.json)
export PROJECT=$(gcloud info --format='value(config.project)')
export BUCKET=$PROJECT-spinnaker-config
cat > spinnaker-config.yaml <<EOF
gcs:
  enabled: true
  bucket: $BUCKET
  project: $PROJECT
  jsonKey: '$SA_JSON'

dockerRegistries:
- name: gcr
  address: https://gcr.io
  username: _json_key
  password: '$SA_JSON'
  email: 1234@5678.com

# Disable minio as the default storage backend
minio:
  enabled: false

# Configure Spinnaker to enable GCP services
halyard:
  spinnakerVersion: 1.10.2
  image:
    tag: 1.12.0
  additionalScripts:
    create: true
    data:
      enable_gcs_artifacts.sh: |-
        \$HAL_COMMAND config artifact gcs account add gcs-$PROJECT --json-path /opt/gcs/key.json
        \$HAL_COMMAND config artifact gcs enable
      enable_pubsub_triggers.sh: |-
        \$HAL_COMMAND config pubsub google enable
        \$HAL_COMMAND config pubsub google subscription add gcr-triggers \
          --subscription-name gcr-triggers \
          --json-path /opt/gcs/key.json \
          --project [project_guid] \
          --message-format GCR
EOF

I need to add another pubsub with a different name than gcr-triggers and noticed that anything I try to add in a pipeline won't persist. I suspect this is because it needs to be added with hal like so:

note: I've already created and verified gcloud subscriptions and add-iam-policy-binding.

hal config pubsub google subscription add [new_trigger] \
          --subscription-name [new_trigger] \
          --json-path /opt/gcs/key.json \
          --project $PROJECT \
          --message-format GCR

I suspect installing spinnaker like so is kind of unconventional (correct me if I'm wrong). I've never ran a hal binary from my master machine where kubectl is run and this was not necessary in the guide. Spinnaker's architecture has a bunch of pods I can see. I've poked around in them and didn't see hal.

My question is: with this guide, how am I suppose to hal config new things? What's the normal way this is done?

-- Display name
google-cloud-pubsub
hal
kubernetes
spinnaker

1 Answer

4/23/2020

Helm is a package manager similar to apt in some linux distros. Because this is a Micro service Architecture running in Kubernetes you must access the Halyard Pod (actually it should be a stateful set)

  • Get Halyard Pod export HALYARD=$(kubectl -n spinnaker get pod -l app=halyard -oname | cut -d'/' -f 2)
  • Access Halyard Pod in Spinnaker namespace kubectl -n spinnaker exec -it ${HALYARD} /bin/bash
  • Test access by running the command hal config you should get the full config of spinnaker
  • After you apply the changes you need dont forget to use hal deploy apply
-- Andres Leon Rangel
Source: StackOverflow