- A local kubernetes cluster for local development (eg. Docker for Desktop)
- A remote kubernetes for production (eg. Google Kubernetes Engine)
$ kubectl --namespace kube-system create sa tiller
$ kubectl create clusterrolebinding tiller \
--clusterrole cluster-admin \
--serviceaccount=kube-system:tiller
$ helm init --service-account tiller \
--history-max 10 \
--override 'spec.template.spec.containers[0].command'='{/tiller,--storage=secret}' \
--wait
$ kubectl create ns presslabs-stack
$ kubectl label namespace presslabs-stack certmanager.k8s.io/disable-validation=true
$ helm repo add presslabs https://presslabs.github.io/charts
$ helm repo update
$ helm install -n stack presslabs/stack --namespace presslabs-stack \
-f https://raw.githubusercontent.com/presslabs/stack/master/presets/minikube.yaml
For that you need to run:
$ kubectl -n presslabs-stack get pod
And wait until all pods status is either Running
or Completed
.
$ gcloud container clusters create --region=europe-west2 \
--node-locations europe-west2-a,europe-west2-b \
--machine-type=n1-standard-2 --num-nodes 1 \
--node-labels=node-role.kubernetes.io/presslabs-sys= \
--node-taints=CriticalAddonsOnly=true:PreferNoSchedule \
--enable-ip-alias wclondon-2019
$ gcloud container node-pools create stack-workers-1 --cluster=wclondon-2019 --region=europe-west2 \
--machine-type=n1-standard-2 --num-nodes 1 \
--node-labels=node-role.kubernetes.io/wordpress=,node-role.kubernetes.io/database=
$ gcloud container clusters get-credentials --region europe-west2 wclondon-2019
$ kubectl config get-contexts
$ kubectl --namespace kube-system create sa tiller
$ kubectl create clusterrolebinding tiller \
--clusterrole cluster-admin \
--serviceaccount=kube-system:tiller
$ helm init --service-account tiller \
--history-max 10 \
--override 'spec.template.spec.containers[0].command'='{/tiller,--storage=secret}' \
--wait
$ kubectl create ns presslabs-stack
$ kubectl label namespace presslabs-stack certmanager.k8s.io/disable-validation=true
$ helm repo add presslabs https://presslabs.github.io/charts
$ helm repo update
$ helm install -n stack presslabs/stack --namespace presslabs-stack \
--set letsencrypt.enabled=true,letsencrypt.email=YOUR_LETS_ENCRYPT_ACCOUNT_EMAIL
-f https://raw.githubusercontent.com/presslabs/stack/master/presets/gke.yaml
For that you need to run:
$ kubectl -n presslabs-stack get pod
And wait until all pods status is either Running
or Completed
.
$ kubectl config use-context docker-desktop
$ composer create-project roots/bedrock wclondon-2019
$ cd wclondon-2019
composer remove roots/wordpress
composer require presslabs-stack/wordpress ^5.2
docker pull quay.io/presslabs/wordpress-runtime:5.2-7.3.4-latest
Before proceeding make note of:
- The docker repository you are going to publish images to
- Make note of you production cluster context
wp stack init
git init
git add .
git commit -m "Initial commit"
composer require wpackagist-plugin/debug-bar rarst/laps
skaffold dev
Important You need to switch to the production kubernetes context (the one from step 2) before deploying.
kubectl config use-context MY_PROD_CONTEXT
skaffold deploy