Skip to content

Instantly share code, notes, and snippets.

@kevinawoo
Created October 31, 2019 16:17
Show Gist options
  • Save kevinawoo/45eb54c20c7a33e724ae2f6f5f07fc7f to your computer and use it in GitHub Desktop.
Save kevinawoo/45eb54c20c7a33e724ae2f6f5f07fc7f to your computer and use it in GitHub Desktop.

Revisions

  1. kevinawoo created this gist Oct 31, 2019.
    42 changes: 42 additions & 0 deletions webinar-script.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    # Create a directory for the Spinnaker Operator YML files downloaded from https://github.com/armory-io/spinnaker-operator/releases/download/v0.1.0/manifests.tgz
    mkdir spinnaker-operator
    cd spinnaker-operator
    VERSION=v0.2.0 && curl -L https://github.com/armory-io/spinnaker-operator/releases/download/$VERSION/manifests.tgz | tar -xvf -




    # Apply the Spinnaker Operator Custom Resource (CRD)
    # A Kubernetes custom resource is an extension of the Kubernetes API which represents a customization of a particular Kubernetes installation.
    kubectl --context alc-test-op2 apply -f deploy/crds/


    # Check to make sure the CRD spinnakerservices.spinnaker.armory.io was deployed
    kubectl --context alc-test-op2 get crd


    # Create the namespace for the Spinnaker Operator if it doesn't exist
    kubectl --context alc-test-op2 create namespace spinnaker-operator
    kubectl --context alc-test-op2 get ns


    # Deploy files in spinnaker-operator/deploy/operator/cluster to install the Spinnaker Operator in cluster mode
    kubectl --context alc-test-op2 apply -n spinnaker-operator -f deploy/operator/cluster


    # Create the namespace for Spinnaker if it doesn't exist
    kubectl --context alc-test-op2 get ns
    kubectl --context alc-test-op2 create namespace spinnaker
    kubectl --context alc-test-op2 get ns


    # Install Spinnaker using the Operator
    kustomize build deploy/spinnaker/kustomize/ | kubectl --context alc-test-op2 -n spinnaker apply -f -


    # cleanup
    kubectl --context alc-test-op2 -n spinnaker delete SpinnakerService --all --grace-period=0 --force
    kubectl --context alc-test-op2 -n spinnaker delete deployments --all --grace-period=0 --force
    kubectl --context alc-test-op2 -n spinnaker delete pods --all --grace-period=0 --force
    kubectl --context alc-test-op2 delete ns spinnaker spinnaker-operator
    kubectl --context alc-test-op2 delete customresourcedefinitions.apiextensions.k8s.io spinnakerservices.spinnaker.armory.io spinnakerservices.spinnaker.io spinnakeraccounts.spinnaker.io spinnakeraccounts.spinnaker.armory.io