{"id":23957000,"url":"https://github.com/imjoseangel/restapi-operator","last_synced_at":"2026-06-18T16:31:00.680Z","repository":{"id":57540290,"uuid":"289548266","full_name":"imjoseangel/restapi-operator","owner":"imjoseangel","description":"Kubernetes Operator - Ansible","archived":false,"fork":false,"pushed_at":"2020-09-01T08:17:01.000Z","size":191,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-27T18:45:41.554Z","etag":null,"topics":["ansible","kubernetes-operator"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imjoseangel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-22T18:52:44.000Z","updated_at":"2020-12-28T15:48:55.000Z","dependencies_parsed_at":"2022-09-26T18:31:08.701Z","dependency_job_id":null,"html_url":"https://github.com/imjoseangel/restapi-operator","commit_stats":null,"previous_names":["imjoseangel/k8s-operator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imjoseangel/restapi-operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjoseangel%2Frestapi-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjoseangel%2Frestapi-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjoseangel%2Frestapi-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjoseangel%2Frestapi-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imjoseangel","download_url":"https://codeload.github.com/imjoseangel/restapi-operator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjoseangel%2Frestapi-operator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34499403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ansible","kubernetes-operator"],"created_at":"2025-01-06T16:35:36.615Z","updated_at":"2026-06-18T16:31:00.650Z","avatar_url":"https://github.com/imjoseangel.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Kubernetes Operator\n\n## How to run on Mac\n\n### Install with brew\n\n```bash\nbrew install operator-sdk\n```\n\n### Confirm version\n\n```bash\noperator-sdk version\n\noperator-sdk version: \"v1.0.0\", commit: \"d7d5e0cd6cf5468bb66e0849f08fda5bf557f4fa\", kubernetes version: \"v1.18.2\", go version: \"go1.14.7 darwin/amd64\", GOOS: \"darwin\", GOARCH: \"amd64\"\n```\n\n### Create and Initialize the Project\n\n```bash\nmkdir ~/restapi-operator  \u0026\u0026 cd ~/restapi-operator/\noperator-sdk init --plugins=ansible --domain example.com\n```\n\n### Create the API\n\n```bash\noperator-sdk create api --group api --version v1alpha1 --kind Restapi --generate-role\n```\n\n### Modify the Manager\n\nUpdate the file `roles/restapi/tasks/main.yml:`\n\n```yaml\n---\n- name: start Restapi\n  community.kubernetes.k8s:\n    definition:\n      kind: Deployment\n      apiVersion: apps/v1\n      metadata:\n        name: '{{ ansible_operator_meta.name }}-restapi'\n        namespace: '{{ ansible_operator_meta.namespace }}'\n      spec:\n        replicas: \"{{ size }}\"\n        selector:\n          matchLabels:\n            app: restapi\n        template:\n          metadata:\n            labels:\n              app: restapi\n          spec:\n            containers:\n            - name: restapi\n              image: \"docker.io/imjoseangel/restapi:latest\"\n              imagePullPolicy: Always\n              ports:\n                - containerPort: 5000\n              resources:\n                requests: # minimum resources required\n                  cpu: 250m\n                  memory: 64Mi\n                limits: # maximum resources allocated\n                  cpu: 500m\n                  memory: 256Mi\n              readinessProbe: # is the container ready to receive traffic?\n                httpGet:\n                  port: 5000\n                  path: /\n              livenessProbe: # is the container healthy?\n                httpGet:\n                  port: 5000\n                  path: /\n```\n\nAdd the defaults to `roles/restapi/defaults/main.yml`\n\n```yaml\n---\n# defaults file for restapi\nsize: 1\n```\n\nAnd update the file `config/samples/api_v1alpha1_restapi.yaml`\n\n```yaml\n---\napiVersion: restapi.example.com/v1alpha1\nkind: Restapi\nmetadata:\n  name: restapi-sample\nspec:\n  size: 3\n```\n\nDefine your image and container registry:\n\n```bash\nexport IMG=docker.io/imjoseangel/restapi-operator:v1\n```\n\nAnd run:\n\n```bash\nmake docker-build docker-push IMG=$IMG\n```\n\n\u003e**Note**: Be sure that there are no extra spaces in your PATH environment or the command will fail.\n\n### Run the Operator\n\n### Create the namespace\n\n```bash\nkubectl create namespace restapi-operator-system\n```\n\n### Apply the restapi Kind (CRD)\n\n```bash\nmake install\n```\n\n### Deploy the operator\n\n```bash\nexport IMG=docker.io/imjoseangel/restapi-operator:v1\nmake deploy\n```\n\nVerify that the restapi-operator is up and running:\n\n```bash\nkubectl get deployment -n restapi-operator-system\n```\n\n### Create a restapi resource\n\n```bash\nkubectl apply -f config/samples/api_v1alpha1_restapi.yaml -n restapi-operator-system\n```\n\nVerify that restapi pods are created\n\n```bash\nkubectl get pods -n restapi-operator-system\n\nNAME                                                     READY   STATUS    RESTARTS   AGE\nrestapi-operator-controller-manager-5d95cd576f-npmcl     2/2     Running   0          30s\nrestapi-sample-restapi-b885dcc75-69k8d                   1/1     Running   0          21s\nrestapi-sample-restapi-b885dcc75-8s66v                   1/1     Running   0          21s\nrestapi-sample-restapi-b885dcc75-s9blm                   1/1     Running   0          21s\n\n\nkubectl get all -n restapi-operator-system\n\n\nNAME                                                         READY   STATUS    RESTARTS   AGE\npod/restapi-operator-controller-manager-5d95cd576f-npmcl     2/2     Running   0          66s\npod/restapi-sample-restapi-b885dcc75-69k8d                   1/1     Running   0          57s\npod/restapi-sample-restapi-b885dcc75-8s66v                   1/1     Running   0          57s\npod/restapi-sample-restapi-b885dcc75-s9blm                   1/1     Running   0          57s\n\nNAME                                                            TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)    AGE\nservice/restapi-operator-controller-manager-metrics-service     ClusterIP   10.0.5.131   \u003cnone\u003e        8443/TCP   68s\n\nNAME                                                    READY   UP-TO-DATE   AVAILABLE   AGE\ndeployment.apps/restapi-operator-controller-manager     1/1     1            1           67s\ndeployment.apps/restapi-sample-restapi                  3/3     3            3           58s\n\nNAME                                                               DESIRED   CURRENT   READY   AGE\nreplicaset.apps/restapi-operator-controller-manager-5d95cd576f     1         1         1       67s\nreplicaset.apps/restapi-sample-restapi-b885dcc75                   3         3         3       58s\n```\n\n### Cleanup\n\nTo leave the operator, but remove the restapi sample pods, delete the CR.\n\n```bash\nkubectl delete -f config/samples/api_v1alpha1_restapi.yaml -n restapi-operator-system\n```\n\nTo clean up everything:\n\n```bash\nmake undeploy\n```\n\n## Troubleshooting\n\nRun the following command to check the operator logs.\n\n```bash\nkubectl logs deployment.apps/restapi-operator-controller-manager -n restapi-operator-system -c manager\n```\n\n## More Info\n\n[Tutorial](https://learn.openshift.com/ansibleop/ansible-operator-overview/?extIdCarryOver=true\u0026intcmp=701f20000012k6TAAQ\u0026sc_cid=701f2000001Css5AAC)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjoseangel%2Frestapi-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimjoseangel%2Frestapi-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjoseangel%2Frestapi-operator/lists"}