1111App\Models\Blog Object ( [table:protected] => blogs [fillable:protected] => Array ( [0] => user_id [1] => date [2] => image [3] => title [4] => slug [5] => detail [6] => post_excerpt [7] => status [8] => tags [9] => related_blog_id [10] => category_id [11] => meta_detail [12] => meta_keyword ) [casts:protected] => Array ( [tags] => array ) [connection:protected] => mysql [primaryKey:protected] => id [keyType:protected] => int [incrementing] => 1 [with:protected] => Array ( ) [withCount:protected] => Array ( ) [preventsLazyLoading] => [perPage:protected] => 15 [exists] => 1 [wasRecentlyCreated] => [escapeWhenCastingToString:protected] => [attributes:protected] => Array ( [id] => 52 [user_id] => 4 [category_id] => 7 [title] => How to Deploy Spinnaker using Google Kubernetes Engine? [slug] => how-to-deploy-spinnaker-using-google-kubernetes-engine [image] => 1709709453Deploy Spinnaker using Google Kubernetes Engine.webp [date] => 2022-02-18 [detail] =>

Spinnaker is an open-source, multi-cloud-based continuous delivery platform helping developers to release software amendments with speed and confidence. This platform is made open source by Netflix and managed by Google; thus, it supports most cloud platforms and their supporting tools, including Google cloud platform, AWS, Microsoft Azure, Openstack, App Engine, Kubernetes, and many others. The main reason behind using Spinnaker is that it helps developers in cloud-based application deployment and management processes. Now, let’s start the deployment process of Spinnaker.

Step 1: Creating A Kubernetes Cluster Using Google Kubernetes Engine

Prerequisites for Kubernetes Cluster:

Steps to spin up Kubernetes cluster:

create a Kubernetes Cluster

Set up a Kubernetes cluster

Step 2: Creating Kubernetes Objects for Spinnaker
gcloud container clusters get-credentials cluster-2 --zone us-central1-a --project nick-chase
apiVersion: v1 
kind: ServiceAccount 
metadata: 
  name: spinnaker-service-account 
  namespace: default 
--- 
apiVersion: rbac.authorization.k8s.io/v1 
kind: ClusterRoleBinding 
metadata: 
  name: spinnaker-role-binding 
roleRef: 
  apiGroup: rbac.authorization.k8s.io 
  kind: ClusterRole 
  name: cluster-admin 
subjects: 
- namespace: default 
  kind: ServiceAccount 
  name: spinnaker-service-account

It creates another account called spinnaker-service-account and assigns the cluster-admin role for security purposes. Now, save the data and close the file.

kubectl create -f spinacct.yaml 
kubectl create namespace spinnaker 
apiVersion: v1 
kind: Service 
metadata: 
  namespace: spinnaker 
  labels: 
    app: spin 
    stack: gate 
  name: spin-gate-np 
spec: 
  type: LoadBalancer 
  ports: 
  - name: http 
    port: 8084 
    protocol: TCP 
  selector: 
    load-balancer-spin-gate: "true" 
--- 
apiVersion: v1 
kind: Service 
metadata: 
  namespace: spinnaker 
  labels: 
    app: spin 
    stack: deck 
  name: spin-deck-np 
spec: 
  type: LoadBalancer 
  ports: 
  - name: http 
    port: 9000 
    protocol: TCP 
  selector: 
    load-balancer-spin-deck: "true"
kubectl create -f spinsvcs.yaml 
Step 3: Preparing to Configure the Spinnaker Deployment
kubectl create deployment hal --image gcr.io/spinnaker-marketplace/halyard:1.5.0

kubectl edit deploy hal

... 
    spec: 
      serviceAccountName: spinnaker-service-account 
      containers: 
      - image: gcr.io/spinnaker-marketplace/halyard:stable 
        imagePullPolicy: IfNotPresent 
        name: halyard 
        resources: {} 
...
deployment "hal" edited 
kubectl get pods 

It shows the creation of a container. Hence, wait until the container begins to run.

kubectl exec -it hal-65fdf47fb7-tq4r8 bash  

This command will take you to the container command-line interface. Now change the Spinnaker user home directory:

spinnaker@hal-65fdf47fb7-tq4r8:/workdir# cd 
spinnaker@hal-65fdf47fb7-tq4r8:~# 
kubectl config set-cluster default --server=https://kubernetes.default --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt 
kubectl config set-context default --cluster=default 
token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) 
kubectl config set-credentials user --token=$token 
kubectl config set-context default --user=user 
kubectl config use-context default 
sed -i 's/\/usr\/local\/bin/\/home\/spinnaker/g' get_helm.sh 
sed -i 's/sudo //g' get_helm.sh 
export PATH=/home/spinnaker:$PATH

Now, run the script. The following screen shows the Helm installation process:

spinnaker@hal-65fdf47fb7-tq4r8:~# chmod 700 get_helm.sh 
spinnaker@hal-65fdf47fb7-tq4r8:~# ./get_helm.sh 
helm init --service-account tiller --upgrade 

Now, it’s time to proceed with the actual spinnaker configuration.

Step 4: Configuring the Spinnaker Deployment
ADDRESS=index.docker.io 
REPOSITORIES=library/nginx  
hal config provider docker-registry enable 
hal config provider docker-registry account add my-docker-registry \ 
   --address $ADDRESS \ 
   --repositories $REPOSITORIES 
helm repo add mirantisworkloads https://mirantisworkloads.storage.googleapis.com
helm install mirantisworkloads/minio 
MINIO_ACCESS_KEY=miniokey 
MINIO_SECRET_KEY=miniosecret 
echo $MINIO_SECRET_KEY | hal config storage s3 edit --endpoint $ENDPOINT \ 
   --access-key-id $MINIO_ACCESS_KEY \ 
   --secret-access-key 
hal config storage edit --type s3 
hal config provider kubernetes enable 
hal config provider kubernetes account add my-k8s-account --docker-registries my-docker-registry 
hal config deploy edit --type distributed --account-name my-k8s-account 
hal config version edit --version 1.8.1 
kubectl get svc -n spinnaker 
hal config security ui edit --override-base-url http://35.184.29.246:9000  
hal config security api edit --override-base-url http://35.193.195.231:8084 
Step 5: Deploy Spinnaker
hal deploy apply 
kubectl get pods -n spinnaker 

After you press enter, it will start listing pods that are running and ready, and if there aren’t, consider that you’ve to perform some operation to see such a list.

Conclusion:

Now, you’re all set to use your spinnaker to create new applications by following the path: Actions -> Create Application. If that works, consider your spinnaker is successfully deployed. Looking for the best cloud computing services provider? In that case, you’ve come to the right place. We, at CloudStakes Technology Pvt. Ltd., have cloud computing solutions to all your cloud-related issues. Book your first free cloud consultation with our cloud experts TODAY!!

[post_excerpt] => While working on the cloud-native or cloud-based application development, many developers prefer to use Spinnaker for better application deployment and... [tags] => ["109"] [related_blog_id] => 52 [status] => 1 [featured] => 0 [meta_detail] => While working on the cloud-native or cloud-based application development, many developers prefer to use Spinnaker for better application deployment and... [meta_keyword] => [created_at] => 2023-01-10 03:44:50 [updated_at] => 2024-03-06 12:47:33 ) [original:protected] => Array ( [id] => 52 [user_id] => 4 [category_id] => 7 [title] => How to Deploy Spinnaker using Google Kubernetes Engine? [slug] => how-to-deploy-spinnaker-using-google-kubernetes-engine [image] => 1709709453Deploy Spinnaker using Google Kubernetes Engine.webp [date] => 2022-02-18 [detail] =>

Spinnaker is an open-source, multi-cloud-based continuous delivery platform helping developers to release software amendments with speed and confidence. This platform is made open source by Netflix and managed by Google; thus, it supports most cloud platforms and their supporting tools, including Google cloud platform, AWS, Microsoft Azure, Openstack, App Engine, Kubernetes, and many others. The main reason behind using Spinnaker is that it helps developers in cloud-based application deployment and management processes. Now, let’s start the deployment process of Spinnaker.

Step 1: Creating A Kubernetes Cluster Using Google Kubernetes Engine

Prerequisites for Kubernetes Cluster:

Steps to spin up Kubernetes cluster:

create a Kubernetes Cluster

Set up a Kubernetes cluster

Step 2: Creating Kubernetes Objects for Spinnaker
gcloud container clusters get-credentials cluster-2 --zone us-central1-a --project nick-chase
apiVersion: v1 
kind: ServiceAccount 
metadata: 
  name: spinnaker-service-account 
  namespace: default 
--- 
apiVersion: rbac.authorization.k8s.io/v1 
kind: ClusterRoleBinding 
metadata: 
  name: spinnaker-role-binding 
roleRef: 
  apiGroup: rbac.authorization.k8s.io 
  kind: ClusterRole 
  name: cluster-admin 
subjects: 
- namespace: default 
  kind: ServiceAccount 
  name: spinnaker-service-account

It creates another account called spinnaker-service-account and assigns the cluster-admin role for security purposes. Now, save the data and close the file.

kubectl create -f spinacct.yaml 
kubectl create namespace spinnaker 
apiVersion: v1 
kind: Service 
metadata: 
  namespace: spinnaker 
  labels: 
    app: spin 
    stack: gate 
  name: spin-gate-np 
spec: 
  type: LoadBalancer 
  ports: 
  - name: http 
    port: 8084 
    protocol: TCP 
  selector: 
    load-balancer-spin-gate: "true" 
--- 
apiVersion: v1 
kind: Service 
metadata: 
  namespace: spinnaker 
  labels: 
    app: spin 
    stack: deck 
  name: spin-deck-np 
spec: 
  type: LoadBalancer 
  ports: 
  - name: http 
    port: 9000 
    protocol: TCP 
  selector: 
    load-balancer-spin-deck: "true"
kubectl create -f spinsvcs.yaml 
Step 3: Preparing to Configure the Spinnaker Deployment
kubectl create deployment hal --image gcr.io/spinnaker-marketplace/halyard:1.5.0

kubectl edit deploy hal

... 
    spec: 
      serviceAccountName: spinnaker-service-account 
      containers: 
      - image: gcr.io/spinnaker-marketplace/halyard:stable 
        imagePullPolicy: IfNotPresent 
        name: halyard 
        resources: {} 
...
deployment "hal" edited 
kubectl get pods 

It shows the creation of a container. Hence, wait until the container begins to run.

kubectl exec -it hal-65fdf47fb7-tq4r8 bash  

This command will take you to the container command-line interface. Now change the Spinnaker user home directory:

spinnaker@hal-65fdf47fb7-tq4r8:/workdir# cd 
spinnaker@hal-65fdf47fb7-tq4r8:~# 
kubectl config set-cluster default --server=https://kubernetes.default --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt 
kubectl config set-context default --cluster=default 
token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) 
kubectl config set-credentials user --token=$token 
kubectl config set-context default --user=user 
kubectl config use-context default 
sed -i 's/\/usr\/local\/bin/\/home\/spinnaker/g' get_helm.sh 
sed -i 's/sudo //g' get_helm.sh 
export PATH=/home/spinnaker:$PATH

