{"id":13742367,"url":"https://github.com/Juniper/contrail-operator","last_synced_at":"2025-05-08T23:33:44.933Z","repository":{"id":43389450,"uuid":"220077121","full_name":"Juniper/contrail-operator","owner":"Juniper","description":"Juniper K8s contrail operator","archived":false,"fork":false,"pushed_at":"2023-08-27T19:34:28.000Z","size":167904,"stargazers_count":18,"open_issues_count":17,"forks_count":12,"subscribers_count":124,"default_branch":"master","last_synced_at":"2025-05-05T21:35:05.879Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Juniper.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-06T19:47:48.000Z","updated_at":"2023-05-26T21:55:30.000Z","dependencies_parsed_at":"2024-06-20T10:16:42.836Z","dependency_job_id":"9f822969-1607-47e2-96c4-e5428f012ef9","html_url":"https://github.com/Juniper/contrail-operator","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fcontrail-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fcontrail-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fcontrail-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fcontrail-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Juniper","download_url":"https://codeload.github.com/Juniper/contrail-operator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253165381,"owners_count":21864426,"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":[],"created_at":"2024-08-03T05:00:30.678Z","updated_at":"2025-05-08T23:33:44.910Z","avatar_url":"https://github.com/Juniper.png","language":"Go","funding_links":[],"categories":["Repository is obsolete"],"sub_categories":["Awesome Operators in the Wild"],"readme":"# Contrail Operator\nThis is first check-in to R2005\n\n## References\n[E2E test guide](test/env/README.md)\n[E2E test executor](test/executor/README.md)\n[Detailed development guide](DEVELOPMENT.md)  \n[Deployment on Openshift 4 and AWS](deploy/openshift/README.md)  \n[Deployment on Openshift 4 and KVM](deploy/openshift/docs/Openshift-KVM.md)\n\n## Requirements\n  * Go (minimal 1.14.1)\n  * Docker\n  * Bazel\n  * Kubernetes client\n  * operator-sdk (https://github.com/operator-framework/operator-sdk/)\n  * Kubernetes cluster (only one node is supported right now)\n\n\n# Contrail-Operator Development Quick Start\n\n## Install Go\n\n* https://golang.org/doc/install#install \n\n## Checkout contrail-operator source code\n\nContrail-Operator is a Go Module therefore can be downloaded to a folder outside the GOPATH.\n\n    git clone git@github.com:Juniper/contrail-operator.git\n\n## Verify if contrail-operator can be built\n\n    go build cmd/manager/main.go\n\n## Install Kubernetes Client\n\nOn Mac OS: https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-macos  \nOn Linux: https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-linux\n\n## Install IDE\n\nWe use Goland and Visual Studio Code. Install your favourite one.\n\n## Install Kind\n\nKind is used as a lightweight Kubernetes cluster for development purposes\n\n    GO111MODULE=\"on\" go get sigs.k8s.io/kind@v0.9.0\n\nVerify if it works (Mac OS):\n    \n    $ kind version\n    kind v0.9.0 go(...) darwin/amd64\n\nVerify if it works (Linux):\n    \n    $ kind version\n    kind v0.9.0 go(...) linux/amd64\n\nIf command is not found, then reload `~/.zshrc` (on Mac OS) or `~/.bashrc` (on Linux) and verify if `~/go/bin` is in `$PATH`.\n\n## Install Docker for Desktop (Mac OS only)\n\n* https://hub.docker.com/editions/community/docker-ce-desktop-mac\n\n### Increase memory amount in settings to 8GB:\n\n- click Docker icon\n- select Preferences\n- go to Resources/Advanced\n- increase memory to 8GB\n- restart Docker for Desktop\n\n## Install Docker Engine (Linux only)\n\nInstruction for Ubuntu (other distros are available as well): https://docs.docker.com/install/linux/docker-ce/ubuntu/ \n\n## Create Kind test environment\n\nFollowing commands will create Kubernetes cluster.\n\nIt also starts Docker registry on port 5000. All pods deployed in the cluster will pull images from this Docker Registry. \n\n    cd test/env\n    ./create_testenv.sh\n\nVerify if it works:\n\n    $ kind get clusters\n    kind\n\n## Pull images to locker Docker registry\n\n    cd test/env\n    ./update_local_registry.sh\n\nIn case of timeouts disable VPN and retry.\n\n## Install operator-sdk\n\nOperator-SDK is a set of tools for developing Kubernates Operators. It is needed for:\n\n- Go code generation\n- K8s Custom Resource Definitions generation\n- building contrail-operator image\n- running e2e tests (aka system tests)\n\n### Operator-sdk installation on Mac OS\n\n    $ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/v0.18.2/operator-sdk-v0.18.2-x86_64-apple-darwin\n    $ chmod u+x ./operator-sdk-v0.18.2-x86_64-apple-darwin\n    $ sudo mv ./operator-sdk-v0.18.2-x86_64-apple-darwin /usr/local/bin/operator-sdk\n\nVerify if it works:\n\n    $ operator-sdk version\n    operator-sdk version: \"v0.18.2\", (...)\n\n### Operator-sdk installation on Linux\n\n    $ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/v0.18.2/operator-sdk-v0.18.2-x86_64-linux-gnu\n    $ chmod u+x ./operator-sdk-v0.18.2-x86_64-linux-gnu  \n    $ sudo mv ./operator-sdk-v0.18.2-x86_64-linux-gnu /usr/local/bin/operator-sdk\n\n\nVerify if it works:\n\n    $ operator-sdk version\n    operator-sdk version: \"v0.18.2\", (...)\n\n## Install python3 and patch tool\n\n    yum install python3\n    yum install patch\n\n## Install bazel\n\n### Bazel on linux\n\n    https://docs.bazel.build/versions/3.4.0/install-ubuntu.html\n\n### Bazel on Mac\n\n    https://docs.bazel.build/versions/3.4.0/install-os-x.html#install-on-mac-os-x-homebrew\n\n## Build Contrail-Operator\n\nIn order to run Contrail-Operator in the Kubernetes cluster we have to build Docker Image.\n\n    # local registry address\n    export LOCAL_REGISTRY=localhost:5000\n\n    # it builds and pushes image: {LOCAL_REGISTRY}/contrail-operator/engprod-269421/contrail-operator-crdsloader:master.latest\n    bazel run //cmd/crdsloader:contrail-operator-crdsloader-push-local\n\n    # it builds and pushes image: {LOCAL_REGISTRY}/contrail-operator/engprod-269421/contrail-operator:master.latest\n    bazel run //cmd/manager:contrail-operator-push-local\n\n\nVerify:\n\n    $ docker images | grep contrail-operator\n    contrail-operator   latest   5c0148fdb7e8   4 seconds ago   125MB\n\nAfter image is created we have to push it into local Docker registry.\n\n    docker push localhost:5000/contrail-operator:latest\n\n## Run Contrail-Operator with sample Contrail configuration\n\nFollowing command will deploy Contrail-Operator on a working Kubernetes cluster. It will also create a sample Contrail configuration. Note: you can change this configuration by editing `test/env/deploy/cluster.yaml` file.\n\n    cd test/env\n    ./apply_contrail_cluster.sh\n\nAs soon as contrail-operator is started, it deploys Contrail services. It is a time-consuming process. You can watch the progress using following command:\n\n    watch kubectl get pods -n contrail\n\nEventually all pods should be Running:\n\n    NAME                                          READY   STATUS      RESTARTS   AGE\n    cassandra1-cassandra-statefulset-0            1/1     Running     0          8m15s\n    command-command-deployment-77644668cf-dpp6f   1/1     Running     0          7m21s\n    config1-config-statefulset-0                  9/9     Running     0          4m47s\n    contrail-operator-585f5bd8b5-hfdrz            1/1     Running     0          9m24s\n    control1-control-statefulset-0                4/4     Running     0          2m56s\n    keystone-keystone-statefulset-0               3/3     Running     0          7m8s\n    memcached-deployment-5f5f974bd9-gthzx         1/1     Running     0          8m15s\n    postgres-pod                                  1/1     Running     0          8m16s\n    provmanager1-provisionmanager-statefulset-0   1/1     Running     0          2m57s\n    rabbitmq1-rabbitmq-statefulset-0              1/1     Running     0          8m15s\n    swift-proxy-deployment-754f87448b-6l5nc       1/1     Running     0          4m32s\n    swift-ring-account-job-rnsxs                  0/1     Completed   0          7s\n    swift-ring-container-job-pkb2k                0/1     Completed   0          7s\n    swift-ring-object-job-7nn44                   0/1     Completed   0          7s\n    swift-storage-statefulset-0                   13/13   Running     0          8m11s\n    webui1-webui-statefulset-0                    3/3     Running     0          2m56s\n    zookeeper1-zookeeper-statefulset-0            1/1     Running     0          8m16s\n\n\n### Verify if Contrail Command is working\n\nYou can access Contrail Command application via web browser. Before that you have to forward the network traffic from localhost to Command's pod.\n\n    kubectl port-forward $(kubectl get pods -l command=command -n contrail -o name) -n contrail 9091:9091\n\nGo to http://localhost:9091\n\nAuthenticate using `admin` username, `contrail123` password and `Default` domain. \n\n## Run unit tests\n\nYou can run unit test tests on your favourite IDE by executing all tests in `pkg` package.\n\nYou can also use command line tool:\n\n    go test ./pkg/...\n\nEventually you should get results and command should return success:\n\n    ?       github.com/Juniper/contrail-operator/pkg/apis    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/apis/contrail    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/apis/contrail/v1alpha1    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/apis/contrail/v1alpha1/templates    [no test files]\n    ok      github.com/Juniper/contrail-operator/pkg/apis/contrail/v1alpha1/tests    0.943s\n    ?       github.com/Juniper/contrail-operator/pkg/client/keystone    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/client/kubeproxy    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/client/swift    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/controller    [no test files]\n    ok      github.com/Juniper/contrail-operator/pkg/controller/cassandra    1.414s\n    ok      github.com/Juniper/contrail-operator/pkg/controller/command    2.316s\n    ?       github.com/Juniper/contrail-operator/pkg/controller/config    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/controller/control    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/controller/enqueue    [no test files]\n    ok      github.com/Juniper/contrail-operator/pkg/controller/keystone    4.196s\n    ?       github.com/Juniper/contrail-operator/pkg/controller/kubemanager    [no test files]\n    ok      github.com/Juniper/contrail-operator/pkg/controller/manager    1.789s\n    ?       github.com/Juniper/contrail-operator/pkg/controller/manager/crs    [no test files]\n    ok      github.com/Juniper/contrail-operator/pkg/controller/memcached    1.097s\n    ok      github.com/Juniper/contrail-operator/pkg/controller/postgres    1.779s\n    ?       github.com/Juniper/contrail-operator/pkg/controller/provisionmanager    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/controller/rabbitmq    [no test files]\n    ok      github.com/Juniper/contrail-operator/pkg/controller/swift    1.002s\n    ok      github.com/Juniper/contrail-operator/pkg/controller/swiftproxy    0.870s\n    ok      github.com/Juniper/contrail-operator/pkg/controller/swiftstorage    1.147s\n    ?       github.com/Juniper/contrail-operator/pkg/controller/utils    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/controller/vrouter    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/controller/webui    [no test files]\n    ?       github.com/Juniper/contrail-operator/pkg/controller/zookeeper    [no test files]\n    ok      github.com/Juniper/contrail-operator/pkg/job    0.389s\n    ok      github.com/Juniper/contrail-operator/pkg/k8s    0.558s\n    ?       github.com/Juniper/contrail-operator/pkg/randomstring    [no test files]\n    ok      github.com/Juniper/contrail-operator/pkg/swift/ring    0.416s\n    \n## Run e2e tests (aka system tests)\n\nIn order to test if the whole system works as expected we have a few plumbing tests. They verify if after deployment all Contrail services can talk to each other and operate as expected.\n\nBefore tests can be run you have to have clean the cluster. The fastest way is to delete the cluster:\n\n    kind delete cluster\n\nThen you have to create a new one plus a `contrail` namespace:\n\n    cd test/env\n    ./create_testenv.sh\n    kubectl create namespace contrail\n\nSystem tests can be run using operator-sdk tool\n\n    # From contrail-operator root directory\n    # To run aio e2e test\n    operator-sdk test local ./test/e2e/aio/ --namespace contrail --go-test-flags \"-v -timeout=30m\" --up-local\n    # To run ha e2e test\n    operator-sdk test local ./test/e2e/ha/ --namespace contrail --go-test-flags \"-v -timeout=30m\" --up-local\n\n## Before submitting pull request\n\nThere is a set of tools that can check your code automatically. This includes static code checks, unit-tests and e2e integration tests. Most of those checks are run for every pull request and vote.\n\n### Run gazelle to make sure that all BUILD.bazel files get updated\n\n    bazel run //:gazelle\n\n### Build and test code. This commands also runs `nogo` linters\n\n    bazel build //... \u0026\u0026 bazel test //...\n\nIt will report errors in case:\n\n* code doesn't build\n* unit-tests fails\n* static checks don't pass\n* code is not correctly formatted\n\n## Notes\n\n* Contrail Operator creates Persistent Volumes that are used by some of the deployed pods. After deletion of Contrail resources (e.g. after deleting the Manager Custom Resource), those Persistent Volumes will not be deleted. Administrator has to delete them manually and make sure that directories created by these volumes on cluster nodes are in the expected state. Example Persistent Volumes deletion command:\n```\nkubectl delete pv $(kubectl get pv -o=jsonpath='{.items[?(@.spec.storageClassName==\"local-storage\")].metadata.name}')\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuniper%2Fcontrail-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJuniper%2Fcontrail-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuniper%2Fcontrail-operator/lists"}