{"id":37856497,"url":"https://github.com/pilillo/spark-ui-controller","last_synced_at":"2026-01-16T16:27:27.250Z","repository":{"id":83297521,"uuid":"413843324","full_name":"pilillo/spark-ui-controller","owner":"pilillo","description":"A Namespaced K8s controller exposing a route for any driver-svc binding to the Spark UI","archived":false,"fork":false,"pushed_at":"2021-10-06T08:16:00.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-21T17:04:01.920Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/pilillo.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}},"created_at":"2021-10-05T14:05:38.000Z","updated_at":"2023-10-19T08:44:17.000Z","dependencies_parsed_at":"2023-03-12T17:54:26.720Z","dependency_job_id":null,"html_url":"https://github.com/pilillo/spark-ui-controller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pilillo/spark-ui-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fspark-ui-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fspark-ui-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fspark-ui-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fspark-ui-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilillo","download_url":"https://codeload.github.com/pilillo/spark-ui-controller/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilillo%2Fspark-ui-controller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-16T16:27:27.172Z","updated_at":"2026-01-16T16:27:27.234Z","avatar_url":"https://github.com/pilillo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spark UI Controller\n\nA Namespaced K8s controller exposing a route for any driver-svc binding to the Spark UI.\n\n## Usage\n\nCreate a new role and a new SA, then bind them and start the controller as deployment:\n\n```bash\noc apply -f role.yaml\noc apply -f service_account.yaml\noc apply -f role_binding.yaml\noc apply -f spark-ui-controller-deployment.yaml\n```\n\nDone!\n\n## Development\n\n### Installing the operator-sdk CLI\n```bash\nexport ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)\nexport OS=$(uname | awk '{print tolower($0)}')\nexport OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.13.0\ncurl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}\nchmod +x operator-sdk_${OS}_${ARCH} \u0026\u0026 sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk\n```\n\n### Initiating a new controller project\n\n```bash\n\nFirstly, initiate a new project, under a domain and specify the repo for the go module:\n\nexport GO111MODULE=on\noperator-sdk init \\\n--domain=github.com/pilillo \\\n--repo=github.com/pilillo/spark-ui-controller \\\n--license apache2 \\\n--skip-go-version-check \\\n--verbose\n```\nNotice that the last two flags can be omitted.\n\nThe project layout for Go-based operators is described [here](https://docs.okd.io/latest/operators/operator_sdk/golang/osdk-golang-project-layout.html#osdk-golang-project-layout).\n\nLet's create a controller type:\n```bash\noperator-sdk create api --group=core --version=v1 --kind=Service --controller=true --resource=false\n```\n\nAs opposed to creating a controller, we do not add any CRD. Therefore, there is no api folder being added.\nHowever, if you have a look at the Dockerfile and the Makefile, most scripts expect that.\nAs a workaround, add an empty api folder with:\n\n```bash\nmkdir api\n```\n\nInstall the openshift/api project to manage route resource types:\n```bash\ngo get -u github.com/openshift/api\n```\n\n### Test the controller\n\nYou can run the controller on your target cluster, as defined in `~/.kube/config`:\n```bash\nmake run\n```\n\nThis clearly works with openshift either. Make sure you are in the right context and project to avoid surprises.\n\n\n### Build the controller\n\nAgain, please have a look at the [Makefile](Makefile):\n\n```bash\ndocker-build: test ## Build docker image with the manager.\n\tdocker build -t ${IMG} .\n\ndocker-push: ## Push docker image with the manager.\n\tdocker push ${IMG}\n```\n\nTherefore:\n\n```bash\nexport IMG=pilillo/spark-ui-controller:v0.0.1\nmake docker-build\n```\n\n### Push the controller as docker image\n\nUse the makefile:\n\n```bash\nmake docker-push\n```\n\nUnless a different repo is specified in the **IMG** variable, the docker image will end up on docker hub.\nFor instance:\n\n```bash\n$ make docker-push\ndocker push pilillo/spark-ui-controller:v0.0.1\nThe push refers to repository [docker.io/pilillo/spark-ui-controller]\n23b8cccb6fce: Pushing [=============================================\u003e     ]  41.78MB/46.06MB\nc0d270ab7e0d: Pushing [==================================================\u003e]  3.697MB\n```\n\nYour controller is now available on Dockerhub or your private repo!\n\n### Bundle the controller to use it with the Operator Lifecycle manager\n\nYou can use the operator sdk to build a bundle format that can be used by the operator lifecycle manager (OLM).\nSee the official documentation [here](https://docs.okd.io/latest/operators/operator_sdk/osdk-working-bundle-images.html).\n\nSpecifically, you can use the makefile as follows:\n\n```bash\nmake bundle\n```\nwhich calls the commands `generate bundle` and `bundle validate`:\n\n```bash\nbundle: manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.\n\toperator-sdk generate kustomize manifests -q\n\tcd config/manager \u0026\u0026 $(KUSTOMIZE) edit set image controller=$(IMG)\n\t$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)\n\toperator-sdk bundle validate ./bundle\n```\n\nThis creates:\n* a bundle manifests directory at `bundle/manifests` containing a `ClusterServiceVersion` object\n* a bundle metadata directory at `bundle/metadata`\n* all custom resource definitions (CRDs) at `config/crd`\n* a Dockerfile named `bundle.Dockerfile`\n\nOnce done, you can again use the Makefile to build and push the bundle:\n\n```bash\n.PHONY: bundle-build\nbundle-build: ## Build the bundle image.\n\tdocker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .\n\n.PHONY: bundle-push\nbundle-push: ## Push the bundle image.\n\t$(MAKE) docker-push IMG=$(BUNDLE_IMG)\n```\n\nOnce pushed, the bundle can be deployed with:\n\n```bash\noperator-sdk run bundle \\\n    [-n \u003cnamespace\u003e] \\\n    \u003cregistry\u003e/\u003cuser\u003e/\u003cbundle_image_name\u003e:\u003ctag\u003e\n```\n\n## References\n\n* https://kubernetes.io/blog/2021/06/21/writing-a-controller-for-pod-labels/\n* https://developers.redhat.com/blog/2020/02/04/how-to-use-third-party-apis-in-operator-sdk-projects#step_2__use_the_discovery_api_to_see_if_the_new_api_is_present\n* https://developers.redhat.com/blog/2020/01/22/why-not-couple-an-operators-logic-to-a-specific-kubernetes-platform#how_to_implement_this_approach\n* https://docs.okd.io/latest/operators/operator_sdk/golang/osdk-golang-tutorial.html\n* https://docs.okd.io/latest/operators/operator_sdk/osdk-working-bundle-images.html","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilillo%2Fspark-ui-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilillo%2Fspark-ui-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilillo%2Fspark-ui-controller/lists"}