Now, run the script. The following screen shows the Helm installation process:

spinnaker@hal-65fdf47fb7-tq4r8:~# chmod 700 get_helm.sh 
spinnaker@hal-65fdf47fb7-tq4r8:~# ./get_helm.sh 
helm init --service-account tiller --upgrade 

Now, it’s time to proceed with the actual spinnaker configuration.

Step 4: Configuring the Spinnaker Deployment
ADDRESS=index.docker.io 
REPOSITORIES=library/nginx  
hal config provider docker-registry enable 
hal config provider docker-registry account add my-docker-registry \ 
   --address $ADDRESS \ 
   --repositories $REPOSITORIES 
helm repo add mirantisworkloads https://mirantisworkloads.storage.googleapis.com
helm install mirantisworkloads/minio 
MINIO_ACCESS_KEY=miniokey 
MINIO_SECRET_KEY=miniosecret 
echo $MINIO_SECRET_KEY | hal config storage s3 edit --endpoint $ENDPOINT \ 
   --access-key-id $MINIO_ACCESS_KEY \ 
   --secret-access-key 
hal config storage edit --type s3 
hal config provider kubernetes enable 
hal config provider kubernetes account add my-k8s-account --docker-registries my-docker-registry 
hal config deploy edit --type distributed --account-name my-k8s-account 
hal config version edit --version 1.8.1 
kubectl get svc -n spinnaker 
hal config security ui edit --override-base-url http://35.184.29.246:9000  
hal config security api edit --override-base-url http://35.193.195.231:8084 
Step 5: Deploy Spinnaker
hal deploy apply 
kubectl get pods -n spinnaker 

