• f6_271593
    了解作者
  • 76.9KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-15 03:15
    上传日期
cwm-worker-operator 当地发展 安装 创建virtualenv python3 -m venv venv 安装依赖项 venv/bin/python -m pip install -r requirements.txt 安装Python模块 venv/bin/python -m pip install -e . 启动基础架构 启动一个Minikube集群 bin/minikube_start.sh && bin/minikube_wait.sh 确保您已连接到minikube集群 kubectl get nodes 启动Redis服务器 docker run -d --rm --name redis -p 6379:6379 redis 设置环境变量 export REDIS_HOST=172.17.0.1 export CWM_ZONE=EU export ENABL
cwm-worker-operator-master.zip
内容介绍
# cwm-worker-operator ## Local development ### Install Create virtualenv ``` python3 -m venv venv ``` Install dependencies ``` venv/bin/python -m pip install -r requirements.txt ``` Install the Python module ``` venv/bin/python -m pip install -e . ``` ### Start infrastructure start a Minikube cluster ``` bin/minikube_start.sh && bin/minikube_wait.sh ``` Make sure you are connected to the minikube cluster ``` kubectl get nodes ``` Start a Redis server ``` docker run -d --rm --name redis -p 6379:6379 redis ``` Set env vars ``` export REDIS_HOST=172.17.0.1 export CWM_ZONE=EU export ENABLE_DEBUG=yes export DEBUG_VERBOSITY=10 ``` Set secret env vars (you can get them from Jenkins): ``` export CWM_API_URL= export PACKAGES_READER_GITHUB_USER= export PACKAGES_READER_GITHUB_TOKEN= ``` Deploy a testing instance of Prometheus on the minikube cluster and wait for it to be ready ``` bin/prometheus_deploy_wait.sh ``` ### Run tests Activate the virtualenv ``` . venv/bin/activate ``` Run all tests ``` pytest ``` Run a test with full output, by specifying part of the test method name ``` pytest -sk "invalid_volume_config" ``` Or by specifying the specific test file name: ``` pytest -s tests/test_initializer.py ``` Pytest has many options, check the help message or [pytest documentation](https://docs.pytest.org/en/latest/) for details ## Helm chart development Verify connection to the minikube cluster ``` kubectl get nodes ``` Set helm arguments ``` HELMARGS="--set cwm_api_url=$CWM_API_URL,packages_reader_github_user=$PACKAGES_READER_GITHUB_USER,packages_reader_github_token=$PACKAGES_READER_GITHUB_TOKEN" ``` Deploy using one of the following options: * Use the published Docker images: * Create a docker pull secret * `echo '{"auths":{"docker.pkg.github.com":{"auth":"'"$(echo -n "${PACKAGES_READER_GITHUB_USER}:${PACKAGES_READER_GITHUB_TOKEN}" | base64 -w0)"'"}}}' | kubectl create secret generic github --type=kubernetes.io/dockerconfigjson --from-file=.dockerconfigjson=/dev/stdin` * Build your own Docker images: * Switch Docker daemon to use the minikube Docker daemon: `eval $(minikube -p minikube docker-env)` * Build the image: `docker build -t docker.pkg.github.com/cloudwebmanage/cwm-worker-operator/cwm_worker_operator:latest .` Deploy ``` helm upgrade --install cwm-worker-operator ./helm $HELMARGS ``` Start a port-forward to the redis ``` kubectl port-forward service/cwm-worker-operator-redis 6379 ```
评论
    相关推荐