{"id":28419894,"url":"https://github.com/simran2104/wordpress-operator","last_synced_at":"2026-05-06T04:32:10.589Z","repository":{"id":110326083,"uuid":"462354580","full_name":"simran2104/Wordpress-Operator","owner":"simran2104","description":"A Kuberentes Operator using the operator-sdk project that deploys wordpress using on sql via a custom resource.","archived":false,"fork":false,"pushed_at":"2022-03-15T06:02:51.000Z","size":93,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T01:38:51.621Z","etag":null,"topics":["docker-image","golang","kubernetes","operator-sdk"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simran2104.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-22T15:18:19.000Z","updated_at":"2022-06-21T17:04:47.000Z","dependencies_parsed_at":"2023-04-27T14:47:23.707Z","dependency_job_id":null,"html_url":"https://github.com/simran2104/Wordpress-Operator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simran2104/Wordpress-Operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simran2104%2FWordpress-Operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simran2104%2FWordpress-Operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simran2104%2FWordpress-Operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simran2104%2FWordpress-Operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simran2104","download_url":"https://codeload.github.com/simran2104/Wordpress-Operator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simran2104%2FWordpress-Operator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262444770,"owners_count":23312228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-image","golang","kubernetes","operator-sdk"],"created_at":"2025-06-04T22:14:21.258Z","updated_at":"2026-05-06T04:32:10.544Z","avatar_url":"https://github.com/simran2104.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eWordpress Operator\u003c/h1\u003e\n\nThe Objective of this Operator is to demonstrate Wordpress kind of resource using Kuberentes controller pattern- [Operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/). Another objective of the repository is to show how to build the custom controller that encapsulates specific domain/application level knowledge. The Operator is built using the [operator-sdk framework](https://github.com/operator-framework/operator-sdk).\nIf Wordpress and MySQL were to be deployed without operator on Kuberenetes, it can be referred [here](https://kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/). Lets understand how can this be achieved via Kubernetes Operator.\n\n## Prerequistites\n\n- golang v1.12+.\n- set GO111MODULE=\"on\"\n- [Install the operator-sdk (version 0.15)](https://sdk.operatorframework.io/docs/installation/install-operator-sdk/)\n- [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/)\n- [kubectl client](https://kubernetes.io/docs/tasks/tools/install-kubectl/)\n\n## Wordpress Resource\nThe Wordpress Operator using the operator-sdk project deploys wordpress using on sql via a [custom resource](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/)\n- A kubernetes resource of kind: `Wordpress` and apiVersion: `example.com/v1` is created that results in the Operator deploying `Deployments`, `PersistentVolumeClaims`, `Services`, that constitute a simple instance of wordpress on sql. \n- The user can specify plaintext password that can be used as a `MYSQL_ROOT_PASSWORD`.\nOnce the user applies the Wordpress resource (kubectl aply -f ./deploy/crds/example.com_v1_wordpress_cr.yaml) resource, controller could spin up `mysql and wordpress pods` using the `MYSQL_ROOT_PASSWORD` as specified in `spec.sqlrootpassword`.\ne.g., \n``` \napiVersion: example.com/v1\nkind: Wordpress\nmetadata:\n  name: mysite\nspec:\n  sqlRootPassword: plaintextpassword \n  ```\n  \n## Trying the Operator\n\n`git clone https://github.com/simran2104/Wordpress-Operator.git`\n`cd Wordpress-Operator`\nWe would be trying out the operator locally. By locally we mean that we want to run the operatot logic binary without actually building an image and pushing it to a container registry. Running the operator locally helps in day to day development. \nYou can have a [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) single node local cluster to play with the operator.\nBefore running the operator do:\n```\nkubectl apply -f ./config/crd/bases/example.com_wordpresses.yaml\n```\n\nThe CRD would be registerd and you can check that by the following command:\n`kubectl get crd`\nAfter that run the operator locally with `operator-sdk run --local`\n\nSee if the pods,deployments,pvcs and services are up and running: \n```\nkubectl get pods\nkubectl get deploy\nkubectl get pvc\nkubectl get svc\n```\nYou should be able to see the following output:\n\n![image](https://user-images.githubusercontent.com/56031500/158316597-a073bbcd-2ab3-47cf-bb8e-d9d28e894bd9.png)\n\n\n\nRun the following command to get the IP Address for the Wordpress Service:\n\n`minikube service wordpress --url`\n\nThe response should be like this:\n\n`http://192.168.99.101:31881`\n\nCopy the IP address and load the page in your browser to view your site: \n\n\n![alt text](https://raw.githubusercontent.com/kubernetes/examples/master/mysql-wordpress-pd/WordPress.png)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimran2104%2Fwordpress-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimran2104%2Fwordpress-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimran2104%2Fwordpress-operator/lists"}