After you press enter, it will start listing pods that are running and ready, and if there aren’t, consider that you’ve to perform some operation to see such a list.

Conclusion:

Now, you’re all set to use your spinnaker to create new applications by following the path: Actions -> Create Application. If that works, consider your spinnaker is successfully deployed. Looking for the best cloud computing services provider? In that case, you’ve come to the right place. We, at CloudStakes Technology Pvt. Ltd., have cloud computing solutions to all your cloud-related issues. Book your first free cloud consultation with our cloud experts TODAY!!

[post_excerpt] => While working on the cloud-native or cloud-based application development, many developers prefer to use Spinnaker for better application deployment and... [tags] => ["109"] [related_blog_id] => 52 [status] => 1 [featured] => 0 [meta_detail] => While working on the cloud-native or cloud-based application development, many developers prefer to use Spinnaker for better application deployment and... [meta_keyword] => [created_at] => 2023-01-10 03:44:50 [updated_at] => 2024-03-06 12:47:33 ) [changes:protected] => Array ( ) [classCastCache:protected] => Array ( ) [attributeCastCache:protected] => Array ( ) [dates:protected] => Array ( ) [dateFormat:protected] => [appends:protected] => Array ( ) [dispatchesEvents:protected] => Array ( ) [observables:protected] => Array ( ) [relations:protected] => Array ( ) [touches:protected] => Array ( ) [timestamps] => 1 [hidden:protected] => Array ( ) [visible:protected] => Array ( ) [guarded:protected] => Array ( [0] => * ) )