Skip to content

bitpoke/bitpoke-gcp-marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

The Bitpoke App for WordPress is a versatile and simple to use cloud-native hosting platform to create, deploy, scale, manage and monitor WordPress sites.

It is as a multi-tenant, horizontal scaling solution for high-end agencies, publishers, shops, and hosting companies looking for modern solutions that combine the Kubernetes flexibility with the security offered by Google Cloud.

Learn more

Architecture

The Bitpoke App for WordPress operates over bitpoke/stack which is an open system built on Kubernetes operators used for deploying a WordPress site.

The following operators are included with this application:

Manual Installation Instructions

We recommend you to install the Bitpoke App for WordPress with just a few clicks directly from the Google Cloud Marketplace, but you can also follow these instructions to install it via command line. We recommend using Google Cloud Shell but a local workstation is also an option. If you are not using Cloud Shell, you'll need the following tools installed in your development environment: git, gcloud, kubectl, helm.

Open in Cloud Shell

If you're seeing this from Google Cloud Shell, start by pressing Next.

Create a Google Kubernetes Cluster

Bitpoke App for WordPress requires a GKE cluster with Workload Identity, Config Connector and Application Manager add ons.

Create a new cluster from the command line:

export PROJECT={{project-name}}
export CLUSTER={{cluster-name}}
export ZONE={{zone}}
export MACHINE_TYPE="e2-standard-2"
export NUM_NODES="4"

Set the project for the current workspace by running:

gcloud config set project "$PROJECT"

For regular production nodes, use the command:

gcloud beta container clusters create "{{cluster-name}}" --zone "$ZONE" --workload-pool=$PROJECT.svc.id.goog --addons=ApplicationManager,ConfigConnector,HorizontalPodAutoscaling --machine-type=${MACHINE_TYPE} --num-nodes=${NUM_NODES}

For a cost-effective preemptible nodes cluster, you should run:

gcloud beta container clusters create "{{cluster-name}}" --zone "$ZONE" --preemptible --workload-pool=$PROJECT.svc.id.goog --addons=ApplicationManager,ConfigConnector,HorizontalPodAutoscaling --machine-type=${MACHINE_TYPE} --num-nodes=${NUM_NODES}

Configure kubectl to connect to the new cluster:

gcloud container clusters get-credentials "{{cluster-name}}" --zone "$ZONE"

Verify Application Manager

Application Manager run its components in the application-system namespace. You can verify the Pods are ready by running the following command:

kubectl wait -n application-system --for=condition=available --timeout=10s deployment --all

If Application Manager is installed correctly, the output is similar to the following:

deployment.apps/application-controller-manager condition met

If not, the Application Manager might not be properly set-up due to issue 201423655. If that's the case run the following command:

kubectl apply -f kalm-gcp-fix-201423655.yaml

Configure Config Connector

First, create an IAM service account, by running in Cloud Shell:

gcloud iam service-accounts create cnrm-system

Second, give elevated permissions to the new service account:

gcloud projects add-iam-policy-binding {{project-name}} \
    --member="serviceAccount:cnrm-system@{{project-name}}.iam.gserviceaccount.com" \
    --role="roles/owner"

Third, create an IAM policy binding between the IAM service account and the predefined Kubernetes service account that Config Connector runs:

gcloud iam service-accounts add-iam-policy-binding \
cnrm-system@{{project-name}}.iam.gserviceaccount.com \
    --member="serviceAccount:{{project-name}}.svc.id.goog[cnrm-system/cnrm-controller-manager]" \
    --role="roles/iam.workloadIdentityUser"

Click here to edit configconnector.yaml and replace PLACEHOLDER with {{project-name}}. Save and close.

Then run the following command:

kubectl apply -f configconnector.yaml

Prepare the application environment

Add and update the Bitpoke Helm Repository:

helm repo add bitpoke https://helm-charts.bitpoke.io
helm repo update

Next, we'll configure the environment. Choose the instance name and namespace for the app:

export name=bitpoke-1
export namespace=bitpoke
export domain={{domain}}

NOTE

It's highly recommended to reserve a dedicated IP for your deployment. so that on upgrades your deployed sites won't change their IP address.

export loadBalancerIP="{{ip}}"

Now we'll create the application namespace:

kubectl create namespace "${namespace}"

Obtain license key

You need to generate the license key on the Marketplace application page from Deploy via command line tab.

Now upload the license.yaml file to the Google Cloud Shell by clicking on the three vertical dots icon and selecting the file.

Apply the license key

kubectl -n $namespace apply -f license.yaml

Set reporting secret name

export reportingSecret="$(kubectl -n $namespace get -o jsonpath={.metadata.name} -f license.yaml)"

Install the application

Expand the application manifest template

We recommend that you save the expanded manifest file for future updates to the application.

helm template -n "${namespace}" "${name}" bitpoke/bitpoke --skip-tests -f values.yaml --set-string marketplace.loadBalancerIP="${loadBalancerIP}" --set-string marketplace.domain="${domain}" --set-string metering.gcp.secretName="${reportingSecret}" > "${name}_manifest.yaml"

Apply the manifest to your Kubernetes cluster

Use kubectl to apply the manifest to your Kubernetes cluster:

kubectl -n "${namespace}" apply -f "${name}_manifest.yaml"

Congratulations!

To get the GCP Console URL for your app, run the following command:

echo "https://console.cloud.google.com/kubernetes/application/${ZONE}/${CLUSTER}/${namespace}/${name}"

To view your app, open the URL in your browser.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published