├── .asf.yaml ├── .dockerignore ├── .github └── workflows │ ├── ci.yaml │ └── publish-docker.yaml ├── .gitignore ├── .licenserc.yaml ├── Dockerfile ├── LICENSE ├── Makefile ├── NOTICE ├── PROJECT ├── README.md ├── api └── v1alpha1 │ ├── ds_public.go │ ├── dsalert_types.go │ ├── dsapi_types.go │ ├── dsmaster_types.go │ ├── dsmaster_webhook.go │ ├── dsworker_types.go │ ├── groupversion_info.go │ ├── webhook_suite_test.go │ └── zz_generated.deepcopy.go ├── config ├── certmanager │ ├── certificate.yaml │ ├── kustomization.yaml │ └── kustomizeconfig.yaml ├── crd │ ├── bases │ │ ├── ds.apache.dolphinscheduler.dev_dsalerts.yaml │ │ ├── ds.apache.dolphinscheduler.dev_dsapis.yaml │ │ ├── ds.apache.dolphinscheduler.dev_dsmasters.yaml │ │ └── ds.apache.dolphinscheduler.dev_dsworkers.yaml │ ├── kustomization.yaml │ ├── kustomizeconfig.yaml │ └── patches │ │ ├── cainjection_in_dsalerts.yaml │ │ ├── cainjection_in_dsapis.yaml │ │ ├── cainjection_in_dsmasters.yaml │ │ ├── cainjection_in_dsworkers.yaml │ │ ├── webhook_in_dsalerts.yaml │ │ ├── webhook_in_dsapis.yaml │ │ ├── webhook_in_dsmasters.yaml │ │ └── webhook_in_dsworkers.yaml ├── default │ ├── kustomization.yaml │ ├── manager_auth_proxy_patch.yaml │ ├── manager_config_patch.yaml │ ├── manager_webhook_patch.yaml │ └── webhookcainjection_patch.yaml ├── ds │ ├── ds-pv.yaml │ ├── ds-pvc.yaml │ ├── postgreSQL │ │ ├── postgres-configmap.yaml │ │ ├── postgres-deployment.yaml │ │ ├── postgres-pv.yaml │ │ ├── postgres-pvc.yaml │ │ └── postgres-service.yaml │ └── zookeeper │ │ └── zookeeper.yaml ├── manager │ ├── controller_manager_config.yaml │ ├── kustomization.yaml │ └── manager.yaml ├── prometheus │ ├── kustomization.yaml │ └── monitor.yaml ├── rbac │ ├── auth_proxy_client_clusterrole.yaml │ ├── auth_proxy_role.yaml │ ├── auth_proxy_role_binding.yaml │ ├── auth_proxy_service.yaml │ ├── dsalert_editor_role.yaml │ ├── dsalert_viewer_role.yaml │ ├── dsapi_editor_role.yaml │ ├── dsapi_viewer_role.yaml │ ├── dsmaster_editor_role.yaml │ ├── dsmaster_viewer_role.yaml │ ├── dsworker_editor_role.yaml │ ├── dsworker_viewer_role.yaml │ ├── kustomization.yaml │ ├── leader_election_role.yaml │ ├── leader_election_role_binding.yaml │ ├── role.yaml │ ├── role_binding.yaml │ └── service_account.yaml ├── samples │ ├── ds_v1alpha1_dsalert.yaml │ ├── ds_v1alpha1_dsapi.yaml │ ├── ds_v1alpha1_dsmaster.yaml │ └── ds_v1alpha1_dsworker.yaml ├── test │ ├── busybox.yaml │ ├── ndsutils.yaml │ └── nginx.yaml └── webhook │ ├── kustomization.yaml │ ├── kustomizeconfig.yaml │ ├── manifests.yaml │ └── service.yaml ├── controllers ├── alert_reconcile.go ├── api_reconcile.go ├── deployment.go ├── dsalert_controller.go ├── dsapi_controller.go ├── dsmaster_controller.go ├── dsworker_controller.go ├── master_reconcile.go ├── member.go ├── pod.go ├── suite_test.go └── worker_reconcile.go ├── dist ├── LICENSE ├── LICENSE.tpl ├── licenses │ ├── license-cloud.google.com-go.txt │ ├── license-github.com-Azure-go-autorest-autorest-adal.txt │ ├── license-github.com-Azure-go-autorest-autorest-date.txt │ ├── license-github.com-Azure-go-autorest-autorest.txt │ ├── license-github.com-Azure-go-autorest-logger.txt │ ├── license-github.com-Azure-go-autorest-tracing.txt │ ├── license-github.com-Azure-go-autorest.txt │ ├── license-github.com-beorn7-perks.txt │ ├── license-github.com-cespare-xxhash-v2.txt │ ├── license-github.com-davecgh-go-spew.txt │ ├── license-github.com-evanphx-json-patch.txt │ ├── license-github.com-form3tech-oss-jwt-go.txt │ ├── license-github.com-fsnotify-fsnotify.txt │ ├── license-github.com-go-logr-logr.txt │ ├── license-github.com-go-logr-zapr.txt │ ├── license-github.com-gogo-protobuf.txt │ ├── license-github.com-golang-groupcache.txt │ ├── license-github.com-golang-protobuf.txt │ ├── license-github.com-google-go-cmp.txt │ ├── license-github.com-google-gofuzz.txt │ ├── license-github.com-google-uuid.txt │ ├── license-github.com-googleapis-gnostic.txt │ ├── license-github.com-imdario-mergo.txt │ ├── license-github.com-json-iterator-go.txt │ ├── license-github.com-matttproud-golang-protobuf-extensions.txt │ ├── license-github.com-modern-go-concurrent.txt │ ├── license-github.com-modern-go-reflect2.txt │ ├── license-github.com-nxadm-tail.txt │ ├── license-github.com-onsi-ginkgo.txt │ ├── license-github.com-onsi-gomega.txt │ ├── license-github.com-pkg-errors.txt │ ├── license-github.com-prometheus-client-golang.txt │ ├── license-github.com-prometheus-client-model.txt │ ├── license-github.com-prometheus-common.txt │ ├── license-github.com-prometheus-procfs.txt │ ├── license-github.com-spf13-pflag.txt │ ├── license-go.uber.org-atomic.txt │ ├── license-go.uber.org-multierr.txt │ ├── license-go.uber.org-zap.txt │ ├── license-golang.org-x-crypto.txt │ ├── license-golang.org-x-net.txt │ ├── license-golang.org-x-oauth2.txt │ ├── license-golang.org-x-sys.txt │ ├── license-golang.org-x-term.txt │ ├── license-golang.org-x-text.txt │ ├── license-golang.org-x-time.txt │ ├── license-gomodules.xyz-jsonpatch-v2.txt │ ├── license-google.golang.org-appengine.txt │ ├── license-google.golang.org-protobuf.txt │ ├── license-gopkg.in-inf.v0.txt │ ├── license-gopkg.in-tomb.v1.txt │ ├── license-gopkg.in-yaml.v2.txt │ ├── license-gopkg.in-yaml.v3.txt │ ├── license-k8s.io-api.txt │ ├── license-k8s.io-apiextensions-apiserver.txt │ ├── license-k8s.io-apimachinery.txt │ ├── license-k8s.io-client-go.txt │ ├── license-k8s.io-component-base.txt │ ├── license-k8s.io-klog-v2.txt │ ├── license-k8s.io-kube-openapi.txt │ ├── license-k8s.io-utils.txt │ ├── license-sigs.k8s.io-controller-runtime.txt │ ├── license-sigs.k8s.io-json.txt │ ├── license-sigs.k8s.io-structured-merge-diff-v4.txt │ └── license-sigs.k8s.io-yaml.txt └── release-operator.yaml ├── go.mod ├── go.sum ├── hack └── boilerplate.go.txt └── main.go /.asf.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | github: 19 | description: Apache DolphinScheduler Kubernetes Operator. 20 | homepage: https://dolphinscheduler.apache.org/ 21 | labels: 22 | - airflow 23 | - schedule 24 | - job-scheduler 25 | - oozie 26 | - task-scheduler 27 | - azkaban 28 | - distributed-schedule-system 29 | - workflow-scheduling-system 30 | - etl-dependency 31 | - workflow-platform 32 | - cronjob-schedule 33 | - job-schedule 34 | - task-schedule 35 | - workflow-schedule 36 | - data-schedule 37 | enabled_merge_buttons: 38 | squash: true 39 | merge: false 40 | rebase: false 41 | protected_branches: 42 | master: 43 | required_status_checks: 44 | strict: true 45 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file 19 | # Ignore build and test binaries. 20 | bin/ 21 | testbin/ 22 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: CI 19 | 20 | on: 21 | pull_request: 22 | 23 | concurrency: 24 | group: dolphinscheduler-operator-${{ github.event.pull_request.number || github.ref }} 25 | cancel-in-progress: true 26 | 27 | jobs: 28 | license-header: 29 | if: github.repository == 'apache/dolphinscheduler-operator' 30 | name: License header 31 | runs-on: ubuntu-latest 32 | timeout-minutes: 10 33 | steps: 34 | - uses: actions/checkout@v3 35 | with: 36 | submodules: true 37 | - name: Check license header 38 | uses: apache/skywalking-eyes/header@211d1623e027fb5779254fbd93871c00ec069a2b 39 | -------------------------------------------------------------------------------- /.github/workflows/publish-docker.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | name: publish-docker 18 | 19 | on: 20 | push: 21 | branches: 22 | - master 23 | 24 | env: 25 | HUB: ghcr.io/apache/dolphinscheduler-operator 26 | 27 | jobs: 28 | build: 29 | if: github.repository == 'apache/dolphinscheduler-operator' 30 | runs-on: ubuntu-latest 31 | permissions: 32 | contents: read 33 | packages: write 34 | timeout-minutes: 30 35 | env: 36 | TAG: ${{ github.sha }} 37 | steps: 38 | - uses: actions/checkout@v3 39 | with: 40 | submodules: true 41 | - name: Cache local Maven repository 42 | uses: actions/cache@v2 43 | with: 44 | path: ~/.m2/repository 45 | key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} 46 | restore-keys: | 47 | ${{ runner.os }}-maven- 48 | - name: Log in to the Container registry 49 | uses: docker/login-action@v1.10.0 50 | with: 51 | registry: ${{ env.HUB }} 52 | username: ${{ github.actor }} 53 | password: ${{ secrets.GITHUB_TOKEN }} 54 | - name: Build and push docker images 55 | env: 56 | IMG: ${{ env.HUB }}/controller:${{ env.TAG }} 57 | run: make docker-build docker-push 58 | - name: Tag with latest 59 | env: 60 | IMG: $HUB/controller:latest 61 | run: | 62 | docker tag $HUB/controller:$TAG $HUB/controller:latest 63 | make docker-push IMG=$HUB/controller:latest 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Binaries for programs and plugins 19 | *.exe 20 | *.exe~ 21 | *.dll 22 | *.so 23 | *.dylib 24 | bin 25 | testbin/* 26 | 27 | # Test binary, build with `go test -c` 28 | *.test 29 | 30 | # Output of the go coverage tool, specifically when used with LiteIDE 31 | *.out 32 | 33 | # Kubernetes Generated files - skip generated files, except for vendored files 34 | 35 | !vendor/**/zz_generated.* 36 | 37 | # editor and IDE paraphernalia 38 | .idea 39 | *.swp 40 | *.swo 41 | *~ 42 | ### Go template 43 | # Binaries for programs and plugins 44 | *.exe 45 | *.exe~ 46 | *.dll 47 | *.so 48 | *.dylib 49 | 50 | # Test binary, built with `go test -c` 51 | *.test 52 | 53 | # Output of the go coverage tool, specifically when used with LiteIDE 54 | *.out 55 | 56 | # Dependency directories (remove the comment below to include it) 57 | # vendor/ 58 | 59 | /vendor/ 60 | /dolphinscheduler-operator.iml 61 | /config/test/ 62 | 63 | release 64 | -------------------------------------------------------------------------------- /.licenserc.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | header: 20 | license: 21 | spdx-id: Apache-2.0 22 | copyright-owner: Apache Software Foundation 23 | 24 | paths-ignore: 25 | - go.sum 26 | - go.mod 27 | - '**/*.json' 28 | - dist/LICENSE.tpl 29 | - dist/LICENSE 30 | - LICENSE 31 | - NOTICE 32 | 33 | comment: on-failure 34 | 35 | dependency: 36 | files: 37 | - go.mod 38 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Build the manager binary 19 | FROM golang:1.17 as builder 20 | 21 | WORKDIR /workspace 22 | # Copy the Go Modules manifests 23 | COPY go.mod go.mod 24 | COPY go.sum go.sum 25 | # cache deps before building and copying source so that we don't need to re-download as much 26 | # and so that source changes don't invalidate our downloaded layer 27 | RUN go mod download 28 | 29 | # Copy the go source 30 | COPY main.go main.go 31 | COPY api/ api/ 32 | COPY controllers/ controllers/ 33 | 34 | # Build 35 | RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go 36 | 37 | # Use distroless as minimal base image to package the manager binary 38 | # Refer to https://github.com/GoogleContainerTools/distroless for more details 39 | FROM gcr.io/distroless/static:nonroot 40 | WORKDIR / 41 | COPY --from=builder /workspace/manager . 42 | USER 65532:65532 43 | 44 | ENTRYPOINT ["/manager"] 45 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache DolphinScheduler 2 | Copyright 2019-2022 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /PROJECT: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | domain: apache.dolphinscheduler.dev 20 | layout: 21 | - go.kubebuilder.io/v3 22 | projectName: dolphinscheduler-operator 23 | repo: dolphinscheduler-operator 24 | resources: 25 | - api: 26 | crdVersion: v1 27 | namespaced: true 28 | controller: true 29 | domain: apache.dolphinscheduler.dev 30 | group: ds 31 | kind: DSMaster 32 | path: dolphinscheduler-operator/api/v1alpha1 33 | version: v1alpha1 34 | webhooks: 35 | defaulting: true 36 | validation: true 37 | webhookVersion: v1 38 | - api: 39 | crdVersion: v1 40 | namespaced: true 41 | controller: true 42 | domain: apache.dolphinscheduler.dev 43 | group: ds 44 | kind: DSWorker 45 | path: dolphinscheduler-operator/api/v1alpha1 46 | version: v1alpha1 47 | - api: 48 | crdVersion: v1 49 | namespaced: true 50 | controller: true 51 | domain: apache.dolphinscheduler.dev 52 | group: ds 53 | kind: DSAlert 54 | path: dolphinscheduler-operator/api/v1alpha1 55 | version: v1alpha1 56 | - api: 57 | crdVersion: v1 58 | namespaced: true 59 | controller: true 60 | domain: apache.dolphinscheduler.dev 61 | group: ds 62 | kind: DSApi 63 | path: dolphinscheduler-operator/api/v1alpha1 64 | version: v1alpha1 65 | version: "3" 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # dolphinscheduler-operator 21 | 22 | ## Features 23 | 24 | - Deploy and manage the master, worker, alert, api components. 25 | - Scale the Pod numbers with one commond. 26 | - Update the component's version (not include the database schema). 27 | 28 | ## Project Status 29 | 30 | Project status: `alpha1` 31 | 32 | Current API version: `v1alpha1` 33 | 34 | ## Get Started 35 | 36 | - Create a namespace `ds` 37 | 38 | ```shell 39 | kubectl create namespace ds 40 | ``` 41 | 42 | - Install PostgreSQL database (Optional) 43 | 44 | If you don't have a running database, you can run 45 | ```shell 46 | kubectl apply -f config/ds/postgreSQL 47 | ``` 48 | 49 | to create a demo database, note that this is only for demonstration, DO NOT use it in production environment. 50 | You need to replace the `hostPath.path` in `postgres-pv.yaml` if you don't have a directory `/var/lib/data`. 51 | 52 | Connect to PostgreSQL and initialize the database schema by executing 53 | [`dolphinscheduler/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql`](https://github.com/apache/dolphinscheduler/blob/dev/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql). 54 | 55 | - Install zookeeper (Optional) 56 | 57 | If you don't have a running zookeeper, the demo doployment file is in `config/ds/zookeeper`, 58 | 59 | ```shell 60 | kubectl apply -f config/ds/zookeeper 61 | ``` 62 | 63 | 64 | - Create pv and pvc (Optional) 65 | 66 | If you have pv and pvc, you can config it in `config/sameples`. 67 | 68 | Or you can create it with `config/ds/ds-pv.yaml` and `config/ds/ds-pvc.yaml`. 69 | Notice to replace the `hostPath.path` in `ds-pv.yaml`. 70 | 71 | And you can mount the lib in dolphinscheduler `/opt/soft` in config/samples/ds_v1alpha1_dsworker.yaml with paramter named lib_pvc_name 72 | 73 | Mount the logs in `/opt/dolphinscheduler/logs` with the pvcname named `log_pvc_name`. 74 | 75 | 76 | ## query the status of worker 77 | 78 | ```shell 79 | kubectl get dsworkers.ds.apache.dolphinscheduler.dev -n ds 80 | ``` 81 | 82 | 83 | ## api explain 84 | 85 | ```shell 86 | kubectl explain dsmaster 87 | ``` 88 | 89 | ## how to test 90 | 91 | * Replace the database config and zookeeper config paramters in [`config/samples/`](./config/samples/). 92 | 93 | * Replace the nodeport in [`config/samples/ds_v1alpha1_api.yaml`](./config/samples/ds_v1alpha1_dsapi.yaml) 94 | 95 | * Install CRDs and controller 96 | 97 | 98 | ## how to deploy 99 | 100 | ```shell 101 | export IMG=ghcr.io/apache/dolphinscheduler-operator:latest 102 | make build && make manifests && make install && make deploy 103 | ``` 104 | 105 | * Deploy the sample 106 | 107 | ```shell 108 | cd config/samples 109 | kubectl apply -f ds_v1alpha1_dsalert.yaml 110 | kubectl apply -f ds_v1alpha1_dsapi.yaml -f ds_v1alpha1_dsmaster.yaml -f ds_v1alpha1_dsworker.yaml 111 | ``` 112 | -------------------------------------------------------------------------------- /api/v1alpha1/dsalert_types.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package v1alpha1 19 | 20 | import ( 21 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 22 | ) 23 | 24 | // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! 25 | // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. 26 | 27 | // DSAlertSpec defines the desired state of DSAlert 28 | type DSAlertSpec struct { 29 | Datasource *DateSourceTemplate `json:"datasource"` 30 | // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster 31 | // Important: Run "make" to regenerate code after modifying this file 32 | 33 | // Version is the expected version of the ds cluster. 34 | // The ds-operator will eventually make the ds cluster version 35 | // equal to the expected version. 36 | // If version is not set, default is "3.0.0-alpha". 37 | // +kubebuilder:default="3.0.0-alpha" 38 | Version string `json:"version,omitempty"` 39 | 40 | // Repository is the name of the repository that hosts 41 | // ds container images. It should be direct clone of the repository in official 42 | // By default, it is `apache/dolphinscheduler-master`. 43 | // +kubebuilder:default=apache/dolphinscheduler-master 44 | Repository string `json:"repository,omitempty"` 45 | 46 | // Replicas is the expected size of the ms-master. 47 | // The ds-master-operator will eventually make the size of the running 48 | // equal to the expected size. 49 | // The vaild range of the size is from 1 to 7. 50 | // +kubebuilder:default=3 51 | // +kubebuilder:validation:Minimum=1 52 | // +kubebuilder:validation:Maximum=7 53 | Replicas int32 `json:"replicas"` 54 | 55 | // Pod defines the policy to create pod for the dm-master pod. 56 | // Updating Pod does not take effect on any existing dm-master pods. 57 | Deployment *DeploymentPolicy `json:"deployment,omitempty"` 58 | 59 | // Paused is to pause the control of the operator for the ds-master . 60 | // +kubebuilder:default=false 61 | Paused bool `json:"paused,omitempty"` 62 | 63 | //LogPvcName defines the log capacity of application ,the position is /opt/dolphinscheduler/logs eg 20Gi 64 | LogPvcName string `json:"log_pvc_name,omitempty"` 65 | } 66 | 67 | // DSAlertStatus defines the observed state of DSAlert 68 | type DSAlertStatus struct { 69 | // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster 70 | // Important: Run "make" to regenerate code after modifying this file 71 | // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster 72 | // Important: Run "make" to regenerate code after modifying this file 73 | // Phase is the cluster running phase 74 | // +kubebuilder:validation:Enum="";Creating;Running;Failed;Finished 75 | Phase DsPhase `json:"phase,omitempty"` 76 | // ControlPaused indicates the operator pauses the control of the cluster. 77 | // +kubebuilder:default=false 78 | ControlPaused bool `json:"controlPaused,omitempty"` 79 | 80 | // Condition keeps track of all cluster conditions, if they exist. 81 | Conditions []DsCondition `json:"conditions,omitempty"` 82 | 83 | // Replicas is the current size of the cluster 84 | // +kubebuilder:default=0 85 | Replicas int `json:"replicas,omitempty"` 86 | } 87 | 88 | //+kubebuilder:object:root=true 89 | //+kubebuilder:subresource:status 90 | 91 | // DSAlert is the Schema for the dsalerts API 92 | type DSAlert struct { 93 | metav1.TypeMeta `json:",inline"` 94 | metav1.ObjectMeta `json:"metadata,omitempty"` 95 | 96 | Spec DSAlertSpec `json:"spec,omitempty"` 97 | Status DSAlertStatus `json:"status,omitempty"` 98 | } 99 | 100 | //+kubebuilder:object:root=true 101 | 102 | // DSAlertList contains a list of DSAlert 103 | type DSAlertList struct { 104 | metav1.TypeMeta `json:",inline"` 105 | metav1.ListMeta `json:"metadata,omitempty"` 106 | Items []DSAlert `json:"items"` 107 | } 108 | 109 | func init() { 110 | SchemeBuilder.Register(&DSAlert{}, &DSAlertList{}) 111 | } 112 | -------------------------------------------------------------------------------- /api/v1alpha1/dsapi_types.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package v1alpha1 19 | 20 | import ( 21 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 22 | ) 23 | 24 | // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! 25 | // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. 26 | 27 | // DSApiSpec defines the desired state of DSApi 28 | type DSApiSpec struct { 29 | Datasource *DateSourceTemplate `json:"datasource"` 30 | // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster 31 | // Important: Run "make" to regenerate code after modifying this file 32 | 33 | // Version is the expected version of the ds cluster. 34 | // The ds-operator will eventually make the ds cluster version 35 | // equal to the expected version. 36 | // If version is not set, default is "3.0.0-alpha". 37 | // +kubebuilder:default="3.0.0-alpha" 38 | Version string `json:"version,omitempty"` 39 | 40 | ZookeeperConnect string `json:"zookeeper_connect,omitempty"` 41 | 42 | // Repository is the name of the repository that hosts 43 | // ds container images. It should be direct clone of the repository in official 44 | // By default, it is `apache/dolphinscheduler-master`. 45 | // +kubebuilder:default=apache/dolphinscheduler-master 46 | Repository string `json:"repository,omitempty"` 47 | 48 | // Replicas is the expected size of the ms-master. 49 | // The ds-master-operator will eventually make the size of the running 50 | // equal to the expected size. 51 | // The vaild range of the size is from 1 to 7. 52 | // +kubebuilder:default=3 53 | // +kubebuilder:validation:Minimum=1 54 | // +kubebuilder:validation:Maximum=7 55 | Replicas int32 `json:"replicas"` 56 | 57 | // Pod defines the policy to create pod for the dm-master pod. 58 | // Pod defines the policy to create pod for the dm-master pod. 59 | Deployment *DeploymentPolicy `json:"deployment,omitempty"` 60 | 61 | // Paused is to pause the control of the operator for the ds-master . 62 | // +kubebuilder:default=false 63 | Paused bool `json:"paused,omitempty"` 64 | 65 | //LogPvcName defines the log capacity of application ,the position is /opt/dolphinscheduler/logs eg 20Gi 66 | LogPvcName string `json:"log_pvc_name,omitempty"` 67 | 68 | //NodePort is the port node exposed if no nodePort it will be lb type 69 | NodePort int32 `json:"node_port,omitempty"` 70 | } 71 | 72 | // DSApiStatus defines the observed state of DSApi 73 | type DSApiStatus struct { 74 | // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster 75 | // Important: Run "make" to regenerate code after modifying this file 76 | // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster 77 | // Important: Run "make" to regenerate code after modifying this file 78 | // Phase is the cluster running phase 79 | // +kubebuilder:validation:Enum="";Creating;Running;Failed;Finished 80 | Phase DsPhase `json:"phase,omitempty"` 81 | 82 | // ControlPaused indicates the operator pauses the control of the cluster. 83 | // +kubebuilder:default=false 84 | ControlPaused bool `json:"controlPaused,omitempty"` 85 | 86 | // Condition keeps track of all cluster conditions, if they exist. 87 | Conditions []DsCondition `json:"conditions,omitempty"` 88 | 89 | // Replicas is the current size of the cluster 90 | // +kubebuilder:default=0 91 | Replicas int `json:"replicas,omitempty"` 92 | } 93 | 94 | //+kubebuilder:object:root=true 95 | //+kubebuilder:subresource:status 96 | 97 | // DSApi is the Schema for the dsapis API 98 | type DSApi struct { 99 | metav1.TypeMeta `json:",inline"` 100 | metav1.ObjectMeta `json:"metadata,omitempty"` 101 | 102 | Spec DSApiSpec `json:"spec,omitempty"` 103 | Status DSApiStatus `json:"status,omitempty"` 104 | } 105 | 106 | //+kubebuilder:object:root=true 107 | 108 | // DSApiList contains a list of DSApi 109 | type DSApiList struct { 110 | metav1.TypeMeta `json:",inline"` 111 | metav1.ListMeta `json:"metadata,omitempty"` 112 | Items []DSApi `json:"items"` 113 | } 114 | 115 | func init() { 116 | SchemeBuilder.Register(&DSApi{}, &DSApiList{}) 117 | } 118 | -------------------------------------------------------------------------------- /api/v1alpha1/dsmaster_types.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package v1alpha1 19 | 20 | import ( 21 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 22 | ) 23 | 24 | // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! 25 | // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. 26 | 27 | // DSMasterSpec defines the desired state of DSMaster 28 | type DSMasterSpec struct { 29 | Datasource *DateSourceTemplate `json:"datasource"` 30 | // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster 31 | // Important: Run "make" to regenerate code after modifying this file 32 | 33 | // Version is the expected version of the ds cluster. 34 | // The ds-operator will eventually make the ds cluster version 35 | // equal to the expected version. 36 | // If version is not set, default is "3.0.0-alpha". 37 | // +kubebuilder:default="3.0.0-alpha" 38 | Version string `json:"version,omitempty"` 39 | 40 | // Repository is the name of the repository that hosts 41 | // ds container images. It should be direct clone of the repository in official 42 | // By default, it is `apache/dolphinscheduler-master`. 43 | // +kubebuilder:default=apache/dolphinscheduler-master 44 | Repository string `json:"repository,omitempty"` 45 | 46 | // Replicas is the expected size of the ms-master. 47 | // The ds-master-operator will eventually make the size of the running 48 | // equal to the expected size. 49 | // The vaild range of the size is from 1 to 7. 50 | // +kubebuilder:default=3 51 | // +kubebuilder:validation:Minimum=1 52 | // +kubebuilder:validation:Maximum=7 53 | Replicas int `json:"replicas"` 54 | 55 | //ZookeeperConnect is the address string of zookeeper ,and it will be written to ENV 56 | ZookeeperConnect string `json:"zookeeper_connect,omitempty"` 57 | 58 | // Pod defines the policy to create pod for the dm-master pod. 59 | // Updating Pod does not take effect on any existing dm-master pods. 60 | Pod *PodPolicy `json:"pod,omitempty"` 61 | 62 | HpaPolicy *HpaPolicy `json:"hpa,omitempty"` 63 | 64 | // Paused is to pause the control of the operator for the ds-master . 65 | // +kubebuilder:default=false 66 | Paused bool `json:"paused,omitempty"` 67 | 68 | //LogPvcName defines the log capacity of application ,the position is /opt/dolphinscheduler/logs eg 20Gi 69 | LogPvcName string `json:"log_pvc_name,omitempty"` 70 | } 71 | 72 | // DSMasterStatus defines the observed state of DSMaster 73 | type DSMasterStatus struct { 74 | // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster 75 | // Important: Run "make" to regenerate code after modifying this file 76 | // Phase is the cluster running phase 77 | // +kubebuilder:validation:Enum="";Creating;Running;Failed;Finished 78 | Phase DsPhase `json:"phase,omitempty"` 79 | // ControlPaused indicates the operator pauses the control of the cluster. 80 | // +kubebuilder:default=false 81 | ControlPaused bool `json:"controlPaused,omitempty"` 82 | 83 | // Condition keeps track of all cluster conditions, if they exist. 84 | Conditions []DsCondition `json:"conditions,omitempty"` 85 | 86 | // Replicas is the current size of the cluster 87 | // +kubebuilder:default=0 88 | Replicas int `json:"replicas,omitempty"` 89 | 90 | // Members are the dsMaster members in the cluster 91 | Members MembersStatus `json:"members,omitempty"` 92 | } 93 | 94 | //+kubebuilder:object:root=true 95 | //+kubebuilder:subresource:status 96 | // DSMaster is the Schema for the dsmasters API 97 | type DSMaster struct { 98 | metav1.TypeMeta `json:",inline"` 99 | metav1.ObjectMeta `json:"metadata,omitempty"` 100 | 101 | Spec DSMasterSpec `json:"spec,omitempty"` 102 | Status DSMasterStatus `json:"status,omitempty"` 103 | } 104 | 105 | //+kubebuilder:object:root=true 106 | 107 | // DSMasterList contains a list of DSMaster 108 | type DSMasterList struct { 109 | metav1.TypeMeta `json:",inline"` 110 | metav1.ListMeta `json:"metadata,omitempty"` 111 | Items []DSMaster `json:"items"` 112 | } 113 | 114 | func init() { 115 | SchemeBuilder.Register(&DSMaster{}, &DSMasterList{}) 116 | } 117 | -------------------------------------------------------------------------------- /api/v1alpha1/dsmaster_webhook.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package v1alpha1 19 | 20 | import ( 21 | apierrors "k8s.io/apimachinery/pkg/api/errors" 22 | "k8s.io/apimachinery/pkg/runtime" 23 | "k8s.io/apimachinery/pkg/runtime/schema" 24 | "k8s.io/apimachinery/pkg/util/validation/field" 25 | ctrl "sigs.k8s.io/controller-runtime" 26 | logf "sigs.k8s.io/controller-runtime/pkg/log" 27 | "sigs.k8s.io/controller-runtime/pkg/webhook" 28 | ) 29 | 30 | // log is for logging in this package. 31 | var dsmasterlog = logf.Log.WithName("dsmaster-resource") 32 | 33 | func (r *DSMaster) SetupWebhookWithManager(mgr ctrl.Manager) error { 34 | return ctrl.NewWebhookManagedBy(mgr). 35 | For(r). 36 | Complete() 37 | } 38 | 39 | // TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! 40 | 41 | //+kubebuilder:webhook:path=/mutate-ds-apache-dolphinscheduler-dev-v1alpha1-dsmaster,mutating=true,failurePolicy=fail,sideEffects=None,groups=ds.apache.dolphinscheduler.dev,resources=dsmasters,verbs=create;update,versions=v1alpha1,name=mdsmaster.kb.io,admissionReviewVersions=v1 42 | 43 | var _ webhook.Defaulter = &DSMaster{} 44 | 45 | // Default implements webhook.Defaulter so a webhook will be registered for the type 46 | func (r *DSMaster) Default() { 47 | 48 | if r.Spec.HpaPolicy != nil { 49 | if &r.Spec.HpaPolicy.MinReplicas == nil { 50 | r.Spec.HpaPolicy.MinReplicas = int32(1) 51 | } 52 | 53 | if &r.Spec.HpaPolicy.MaxReplicas == nil { 54 | r.Spec.HpaPolicy.MinReplicas = int32(5) 55 | } 56 | } 57 | 58 | } 59 | 60 | // TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation. 61 | //+kubebuilder:webhook:path=/validate-ds-apache-dolphinscheduler-dev-v1alpha1-dsmaster,mutating=false,failurePolicy=fail,sideEffects=None,groups=ds.apache.dolphinscheduler.dev,resources=dsmasters,verbs=create;update,versions=v1alpha1,name=vdsmaster.kb.io,admissionReviewVersions=v1 62 | 63 | var _ webhook.Validator = &DSMaster{} 64 | 65 | // ValidateCreate implements webhook.Validator so a webhook will be registered for the type 66 | func (r *DSMaster) ValidateCreate() error { 67 | var allErrs field.ErrorList 68 | 69 | if r.Spec.HpaPolicy != nil { 70 | if &r.Spec.HpaPolicy.MinReplicas != nil && &r.Spec.HpaPolicy.MaxReplicas != nil && r.Spec.HpaPolicy.MinReplicas > r.Spec.HpaPolicy.MaxReplicas { 71 | return apierrors.NewInvalid( 72 | schema.GroupKind{Group: "ds", Kind: "DSMaster"}, 73 | r.Name, 74 | allErrs) 75 | } 76 | 77 | } else { 78 | dsmasterlog.Info("Hpa `s replicas is valid") 79 | return nil 80 | } 81 | return nil 82 | } 83 | 84 | // ValidateUpdate implements webhook.Validator so a webhook will be registered for the type 85 | func (r *DSMaster) ValidateUpdate(old runtime.Object) error { 86 | dsmasterlog.Info("validate update", "name", r.Name) 87 | 88 | // TODO(user): fill in your validation logic upon object update. 89 | return nil 90 | } 91 | 92 | // ValidateDelete implements webhook.Validator so a webhook will be registered for the type 93 | func (r *DSMaster) ValidateDelete() error { 94 | dsmasterlog.Info("validate delete", "name", r.Name) 95 | 96 | // TODO(user): fill in your validation logic upon object deletion. 97 | return nil 98 | } 99 | -------------------------------------------------------------------------------- /api/v1alpha1/dsworker_types.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package v1alpha1 19 | 20 | import ( 21 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 22 | ) 23 | 24 | // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! 25 | // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. 26 | 27 | // DSWorkerSpec defines the desired state of DSWorker 28 | type DSWorkerSpec struct { 29 | //Datasource is the config of database 30 | Datasource *DateSourceTemplate `json:"datasource"` 31 | // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster 32 | // Important: Run "make" to regenerate code after modifying this file 33 | 34 | // Version is the expected version of the ds cluster. 35 | // The ds-operator will eventually make the ds cluster version 36 | // equal to the expected version. 37 | // If version is not set, default is "3.0.0-alpha". 38 | // +kubebuilder:default="3.0.0-alpha" 39 | Version string `json:"version,omitempty"` 40 | 41 | // Repository is the name of the repository that hosts 42 | // ds container images. It should be direct clone of the repository in official 43 | // By default, it is `apache/dolphinscheduler-worker`. 44 | // +kubebuilder:default=apache/dolphinscheduler-worker 45 | Repository string `json:"repository,omitempty"` 46 | 47 | // Replicas is the expected size of the ms-worker. 48 | // The ds-worker-operator will eventually make the size of the running 49 | // equal to the expected size. 50 | // The vaild range of the size is from 1 to 7. 51 | // +kubebuilder:default=3 52 | // +kubebuilder:validation:Minimum=1 53 | // +kubebuilder:validation:Maximum=7 54 | Replicas int `json:"replicas"` 55 | 56 | //ZookeeperConnect is the address string of zookeeper ,and it will be written to ENV 57 | ZookeeperConnect string `json:"zookeeper_connect,omitempty"` 58 | 59 | // Pod defines the policy to create pod for the dm-worker pod. 60 | // Updating Pod does not take effect on any existing dm-worker pods. 61 | Pod *PodPolicy `json:"pod,omitempty"` 62 | 63 | // Paused is to pause the control of the operator for the ds-worker . 64 | // +kubebuilder:default=false 65 | Paused bool `json:"paused,omitempty"` 66 | 67 | //LogPvcName defines the address of log pvc ,the position is /opt/dolphinscheduler/logs 68 | LogPvcName string `json:"log_pvc_name,omitempty"` 69 | 70 | //LibPvcName define the address of lib pvc,the position is /opt/soft 71 | LibPvcName string `json:"lib_pvc_name,omitempty"` 72 | } 73 | 74 | // DSWorkerStatus defines the observed state of DSWorker 75 | type DSWorkerStatus struct { 76 | // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster 77 | // Important: Run "make" to regenerate code after modifying this file 78 | // Phase is the cluster running phase 79 | // +kubebuilder:validation:Enum="";Creating;Running;Failed;Finished 80 | Phase DsPhase `json:"phase,omitempty"` 81 | // ControlPaused indicates the operator pauses the control of the cluster. 82 | // +kubebuilder:default=false 83 | ControlPaused bool `json:"controlPaused,omitempty"` 84 | 85 | // Condition keeps track of all cluster conditions, if they exist. 86 | Conditions []DsCondition `json:"conditions,omitempty"` 87 | 88 | // Replicas is the current size of the cluster 89 | // +kubebuilder:default=0 90 | Replicas int `json:"replicas,omitempty"` 91 | 92 | // Members are the dsWorker members in the cluster 93 | Members MembersStatus `json:"members,omitempty"` 94 | 95 | // Selector must be the string form of the selector 96 | Selector string `json:"selector"` 97 | } 98 | 99 | //+kubebuilder:object:root=true 100 | //+kubebuilder:printcolumn:name="replicas",type="integer",JSONPath=".spec.replicas" 101 | //+kubebuilder:printcolumn:name="repository",type="string",JSONPath=".spec.repository" 102 | //+kubebuilder:printcolumn:name="version",type="string",JSONPath=".spec.version" 103 | //+kubebuilder:printcolumn:name="controlPaused",type="boolean",JSONPath=".spec.controlPaused" 104 | //+kubebuilder:subresource:status 105 | //+kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector 106 | type DSWorker struct { 107 | metav1.TypeMeta `json:",inline"` 108 | metav1.ObjectMeta `json:"metadata,omitempty"` 109 | 110 | Spec DSWorkerSpec `json:"spec,omitempty"` 111 | Status DSWorkerStatus `json:"status,omitempty"` 112 | } 113 | 114 | //+kubebuilder:object:root=true 115 | // DSWorkerList contains a list of DSWorker 116 | type DSWorkerList struct { 117 | metav1.TypeMeta `json:",inline"` 118 | metav1.ListMeta `json:"metadata,omitempty"` 119 | Items []DSWorker `json:"items"` 120 | } 121 | 122 | func init() { 123 | SchemeBuilder.Register(&DSWorker{}, &DSWorkerList{}) 124 | } 125 | -------------------------------------------------------------------------------- /api/v1alpha1/groupversion_info.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // Package v1alpha1 contains API Schema definitions for the ds v1alpha1 API group 19 | //+kubebuilder:object:generate=true 20 | //+groupName=ds.apache.dolphinscheduler.dev 21 | package v1alpha1 22 | 23 | import ( 24 | "k8s.io/apimachinery/pkg/runtime/schema" 25 | "sigs.k8s.io/controller-runtime/pkg/scheme" 26 | ) 27 | 28 | var ( 29 | // GroupVersion is group version used to register these objects 30 | GroupVersion = schema.GroupVersion{Group: "ds.apache.dolphinscheduler.dev", Version: "v1alpha1"} 31 | 32 | // SchemeBuilder is used to add go types to the GroupVersionKind scheme 33 | SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} 34 | 35 | // AddToScheme adds the types in this group-version to the given scheme. 36 | AddToScheme = SchemeBuilder.AddToScheme 37 | ) 38 | -------------------------------------------------------------------------------- /api/v1alpha1/webhook_suite_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package v1alpha1 19 | 20 | import ( 21 | "context" 22 | "crypto/tls" 23 | "fmt" 24 | "net" 25 | "path/filepath" 26 | "testing" 27 | "time" 28 | 29 | . "github.com/onsi/ginkgo" 30 | . "github.com/onsi/gomega" 31 | 32 | admissionv1beta1 "k8s.io/api/admission/v1beta1" 33 | //+kubebuilder:scaffold:imports 34 | "k8s.io/apimachinery/pkg/runtime" 35 | "k8s.io/client-go/rest" 36 | ctrl "sigs.k8s.io/controller-runtime" 37 | "sigs.k8s.io/controller-runtime/pkg/client" 38 | "sigs.k8s.io/controller-runtime/pkg/envtest" 39 | "sigs.k8s.io/controller-runtime/pkg/envtest/printer" 40 | logf "sigs.k8s.io/controller-runtime/pkg/log" 41 | "sigs.k8s.io/controller-runtime/pkg/log/zap" 42 | ) 43 | 44 | // These tests use Ginkgo (BDD-style Go testing framework). Refer to 45 | // http://onsi.github.io/ginkgo/ to learn more about Ginkgo. 46 | 47 | var cfg *rest.Config 48 | var k8sClient client.Client 49 | var testEnv *envtest.Environment 50 | var ctx context.Context 51 | var cancel context.CancelFunc 52 | 53 | func TestAPIs(t *testing.T) { 54 | RegisterFailHandler(Fail) 55 | 56 | RunSpecsWithDefaultAndCustomReporters(t, 57 | "Webhook Suite", 58 | []Reporter{printer.NewlineReporter{}}) 59 | } 60 | 61 | var _ = BeforeSuite(func() { 62 | logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) 63 | 64 | ctx, cancel = context.WithCancel(context.TODO()) 65 | 66 | By("bootstrapping test environment") 67 | testEnv = &envtest.Environment{ 68 | CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, 69 | ErrorIfCRDPathMissing: false, 70 | WebhookInstallOptions: envtest.WebhookInstallOptions{ 71 | Paths: []string{filepath.Join("..", "..", "config", "webhook")}, 72 | }, 73 | } 74 | 75 | cfg, err := testEnv.Start() 76 | Expect(err).NotTo(HaveOccurred()) 77 | Expect(cfg).NotTo(BeNil()) 78 | 79 | scheme := runtime.NewScheme() 80 | err = AddToScheme(scheme) 81 | Expect(err).NotTo(HaveOccurred()) 82 | 83 | err = admissionv1beta1.AddToScheme(scheme) 84 | Expect(err).NotTo(HaveOccurred()) 85 | 86 | //+kubebuilder:scaffold:scheme 87 | 88 | k8sClient, err = client.New(cfg, client.Options{Scheme: scheme}) 89 | Expect(err).NotTo(HaveOccurred()) 90 | Expect(k8sClient).NotTo(BeNil()) 91 | 92 | // start webhook server using Manager 93 | webhookInstallOptions := &testEnv.WebhookInstallOptions 94 | mgr, err := ctrl.NewManager(cfg, ctrl.Options{ 95 | Scheme: scheme, 96 | Host: webhookInstallOptions.LocalServingHost, 97 | Port: webhookInstallOptions.LocalServingPort, 98 | CertDir: webhookInstallOptions.LocalServingCertDir, 99 | LeaderElection: false, 100 | MetricsBindAddress: "0", 101 | }) 102 | Expect(err).NotTo(HaveOccurred()) 103 | 104 | err = (&DSMaster{}).SetupWebhookWithManager(mgr) 105 | Expect(err).NotTo(HaveOccurred()) 106 | 107 | //+kubebuilder:scaffold:webhook 108 | 109 | go func() { 110 | defer GinkgoRecover() 111 | err = mgr.Start(ctx) 112 | Expect(err).NotTo(HaveOccurred()) 113 | }() 114 | 115 | // wait for the webhook server to get ready 116 | dialer := &net.Dialer{Timeout: time.Second} 117 | addrPort := fmt.Sprintf("%s:%d", webhookInstallOptions.LocalServingHost, webhookInstallOptions.LocalServingPort) 118 | Eventually(func() error { 119 | conn, err := tls.DialWithDialer(dialer, "tcp", addrPort, &tls.Config{InsecureSkipVerify: true}) 120 | if err != nil { 121 | return err 122 | } 123 | conn.Close() 124 | return nil 125 | }).Should(Succeed()) 126 | 127 | }, 60) 128 | 129 | var _ = AfterSuite(func() { 130 | cancel() 131 | By("tearing down the test environment") 132 | err := testEnv.Stop() 133 | Expect(err).NotTo(HaveOccurred()) 134 | }) 135 | -------------------------------------------------------------------------------- /config/certmanager/certificate.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # The following manifests contain a self-signed issuer CR and a certificate CR. 19 | # More document can be found at https://docs.cert-manager.io 20 | # WARNING: Targets CertManager v1.0. Check https://cert-manager.io/docs/installation/upgrading/ for breaking changes. 21 | apiVersion: cert-manager.io/v1 22 | kind: Issuer 23 | metadata: 24 | name: selfsigned-issuer 25 | namespace: system 26 | spec: 27 | selfSigned: {} 28 | --- 29 | apiVersion: cert-manager.io/v1 30 | kind: Certificate 31 | metadata: 32 | name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml 33 | namespace: system 34 | spec: 35 | # $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize 36 | dnsNames: 37 | - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc 38 | - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local 39 | issuerRef: 40 | kind: Issuer 41 | name: selfsigned-issuer 42 | secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize 43 | -------------------------------------------------------------------------------- /config/certmanager/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | resources: 19 | - certificate.yaml 20 | 21 | configurations: 22 | - kustomizeconfig.yaml 23 | -------------------------------------------------------------------------------- /config/certmanager/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # This configuration is for teaching kustomize how to update name ref and var substitution 19 | nameReference: 20 | - kind: Issuer 21 | group: cert-manager.io 22 | fieldSpecs: 23 | - kind: Certificate 24 | group: cert-manager.io 25 | path: spec/issuerRef/name 26 | 27 | varReference: 28 | - kind: Certificate 29 | group: cert-manager.io 30 | path: spec/commonName 31 | - kind: Certificate 32 | group: cert-manager.io 33 | path: spec/dnsNames 34 | -------------------------------------------------------------------------------- /config/crd/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # This kustomization.yaml is not intended to be run by itself, 19 | # since it depends on service name and namespace that are out of this kustomize package. 20 | # It should be run by config/default 21 | resources: 22 | - bases/ds.apache.dolphinscheduler.dev_dsmasters.yaml 23 | - bases/ds.apache.dolphinscheduler.dev_dsworkers.yaml 24 | - bases/ds.apache.dolphinscheduler.dev_dsalerts.yaml 25 | - bases/ds.apache.dolphinscheduler.dev_dsapis.yaml 26 | #+kubebuilder:scaffold:crdkustomizeresource 27 | 28 | patchesStrategicMerge: 29 | # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. 30 | # patches here are for enabling the conversion webhook for each CRD 31 | - patches/webhook_in_dsmasters.yaml 32 | - patches/webhook_in_dsworkers.yaml 33 | - patches/webhook_in_dsalerts.yaml 34 | - patches/webhook_in_dsapis.yaml 35 | #+kubebuilder:scaffold:crdkustomizewebhookpatch 36 | 37 | # [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. 38 | # patches here are for enabling the CA injection for each CRD 39 | - patches/cainjection_in_dsmasters.yaml 40 | - patches/cainjection_in_dsworkers.yaml 41 | - patches/cainjection_in_dsalerts.yaml 42 | - patches/cainjection_in_dsapis.yaml 43 | #+kubebuilder:scaffold:crdkustomizecainjectionpatch 44 | 45 | # the following config is for teaching kustomize how to do kustomization for CRDs. 46 | configurations: 47 | - kustomizeconfig.yaml 48 | -------------------------------------------------------------------------------- /config/crd/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # This file is for teaching kustomize how to substitute name and namespace reference in CRD 19 | nameReference: 20 | - kind: Service 21 | version: v1 22 | fieldSpecs: 23 | - kind: CustomResourceDefinition 24 | version: v1 25 | group: apiextensions.k8s.io 26 | path: spec/conversion/webhook/clientConfig/service/name 27 | 28 | namespace: 29 | - kind: CustomResourceDefinition 30 | version: v1 31 | group: apiextensions.k8s.io 32 | path: spec/conversion/webhook/clientConfig/service/namespace 33 | create: false 34 | 35 | varReference: 36 | - path: metadata/annotations 37 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_dsalerts.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # The following patch adds a directive for certmanager to inject CA into the CRD 19 | apiVersion: apiextensions.k8s.io/v1 20 | kind: CustomResourceDefinition 21 | metadata: 22 | annotations: 23 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 24 | name: dsalerts.ds.apache.dolphinscheduler.dev 25 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_dsapis.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # The following patch adds a directive for certmanager to inject CA into the CRD 19 | apiVersion: apiextensions.k8s.io/v1 20 | kind: CustomResourceDefinition 21 | metadata: 22 | annotations: 23 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 24 | name: dsapis.ds.apache.dolphinscheduler.dev 25 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_dsmasters.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # The following patch adds a directive for certmanager to inject CA into the CRD 19 | apiVersion: apiextensions.k8s.io/v1 20 | kind: CustomResourceDefinition 21 | metadata: 22 | annotations: 23 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 24 | name: dsmasters.ds.apache.dolphinscheduler.dev 25 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_dsworkers.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # The following patch adds a directive for certmanager to inject CA into the CRD 19 | apiVersion: apiextensions.k8s.io/v1 20 | kind: CustomResourceDefinition 21 | metadata: 22 | annotations: 23 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 24 | name: dsworkers.ds.apache.dolphinscheduler.dev 25 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_dsalerts.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # The following patch enables a conversion webhook for the CRD 19 | apiVersion: apiextensions.k8s.io/v1 20 | kind: CustomResourceDefinition 21 | metadata: 22 | name: dsalerts.ds.apache.dolphinscheduler.dev 23 | spec: 24 | conversion: 25 | strategy: Webhook 26 | webhook: 27 | clientConfig: 28 | service: 29 | namespace: system 30 | name: webhook-service 31 | path: /convert 32 | conversionReviewVersions: 33 | - v1 34 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_dsapis.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # The following patch enables a conversion webhook for the CRD 19 | apiVersion: apiextensions.k8s.io/v1 20 | kind: CustomResourceDefinition 21 | metadata: 22 | name: dsapis.ds.apache.dolphinscheduler.dev 23 | spec: 24 | conversion: 25 | strategy: Webhook 26 | webhook: 27 | clientConfig: 28 | service: 29 | namespace: system 30 | name: webhook-service 31 | path: /convert 32 | conversionReviewVersions: 33 | - v1 34 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_dsmasters.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # The following patch enables a conversion webhook for the CRD 19 | apiVersion: apiextensions.k8s.io/v1 20 | kind: CustomResourceDefinition 21 | metadata: 22 | name: dsmasters.ds.apache.dolphinscheduler.dev 23 | spec: 24 | conversion: 25 | strategy: Webhook 26 | webhook: 27 | clientConfig: 28 | service: 29 | namespace: system 30 | name: webhook-service 31 | path: /convert 32 | conversionReviewVersions: 33 | - v1 34 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_dsworkers.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # The following patch enables a conversion webhook for the CRD 19 | apiVersion: apiextensions.k8s.io/v1 20 | kind: CustomResourceDefinition 21 | metadata: 22 | name: dsworkers.ds.apache.dolphinscheduler.dev 23 | spec: 24 | conversion: 25 | strategy: Webhook 26 | webhook: 27 | clientConfig: 28 | service: 29 | namespace: system 30 | name: webhook-service 31 | path: /convert 32 | conversionReviewVersions: 33 | - v1 34 | -------------------------------------------------------------------------------- /config/default/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Adds namespace to all resources. 19 | namespace: dolphinscheduler-operator-system 20 | 21 | # Value of this field is prepended to the 22 | # names of all resources, e.g. a deployment named 23 | # "wordpress" becomes "alices-wordpress". 24 | # Note that it should also match with the prefix (text before '-') of the namespace 25 | # field above. 26 | namePrefix: dolphinscheduler-operator- 27 | 28 | # Labels to add to all resources and selectors. 29 | #commonLabels: 30 | # someName: someValue 31 | 32 | bases: 33 | - ../crd 34 | - ../rbac 35 | - ../manager 36 | # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in 37 | # crd/kustomization.yaml 38 | - ../webhook 39 | # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. 40 | - ../certmanager 41 | # [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. 42 | #- ../prometheus 43 | 44 | patchesStrategicMerge: 45 | # Protect the /metrics endpoint by putting it behind auth. 46 | # If you want your controller-manager to expose the /metrics 47 | # endpoint w/o any /z, please comment the following line. 48 | - manager_auth_proxy_patch.yaml 49 | 50 | # Mount the controller config file for loading manager configurations 51 | # through a ComponentConfig type 52 | #- manager_config_patch.yaml 53 | 54 | # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in 55 | # crd/kustomization.yaml 56 | - manager_webhook_patch.yaml 57 | 58 | # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 59 | # Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. 60 | # 'CERTMANAGER' needs to be enabled to use ca injection 61 | - webhookcainjection_patch.yaml 62 | 63 | # the following config is for teaching kustomize how to do var substitution 64 | vars: 65 | # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. 66 | - name: CERTIFICATE_NAMESPACE # namespace of the certificate CR 67 | objref: 68 | kind: Certificate 69 | group: cert-manager.io 70 | version: v1 71 | name: serving-cert # this name should match the one in certificate.yaml 72 | fieldref: 73 | fieldpath: metadata.namespace 74 | - name: CERTIFICATE_NAME 75 | objref: 76 | kind: Certificate 77 | group: cert-manager.io 78 | version: v1 79 | name: serving-cert # this name should match the one in certificate.yaml 80 | - name: SERVICE_NAMESPACE # namespace of the service 81 | objref: 82 | kind: Service 83 | version: v1 84 | name: webhook-service 85 | fieldref: 86 | fieldpath: metadata.namespace 87 | - name: SERVICE_NAME 88 | objref: 89 | kind: Service 90 | version: v1 91 | name: webhook-service 92 | -------------------------------------------------------------------------------- /config/default/manager_auth_proxy_patch.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # This patch inject a sidecar container which is a HTTP proxy for the 19 | # controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews. 20 | apiVersion: apps/v1 21 | kind: Deployment 22 | metadata: 23 | name: controller-manager 24 | namespace: system 25 | spec: 26 | template: 27 | spec: 28 | containers: 29 | - name: kube-rbac-proxy 30 | image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0 31 | args: 32 | - "--secure-listen-address=0.0.0.0:8443" 33 | - "--upstream=http://127.0.0.1:8080/" 34 | - "--logtostderr=true" 35 | - "--v=0" 36 | ports: 37 | - containerPort: 8443 38 | protocol: TCP 39 | name: https 40 | resources: 41 | limits: 42 | cpu: 500m 43 | memory: 128Mi 44 | requests: 45 | cpu: 5m 46 | memory: 64Mi 47 | - name: manager 48 | args: 49 | - "--health-probe-bind-address=:8081" 50 | - "--metrics-bind-address=127.0.0.1:8080" 51 | - "--leader-elect" 52 | -------------------------------------------------------------------------------- /config/default/manager_config_patch.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: apps/v1 19 | kind: Deployment 20 | metadata: 21 | name: controller-manager 22 | namespace: system 23 | spec: 24 | template: 25 | spec: 26 | containers: 27 | - name: manager 28 | args: 29 | - "--config=controller_manager_config.yaml" 30 | volumeMounts: 31 | - name: manager-config 32 | mountPath: /controller_manager_config.yaml 33 | subPath: controller_manager_config.yaml 34 | volumes: 35 | - name: manager-config 36 | configMap: 37 | name: manager-config 38 | -------------------------------------------------------------------------------- /config/default/manager_webhook_patch.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: apps/v1 19 | kind: Deployment 20 | metadata: 21 | name: controller-manager 22 | namespace: system 23 | spec: 24 | template: 25 | spec: 26 | containers: 27 | - name: manager 28 | ports: 29 | - containerPort: 9443 30 | name: webhook-server 31 | protocol: TCP 32 | volumeMounts: 33 | - mountPath: /tmp/k8s-webhook-server/serving-certs 34 | name: cert 35 | readOnly: true 36 | volumes: 37 | - name: cert 38 | secret: 39 | defaultMode: 420 40 | secretName: webhook-server-cert 41 | -------------------------------------------------------------------------------- /config/default/webhookcainjection_patch.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # This patch add annotation to admission webhook config and 19 | # the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize. 20 | apiVersion: admissionregistration.k8s.io/v1 21 | kind: MutatingWebhookConfiguration 22 | metadata: 23 | name: mutating-webhook-configuration 24 | annotations: 25 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 26 | --- 27 | apiVersion: admissionregistration.k8s.io/v1 28 | kind: ValidatingWebhookConfiguration 29 | metadata: 30 | name: validating-webhook-configuration 31 | annotations: 32 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 33 | -------------------------------------------------------------------------------- /config/ds/ds-pv.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | kind: PersistentVolume 19 | apiVersion: v1 20 | metadata: 21 | name: ds-pv-volume 22 | labels: 23 | app: pv 24 | namespace: ds 25 | spec: 26 | storageClassName: standard 27 | capacity: 28 | storage: 4Gi 29 | accessModes: 30 | - ReadWriteMany 31 | hostPath: 32 | path: "/Volumes/ds/logs" 33 | -------------------------------------------------------------------------------- /config/ds/ds-pvc.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | kind: PersistentVolumeClaim 19 | apiVersion: v1 20 | metadata: 21 | name: ds-pv-claim 22 | labels: 23 | app: ds-pvc 24 | namespace: ds 25 | spec: 26 | storageClassName: standard 27 | accessModes: 28 | - ReadWriteMany 29 | resources: 30 | requests: 31 | storage: 100Mi 32 | selector: 33 | matchLabels: 34 | app: pv 35 | -------------------------------------------------------------------------------- /config/ds/postgreSQL/postgres-configmap.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: v1 19 | kind: ConfigMap 20 | metadata: 21 | name: postgres-config 22 | labels: 23 | app: postgres 24 | namespace: ds 25 | data: 26 | POSTGRES_DB: dolphinscheduler 27 | POSTGRES_USER: postgresadmin 28 | POSTGRES_PASSWORD: admin12345 -------------------------------------------------------------------------------- /config/ds/postgreSQL/postgres-deployment.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: apps/v1 19 | kind: Deployment 20 | metadata: 21 | name: postgres-deployment 22 | namespace: ds 23 | spec: 24 | strategy: 25 | type: Recreate 26 | selector: 27 | matchLabels: 28 | app: postgres 29 | replicas: 1 30 | template: 31 | metadata: 32 | labels: 33 | app: postgres 34 | spec: 35 | containers: 36 | - name: postgres 37 | image: postgres:13 38 | imagePullPolicy: "IfNotPresent" 39 | ports: 40 | - containerPort: 5432 41 | envFrom: 42 | - configMapRef: 43 | name: postgres-config 44 | volumeMounts: 45 | - mountPath: /var/lib/postgresql/data 46 | name: postgredb 47 | volumes: 48 | - name: postgredb 49 | persistentVolumeClaim: 50 | claimName: postgres-pv-claim 51 | -------------------------------------------------------------------------------- /config/ds/postgreSQL/postgres-pv.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | kind: PersistentVolume 19 | apiVersion: v1 20 | metadata: 21 | name: postgres-pv-volume 22 | labels: 23 | type: local 24 | app: postgres 25 | namespace: ds 26 | spec: 27 | storageClassName: standard 28 | capacity: 29 | storage: 2Gi 30 | accessModes: 31 | - ReadWriteMany 32 | hostPath: 33 | path: "/var/lib/data" 34 | -------------------------------------------------------------------------------- /config/ds/postgreSQL/postgres-pvc.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | kind: PersistentVolumeClaim 19 | apiVersion: v1 20 | metadata: 21 | name: postgres-pv-claim 22 | labels: 23 | app: postgres 24 | namespace: ds 25 | spec: 26 | storageClassName: standard 27 | accessModes: 28 | - ReadWriteMany 29 | resources: 30 | requests: 31 | storage: 500Mi -------------------------------------------------------------------------------- /config/ds/postgreSQL/postgres-service.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: v1 19 | kind: Service 20 | metadata: 21 | name: postgres-service 22 | labels: 23 | app: postgres 24 | namespace: ds 25 | spec: 26 | type: NodePort 27 | #type: LoadBalancer 28 | ports: 29 | - port: 5432 30 | targetPort: 5432 31 | nodePort: 30022 32 | protocol: TCP 33 | selector: 34 | app: postgres -------------------------------------------------------------------------------- /config/ds/zookeeper/zookeeper.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: apps/v1 19 | kind: Deployment 20 | metadata: 21 | labels: 22 | app: zookeeper 23 | name: zookeeper 24 | namespace: ds 25 | spec: 26 | replicas: 1 27 | selector: 28 | matchLabels: 29 | app: zookeeper 30 | template: 31 | metadata: 32 | labels: 33 | app: zookeeper 34 | spec: 35 | containers: 36 | - image: docker.io/zookeeper 37 | imagePullPolicy: IfNotPresent 38 | name: zookeeper 39 | ports: 40 | - containerPort: 2181 41 | --- 42 | apiVersion: v1 43 | kind: Service 44 | metadata: 45 | labels: 46 | app: zookeeper-service 47 | name: zookeeper-service 48 | namespace: ds 49 | spec: 50 | type: NodePort 51 | ports: 52 | - name: zookeeper-port 53 | port: 2181 54 | targetPort: 2181 55 | nodePort: 31281 56 | selector: 57 | app: zookeeper 58 | 59 | -------------------------------------------------------------------------------- /config/manager/controller_manager_config.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 19 | kind: ControllerManagerConfig 20 | health: 21 | healthProbeBindAddress: :8081 22 | metrics: 23 | bindAddress: 127.0.0.1:8080 24 | webhook: 25 | port: 9443 26 | leaderElection: 27 | leaderElect: true 28 | resourceName: c8424b0b.apache.dolphinscheduler.dev 29 | -------------------------------------------------------------------------------- /config/manager/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | resources: 19 | - manager.yaml 20 | 21 | generatorOptions: 22 | disableNameSuffixHash: true 23 | 24 | configMapGenerator: 25 | - files: 26 | - controller_manager_config.yaml 27 | name: manager-config 28 | apiVersion: kustomize.config.k8s.io/v1beta1 29 | kind: Kustomization 30 | images: 31 | - name: controller 32 | newName: apache/dolphinscheduler-operator 33 | newTag: latest 34 | -------------------------------------------------------------------------------- /config/manager/manager.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: v1 19 | kind: Namespace 20 | metadata: 21 | labels: 22 | control-plane: controller-manager 23 | name: system 24 | --- 25 | apiVersion: apps/v1 26 | kind: Deployment 27 | metadata: 28 | name: controller-manager 29 | namespace: system 30 | labels: 31 | control-plane: controller-manager 32 | spec: 33 | selector: 34 | matchLabels: 35 | control-plane: controller-manager 36 | replicas: 1 37 | template: 38 | metadata: 39 | annotations: 40 | kubectl.kubernetes.io/default-container: manager 41 | labels: 42 | control-plane: controller-manager 43 | spec: 44 | securityContext: 45 | runAsNonRoot: true 46 | containers: 47 | - command: 48 | - /manager 49 | args: 50 | - --leader-elect 51 | image: controller:latest 52 | name: manager 53 | securityContext: 54 | allowPrivilegeEscalation: false 55 | livenessProbe: 56 | httpGet: 57 | path: /healthz 58 | port: 8081 59 | initialDelaySeconds: 15 60 | periodSeconds: 20 61 | readinessProbe: 62 | httpGet: 63 | path: /readyz 64 | port: 8081 65 | initialDelaySeconds: 5 66 | periodSeconds: 10 67 | # TODO(user): Configure the resources accordingly based on the project requirements. 68 | # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ 69 | resources: 70 | limits: 71 | cpu: 500m 72 | memory: 128Mi 73 | requests: 74 | cpu: 10m 75 | memory: 64Mi 76 | serviceAccountName: controller-manager 77 | terminationGracePeriodSeconds: 10 78 | -------------------------------------------------------------------------------- /config/prometheus/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | resources: 19 | - monitor.yaml 20 | -------------------------------------------------------------------------------- /config/prometheus/monitor.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Prometheus Monitor Service (Metrics) 19 | apiVersion: monitoring.coreos.com/v1 20 | kind: ServiceMonitor 21 | metadata: 22 | labels: 23 | control-plane: controller-manager 24 | name: controller-manager-metrics-monitor 25 | namespace: system 26 | spec: 27 | endpoints: 28 | - path: /metrics 29 | port: https 30 | scheme: https 31 | bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token 32 | tlsConfig: 33 | insecureSkipVerify: true 34 | selector: 35 | matchLabels: 36 | control-plane: controller-manager 37 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_client_clusterrole.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: ClusterRole 20 | metadata: 21 | name: metrics-reader 22 | rules: 23 | - nonResourceURLs: 24 | - "/metrics" 25 | verbs: 26 | - get 27 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: ClusterRole 20 | metadata: 21 | name: proxy-role 22 | rules: 23 | - apiGroups: 24 | - authentication.k8s.io 25 | resources: 26 | - tokenreviews 27 | verbs: 28 | - create 29 | - apiGroups: 30 | - authorization.k8s.io 31 | resources: 32 | - subjectaccessreviews 33 | verbs: 34 | - create 35 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: ClusterRoleBinding 20 | metadata: 21 | name: proxy-rolebinding 22 | roleRef: 23 | apiGroup: rbac.authorization.k8s.io 24 | kind: ClusterRole 25 | name: proxy-role 26 | subjects: 27 | - kind: ServiceAccount 28 | name: controller-manager 29 | namespace: system 30 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_service.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: v1 19 | kind: Service 20 | metadata: 21 | labels: 22 | control-plane: controller-manager 23 | name: controller-manager-metrics-service 24 | namespace: system 25 | spec: 26 | ports: 27 | - name: https 28 | port: 8443 29 | protocol: TCP 30 | targetPort: https 31 | selector: 32 | control-plane: controller-manager 33 | -------------------------------------------------------------------------------- /config/rbac/dsalert_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # permissions for end users to edit dsalerts. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: dsalert-editor-role 23 | rules: 24 | - apiGroups: 25 | - ds.apache.dolphinscheduler.dev 26 | resources: 27 | - dsalerts 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - ds.apache.dolphinscheduler.dev 38 | resources: 39 | - dsalerts/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /config/rbac/dsalert_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # permissions for end users to view dsalerts. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: dsalert-viewer-role 23 | rules: 24 | - apiGroups: 25 | - ds.apache.dolphinscheduler.dev 26 | resources: 27 | - dsalerts 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - ds.apache.dolphinscheduler.dev 34 | resources: 35 | - dsalerts/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /config/rbac/dsapi_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # permissions for end users to edit dsapis. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: dsapi-editor-role 23 | rules: 24 | - apiGroups: 25 | - ds.apache.dolphinscheduler.dev 26 | resources: 27 | - dsapis 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - ds.apache.dolphinscheduler.dev 38 | resources: 39 | - dsapis/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /config/rbac/dsapi_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # permissions for end users to view dsapis. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: dsapi-viewer-role 23 | rules: 24 | - apiGroups: 25 | - ds.apache.dolphinscheduler.dev 26 | resources: 27 | - dsapis 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - ds.apache.dolphinscheduler.dev 34 | resources: 35 | - dsapis/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /config/rbac/dsmaster_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # permissions for end users to edit dsmasters. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: dsmaster-editor-role 23 | rules: 24 | - apiGroups: 25 | - ds.apache.dolphinscheduler.dev 26 | resources: 27 | - dsmasters 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - ds.apache.dolphinscheduler.dev 38 | resources: 39 | - dsmasters/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /config/rbac/dsmaster_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # permissions for end users to view dsmasters. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: dsmaster-viewer-role 23 | rules: 24 | - apiGroups: 25 | - ds.apache.dolphinscheduler.dev 26 | resources: 27 | - dsmasters 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - ds.apache.dolphinscheduler.dev 34 | resources: 35 | - dsmasters/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /config/rbac/dsworker_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # permissions for end users to edit dsworkers. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: dsworker-editor-role 23 | rules: 24 | - apiGroups: 25 | - ds.apache.dolphinscheduler.dev 26 | resources: 27 | - dsworkers 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - ds.apache.dolphinscheduler.dev 38 | resources: 39 | - dsworkers/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /config/rbac/dsworker_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # permissions for end users to view dsworkers. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: dsworker-viewer-role 23 | rules: 24 | - apiGroups: 25 | - ds.apache.dolphinscheduler.dev 26 | resources: 27 | - dsworkers 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - ds.apache.dolphinscheduler.dev 34 | resources: 35 | - dsworkers/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /config/rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | resources: 19 | # All RBAC will be applied under this service account in 20 | # the deployment namespace. You may comment out this resource 21 | # if your manager will use a service account that exists at 22 | # runtime. Be sure to update RoleBinding and ClusterRoleBinding 23 | # subjects if changing service account names. 24 | - service_account.yaml 25 | - role.yaml 26 | - role_binding.yaml 27 | - leader_election_role.yaml 28 | - leader_election_role_binding.yaml 29 | # Comment the following 4 lines if you want to disable 30 | # the auth proxy (https://github.com/brancz/kube-rbac-proxy) 31 | # which protects your /metrics endpoint. 32 | - auth_proxy_service.yaml 33 | - auth_proxy_role.yaml 34 | - auth_proxy_role_binding.yaml 35 | - auth_proxy_client_clusterrole.yaml 36 | -------------------------------------------------------------------------------- /config/rbac/leader_election_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # permissions to do leader election. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: Role 21 | metadata: 22 | name: leader-election-role 23 | rules: 24 | - apiGroups: 25 | - "" 26 | resources: 27 | - configmaps 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - create 33 | - update 34 | - patch 35 | - delete 36 | - apiGroups: 37 | - coordination.k8s.io 38 | resources: 39 | - leases 40 | verbs: 41 | - get 42 | - list 43 | - watch 44 | - create 45 | - update 46 | - patch 47 | - delete 48 | - apiGroups: 49 | - "" 50 | resources: 51 | - events 52 | verbs: 53 | - create 54 | - patch 55 | -------------------------------------------------------------------------------- /config/rbac/leader_election_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: RoleBinding 20 | metadata: 21 | name: leader-election-rolebinding 22 | roleRef: 23 | apiGroup: rbac.authorization.k8s.io 24 | kind: Role 25 | name: leader-election-role 26 | subjects: 27 | - kind: ServiceAccount 28 | name: controller-manager 29 | namespace: system 30 | -------------------------------------------------------------------------------- /config/rbac/role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | --- 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | creationTimestamp: null 23 | name: manager-role 24 | rules: 25 | - apiGroups: 26 | - "" 27 | resources: 28 | - persistentvolumeclaims 29 | verbs: 30 | - create 31 | - delete 32 | - get 33 | - list 34 | - watch 35 | - apiGroups: 36 | - "" 37 | resources: 38 | - pods 39 | verbs: 40 | - create 41 | - delete 42 | - get 43 | - list 44 | - patch 45 | - update 46 | - watch 47 | - apiGroups: 48 | - "" 49 | resources: 50 | - serviceaccounts 51 | verbs: 52 | - create 53 | - delete 54 | - get 55 | - list 56 | - apiGroups: 57 | - "" 58 | resources: 59 | - services 60 | verbs: 61 | - create 62 | - delete 63 | - get 64 | - list 65 | - patch 66 | - update 67 | - watch 68 | - apiGroups: 69 | - apps 70 | resources: 71 | - deployments 72 | verbs: 73 | - create 74 | - delete 75 | - get 76 | - list 77 | - patch 78 | - update 79 | - watch 80 | - apiGroups: 81 | - autoscaling 82 | resources: 83 | - horizontalpodautoscalers 84 | verbs: 85 | - create 86 | - delete 87 | - get 88 | - list 89 | - patch 90 | - update 91 | - watch 92 | - apiGroups: 93 | - ds.apache.dolphinscheduler.dev 94 | resources: 95 | - dsalerts 96 | verbs: 97 | - create 98 | - delete 99 | - get 100 | - list 101 | - patch 102 | - update 103 | - watch 104 | - apiGroups: 105 | - ds.apache.dolphinscheduler.dev 106 | resources: 107 | - dsalerts/finalizers 108 | verbs: 109 | - update 110 | - apiGroups: 111 | - ds.apache.dolphinscheduler.dev 112 | resources: 113 | - dsalerts/status 114 | verbs: 115 | - get 116 | - patch 117 | - update 118 | - apiGroups: 119 | - ds.apache.dolphinscheduler.dev 120 | resources: 121 | - dsapis 122 | verbs: 123 | - create 124 | - delete 125 | - get 126 | - list 127 | - patch 128 | - update 129 | - watch 130 | - apiGroups: 131 | - ds.apache.dolphinscheduler.dev 132 | resources: 133 | - dsapis/finalizers 134 | verbs: 135 | - update 136 | - apiGroups: 137 | - ds.apache.dolphinscheduler.dev 138 | resources: 139 | - dsapis/status 140 | verbs: 141 | - get 142 | - patch 143 | - update 144 | - apiGroups: 145 | - ds.apache.dolphinscheduler.dev 146 | resources: 147 | - dsmasters 148 | verbs: 149 | - create 150 | - delete 151 | - get 152 | - list 153 | - patch 154 | - update 155 | - watch 156 | - apiGroups: 157 | - ds.apache.dolphinscheduler.dev 158 | resources: 159 | - dsmasters/finalizers 160 | verbs: 161 | - update 162 | - apiGroups: 163 | - ds.apache.dolphinscheduler.dev 164 | resources: 165 | - dsmasters/status 166 | verbs: 167 | - get 168 | - patch 169 | - update 170 | - apiGroups: 171 | - ds.apache.dolphinscheduler.dev 172 | resources: 173 | - dsworkers 174 | verbs: 175 | - create 176 | - delete 177 | - get 178 | - list 179 | - patch 180 | - update 181 | - watch 182 | - apiGroups: 183 | - ds.apache.dolphinscheduler.dev 184 | resources: 185 | - dsworkers/finalizers 186 | verbs: 187 | - update 188 | - apiGroups: 189 | - ds.apache.dolphinscheduler.dev 190 | resources: 191 | - dsworkers/status 192 | verbs: 193 | - get 194 | - patch 195 | - update 196 | - apiGroups: 197 | - rbac.authorization.k8s.io 198 | resources: 199 | - role 200 | verbs: 201 | - create 202 | - delete 203 | - get 204 | - list 205 | - apiGroups: 206 | - rbac.authorization.k8s.io 207 | resources: 208 | - rolebinding 209 | verbs: 210 | - create 211 | - delete 212 | - get 213 | - list 214 | -------------------------------------------------------------------------------- /config/rbac/role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: ClusterRoleBinding 20 | metadata: 21 | name: manager-rolebinding 22 | roleRef: 23 | apiGroup: rbac.authorization.k8s.io 24 | kind: ClusterRole 25 | name: manager-role 26 | subjects: 27 | - kind: ServiceAccount 28 | name: controller-manager 29 | namespace: system 30 | -------------------------------------------------------------------------------- /config/rbac/service_account.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: v1 19 | kind: ServiceAccount 20 | metadata: 21 | name: controller-manager 22 | namespace: system 23 | -------------------------------------------------------------------------------- /config/samples/ds_v1alpha1_dsalert.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: ds.apache.dolphinscheduler.dev/v1alpha1 19 | kind: DSAlert 20 | metadata: 21 | name: ds-alert 22 | namespace: ds 23 | labels: 24 | app: ds-alert 25 | spec: 26 | replicas: 1 27 | version: latest 28 | repository: ghcr.io/apache/dolphinscheduler/dolphinscheduler-alert-server 29 | datasource: 30 | drive_name: "org.postgresql.Driver" 31 | url: "jdbc:postgresql://postgres-service:5432/dolphinscheduler" 32 | username: "postgresadmin" 33 | password: "admin12345" 34 | -------------------------------------------------------------------------------- /config/samples/ds_v1alpha1_dsapi.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: ds.apache.dolphinscheduler.dev/v1alpha1 19 | kind: DSApi 20 | metadata: 21 | name: ds-api 22 | namespace: ds 23 | labels: 24 | app: ds-api 25 | spec: 26 | replicas: 1 27 | version: latest 28 | zookeeper_connect: "zookeeper-service:2181" 29 | repository: ghcr.io/apache/dolphinscheduler/dolphinscheduler-api 30 | node_port: 30002 31 | datasource: 32 | drive_name: "org.postgresql.Driver" 33 | url: "jdbc:postgresql://postgres-service:5432/dolphinscheduler" 34 | username: "postgresadmin" 35 | password: "admin12345" 36 | -------------------------------------------------------------------------------- /config/samples/ds_v1alpha1_dsmaster.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: ds.apache.dolphinscheduler.dev/v1alpha1 19 | kind: DSMaster 20 | metadata: 21 | name: ds-master 22 | namespace: ds 23 | labels: 24 | app: ds-master 25 | spec: 26 | replicas: 1 27 | zookeeper_connect: "zookeeper-service:2181" 28 | version: latest 29 | repository: ghcr.io/apache/dolphinscheduler/dolphinscheduler-master 30 | datasource: 31 | drive_name: "org.postgresql.Driver" 32 | url: "jdbc:postgresql://postgres-service:5432/dolphinscheduler" 33 | username: "postgresadmin" 34 | password: "admin12345" 35 | # hpa: 36 | # min_replicas: 1 37 | # max_replicas: 5 38 | # mem_average_utilization: 85 39 | -------------------------------------------------------------------------------- /config/samples/ds_v1alpha1_dsworker.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: ds.apache.dolphinscheduler.dev/v1alpha1 19 | kind: DSWorker 20 | metadata: 21 | name: ds-worker 22 | namespace: ds 23 | labels: 24 | app: ds-worker 25 | spec: 26 | replicas: 1 27 | zookeeper_connect: "zookeeper-service:2181" 28 | version: latest 29 | repository: ghcr.io/apache/dolphinscheduler/dolphinscheduler-worker 30 | datasource: 31 | drive_name: "org.postgresql.Driver" 32 | url: "jdbc:postgresql://postgres-service:5432/dolphinscheduler" 33 | username: "postgresadmin" 34 | password: "admin12345" 35 | 36 | -------------------------------------------------------------------------------- /config/test/busybox.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: v1 19 | kind: Pod 20 | metadata: 21 | name: busybox 22 | namespace: default 23 | spec: 24 | containers: 25 | - name: busybox 26 | image: busybox 27 | command: 28 | - sleep 29 | - "3600" 30 | imagePullPolicy: IfNotPresent 31 | restartPolicy: Always -------------------------------------------------------------------------------- /config/test/ndsutils.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: v1 19 | kind: Pod 20 | metadata: 21 | name: dnsutils 22 | namespace: kube-system 23 | spec: 24 | containers: 25 | - name: dnsutils 26 | image: mydlqclub/dnsutils:1.3 27 | imagePullPolicy: IfNotPresent 28 | command: ["sleep","3600"] -------------------------------------------------------------------------------- /config/test/nginx.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: v1 19 | kind: Service 20 | metadata: 21 | name: nginx 22 | namespace : test 23 | labels: 24 | app: nginx 25 | spec: 26 | ports: 27 | - port: 80 28 | name: web 29 | clusterIP: None 30 | selector: 31 | app: nginx 32 | --- 33 | apiVersion: apps/v1 34 | kind: StatefulSet 35 | metadata: 36 | name: web 37 | namespace : test 38 | spec: 39 | selector: 40 | matchLabels: 41 | app: nginx # has to match .spec.template.metadata.labels 42 | serviceName: "nginx" #声明它属于哪个Headless Service. 43 | replicas: 3 # by default is 1 44 | template: 45 | metadata: 46 | labels: 47 | app: nginx # has to match .spec.selector.matchLabels 48 | spec: 49 | terminationGracePeriodSeconds: 10 50 | containers: 51 | - name: nginx 52 | image: nginx 53 | ports: 54 | - containerPort: 80 55 | name: web 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /config/webhook/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | resources: 19 | - manifests.yaml 20 | - service.yaml 21 | 22 | configurations: 23 | - kustomizeconfig.yaml 24 | -------------------------------------------------------------------------------- /config/webhook/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # the following config is for teaching kustomize where to look at when substituting vars. 19 | # It requires kustomize v2.1.0 or newer to work properly. 20 | nameReference: 21 | - kind: Service 22 | version: v1 23 | fieldSpecs: 24 | - kind: MutatingWebhookConfiguration 25 | group: admissionregistration.k8s.io 26 | path: webhooks/clientConfig/service/name 27 | - kind: ValidatingWebhookConfiguration 28 | group: admissionregistration.k8s.io 29 | path: webhooks/clientConfig/service/name 30 | 31 | namespace: 32 | - kind: MutatingWebhookConfiguration 33 | group: admissionregistration.k8s.io 34 | path: webhooks/clientConfig/service/namespace 35 | create: true 36 | - kind: ValidatingWebhookConfiguration 37 | group: admissionregistration.k8s.io 38 | path: webhooks/clientConfig/service/namespace 39 | create: true 40 | 41 | varReference: 42 | - path: metadata/annotations 43 | -------------------------------------------------------------------------------- /config/webhook/manifests.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | --- 19 | apiVersion: admissionregistration.k8s.io/v1 20 | kind: MutatingWebhookConfiguration 21 | metadata: 22 | creationTimestamp: null 23 | name: mutating-webhook-configuration 24 | webhooks: 25 | - admissionReviewVersions: 26 | - v1 27 | clientConfig: 28 | service: 29 | name: webhook-service 30 | namespace: system 31 | path: /mutate-ds-apache-dolphinscheduler-dev-v1alpha1-dsmaster 32 | failurePolicy: Fail 33 | name: mdsmaster.kb.io 34 | rules: 35 | - apiGroups: 36 | - ds.apache.dolphinscheduler.dev 37 | apiVersions: 38 | - v1alpha1 39 | operations: 40 | - CREATE 41 | - UPDATE 42 | resources: 43 | - dsmasters 44 | sideEffects: None 45 | --- 46 | apiVersion: admissionregistration.k8s.io/v1 47 | kind: ValidatingWebhookConfiguration 48 | metadata: 49 | creationTimestamp: null 50 | name: validating-webhook-configuration 51 | webhooks: 52 | - admissionReviewVersions: 53 | - v1 54 | clientConfig: 55 | service: 56 | name: webhook-service 57 | namespace: system 58 | path: /validate-ds-apache-dolphinscheduler-dev-v1alpha1-dsmaster 59 | failurePolicy: Fail 60 | name: vdsmaster.kb.io 61 | rules: 62 | - apiGroups: 63 | - ds.apache.dolphinscheduler.dev 64 | apiVersions: 65 | - v1alpha1 66 | operations: 67 | - CREATE 68 | - UPDATE 69 | resources: 70 | - dsmasters 71 | sideEffects: None 72 | -------------------------------------------------------------------------------- /config/webhook/service.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | apiVersion: v1 19 | kind: Service 20 | metadata: 21 | name: webhook-service 22 | namespace: system 23 | spec: 24 | ports: 25 | - port: 443 26 | protocol: TCP 27 | targetPort: 9443 28 | selector: 29 | control-plane: controller-manager 30 | -------------------------------------------------------------------------------- /controllers/alert_reconcile.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package controllers 19 | 20 | import ( 21 | dsv1alpha1 "dolphinscheduler-operator/api/v1alpha1" 22 | 23 | v1 "k8s.io/api/apps/v1" 24 | corev1 "k8s.io/api/core/v1" 25 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 26 | "k8s.io/apimachinery/pkg/util/intstr" 27 | ) 28 | 29 | func createAlertService(cluster *dsv1alpha1.DSAlert) *corev1.Service { 30 | service := corev1.Service{ 31 | ObjectMeta: metav1.ObjectMeta{ 32 | Name: dsv1alpha1.DsAlertServiceValue, 33 | Namespace: cluster.Namespace, 34 | Labels: map[string]string{dsv1alpha1.DsAppName: dsv1alpha1.DsAlertServiceValue}, 35 | }, 36 | Spec: corev1.ServiceSpec{ 37 | Selector: map[string]string{dsv1alpha1.DsAppName: dsv1alpha1.DsAlert}, 38 | Ports: []corev1.ServicePort{ 39 | { 40 | Protocol: corev1.ProtocolTCP, 41 | Port: *int32Ptr(int32(dsv1alpha1.DsAlertPort)), 42 | TargetPort: intstr.IntOrString{ 43 | IntVal: dsv1alpha1.DsAlertPort, 44 | }, 45 | }, 46 | }, 47 | }, 48 | } 49 | return &service 50 | } 51 | 52 | func createAlertDeployment(cluster *dsv1alpha1.DSAlert) *v1.Deployment { 53 | alertDeployment := v1.Deployment{ 54 | ObjectMeta: metav1.ObjectMeta{ 55 | Name: dsv1alpha1.DsAlertDeploymentValue, 56 | Namespace: cluster.Namespace, 57 | }, 58 | Spec: v1.DeploymentSpec{ 59 | Replicas: int32Ptr(cluster.Spec.Replicas), 60 | Selector: &metav1.LabelSelector{ 61 | MatchLabels: map[string]string{ 62 | dsv1alpha1.DsAppName: dsv1alpha1.DsAlert, 63 | }, 64 | }, 65 | Template: corev1.PodTemplateSpec{ 66 | ObjectMeta: metav1.ObjectMeta{ 67 | Labels: map[string]string{ 68 | dsv1alpha1.DsAppName: dsv1alpha1.DsAlert, 69 | }, 70 | }, 71 | Spec: corev1.PodSpec{ 72 | ServiceAccountName: dsv1alpha1.DsServiceAccount, 73 | Containers: []corev1.Container{{ 74 | Name: dsv1alpha1.DsAlert, 75 | Image: ImageName(cluster.Spec.Repository, cluster.Spec.Version), 76 | ImagePullPolicy: corev1.PullIfNotPresent, 77 | 78 | Env: []corev1.EnvVar{ 79 | { 80 | Name: dsv1alpha1.DataSourceDriveName, 81 | Value: cluster.Spec.Datasource.DriveName, 82 | }, 83 | { 84 | Name: dsv1alpha1.DataSourceUrl, 85 | Value: cluster.Spec.Datasource.Url, 86 | }, 87 | { 88 | Name: dsv1alpha1.DataSourceUserName, 89 | Value: cluster.Spec.Datasource.UserName, 90 | }, 91 | { 92 | Name: dsv1alpha1.DataSourcePassWord, 93 | Value: cluster.Spec.Datasource.Password, 94 | }, 95 | }, 96 | Ports: []corev1.ContainerPort{{ 97 | ContainerPort: dsv1alpha1.DsAlertPort, 98 | }, 99 | }, 100 | }, 101 | }, 102 | }, 103 | }, 104 | }, 105 | } 106 | return &alertDeployment 107 | } 108 | 109 | func int32Ptr(i int32) *int32 { 110 | return &i 111 | } 112 | -------------------------------------------------------------------------------- /controllers/api_reconcile.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package controllers 19 | 20 | import ( 21 | dsv1alpha1 "dolphinscheduler-operator/api/v1alpha1" 22 | 23 | v1 "k8s.io/api/apps/v1" 24 | corev1 "k8s.io/api/core/v1" 25 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 26 | "k8s.io/apimachinery/pkg/util/intstr" 27 | ) 28 | 29 | func createApiService(cluster *dsv1alpha1.DSApi) *corev1.Service { 30 | service := corev1.Service{ 31 | ObjectMeta: metav1.ObjectMeta{ 32 | Name: dsv1alpha1.DsApiServiceValue, 33 | Namespace: cluster.Namespace, 34 | Labels: map[string]string{dsv1alpha1.DsAppName: dsv1alpha1.DsApiServiceValue}, 35 | }, 36 | Spec: corev1.ServiceSpec{ 37 | Type: corev1.ServiceTypeLoadBalancer, 38 | Selector: map[string]string{dsv1alpha1.DsAppName: dsv1alpha1.DsApi}, 39 | Ports: []corev1.ServicePort{ 40 | { 41 | Protocol: corev1.ProtocolTCP, 42 | Port: *int32Ptr(int32(dsv1alpha1.DsApiPort)), 43 | TargetPort: intstr.IntOrString{ 44 | IntVal: dsv1alpha1.DsApiPort, 45 | }, 46 | }, 47 | }, 48 | }, 49 | } 50 | if cluster.Spec.NodePort > 0 { 51 | apiLogger.Info("the nodePort is not nil", "nodePort", cluster.Spec.NodePort) 52 | service.Spec.Type = corev1.ServiceTypeNodePort 53 | service.Spec.Ports[0].NodePort = cluster.Spec.NodePort 54 | } 55 | return &service 56 | } 57 | 58 | func createApiDeployment(cluster *dsv1alpha1.DSApi) *v1.Deployment { 59 | ApiDeployment := v1.Deployment{ 60 | ObjectMeta: metav1.ObjectMeta{ 61 | Name: dsv1alpha1.DsApiDeploymentValue, 62 | Namespace: cluster.Namespace, 63 | }, 64 | Spec: v1.DeploymentSpec{ 65 | Replicas: int32Ptr(cluster.Spec.Replicas), 66 | Selector: &metav1.LabelSelector{ 67 | MatchLabels: map[string]string{ 68 | dsv1alpha1.DsAppName: dsv1alpha1.DsApi, 69 | }, 70 | }, 71 | Template: corev1.PodTemplateSpec{ 72 | ObjectMeta: metav1.ObjectMeta{ 73 | Labels: map[string]string{ 74 | dsv1alpha1.DsAppName: dsv1alpha1.DsApi, 75 | }, 76 | }, 77 | Spec: corev1.PodSpec{ 78 | ServiceAccountName: dsv1alpha1.DsServiceAccount, 79 | Containers: []corev1.Container{{ 80 | Name: dsv1alpha1.DsApi, 81 | Image: ImageName(cluster.Spec.Repository, cluster.Spec.Version), 82 | ImagePullPolicy: corev1.PullIfNotPresent, 83 | Env: []corev1.EnvVar{ 84 | { 85 | Name: dsv1alpha1.EnvZookeeper, 86 | Value: cluster.Spec.ZookeeperConnect, 87 | }, 88 | { 89 | Name: dsv1alpha1.DataSourceDriveName, 90 | Value: cluster.Spec.Datasource.DriveName, 91 | }, 92 | { 93 | Name: dsv1alpha1.DataSourceUrl, 94 | Value: cluster.Spec.Datasource.Url, 95 | }, 96 | { 97 | Name: dsv1alpha1.DataSourceUserName, 98 | Value: cluster.Spec.Datasource.UserName, 99 | }, 100 | { 101 | Name: dsv1alpha1.DataSourcePassWord, 102 | Value: cluster.Spec.Datasource.Password, 103 | }, 104 | }, 105 | Ports: []corev1.ContainerPort{{ 106 | ContainerPort: dsv1alpha1.DsApiPort, 107 | }, 108 | }, 109 | }, 110 | }, 111 | }, 112 | }, 113 | }, 114 | } 115 | return &ApiDeployment 116 | } 117 | -------------------------------------------------------------------------------- /controllers/deployment.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package controllers 19 | 20 | import ( 21 | dsv1alpha1 "dolphinscheduler-operator/api/v1alpha1" 22 | v1 "k8s.io/api/apps/v1" 23 | corev1 "k8s.io/api/core/v1" 24 | ) 25 | 26 | // IsDeploymentAvailable returns true if a pod is ready; false otherwise. 27 | func IsDeploymentAvailable(deployment *v1.Deployment) bool { 28 | return IsDeploymentAvailableConditionTrue(deployment.Status) 29 | } 30 | 31 | func applyDeploymentPolicy(deployment *v1.Deployment, policy *dsv1alpha1.DeploymentPolicy) { 32 | if policy == nil { 33 | return 34 | } 35 | 36 | if policy.Affinity != nil { 37 | deployment.Spec.Template.Spec.Affinity = policy.Affinity 38 | } 39 | 40 | if len(policy.Tolerations) != 0 { 41 | deployment.Spec.Template.Spec.Tolerations = policy.Tolerations 42 | } 43 | 44 | mergeLabels(deployment.Labels, policy.Labels) 45 | 46 | if &policy.Resources != nil { 47 | deployment.Spec.Template.Spec.Containers[0] = containerWithRequirements(deployment.Spec.Template.Spec.Containers[0], policy.Resources) 48 | } 49 | 50 | if len(policy.Envs) != 0 { 51 | deployment.Spec.Template.Spec.Containers[0].Env = append(deployment.Spec.Template.Spec.Containers[0].Env, policy.Envs...) 52 | } 53 | 54 | for key, value := range policy.Annotations { 55 | deployment.ObjectMeta.Annotations[key] = value 56 | } 57 | } 58 | 59 | // IsDeploymentAvailableConditionTrue returns true if a deployment is available; false otherwise. 60 | func IsDeploymentAvailableConditionTrue(status v1.DeploymentStatus) bool { 61 | condition := GetDeploymentAvailableCondition(status) 62 | return condition != nil && condition.Status == corev1.ConditionTrue 63 | } 64 | 65 | // GetDeploymentReadyCondition extracts the deployment available condition from the given status and returns that. 66 | // Returns nil if the condition is not present. 67 | func GetDeploymentAvailableCondition(status v1.DeploymentStatus) *v1.DeploymentCondition { 68 | _, condition := GetDeploymentCondition(&status, v1.DeploymentAvailable) 69 | return condition 70 | } 71 | 72 | // GetDeploymentCondition extracts the provided condition from the given status and returns that. 73 | // Returns nil and -1 if the condition is not present, and the index of the located condition. 74 | func GetDeploymentCondition(status *v1.DeploymentStatus, conditionType v1.DeploymentConditionType) (int, *v1.DeploymentCondition) { 75 | if status == nil { 76 | return -1, nil 77 | } 78 | return GetDeploymentConditionFromList(status.Conditions, conditionType) 79 | } 80 | 81 | // GetDeploymentConditionFromList extracts the provided condition from the given list of condition and 82 | // returns the index of the condition and the condition. Returns -1 and nil if the condition is not present. 83 | func GetDeploymentConditionFromList(conditions []v1.DeploymentCondition, conditionType v1.DeploymentConditionType) (int, *v1.DeploymentCondition) { 84 | if conditions == nil { 85 | return -1, nil 86 | } 87 | for i := range conditions { 88 | if conditions[i].Type == conditionType { 89 | return i, &conditions[i] 90 | } 91 | } 92 | return -1, nil 93 | } 94 | -------------------------------------------------------------------------------- /controllers/member.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package controllers 19 | 20 | import ( 21 | "fmt" 22 | "strconv" 23 | "strings" 24 | ) 25 | 26 | type Member struct { 27 | Name string 28 | // Kubernetes namespace this member runs in. 29 | Namespace string 30 | // ID field can be 0, which is unknown ID. 31 | // We know the ID of a member when we get the member information from dbmaster, 32 | // but not from Kubernetes pod list. 33 | ID uint64 34 | Phase string 35 | Created bool 36 | RunningAndReady bool 37 | Version string 38 | } 39 | 40 | func (m Member) Ordinal() int { 41 | idx := strings.LastIndex(m.Name, "-") 42 | id, _ := strconv.ParseInt(m.Name[idx+1:], 10, 32) 43 | return int(id) 44 | } 45 | 46 | type MemberSet map[string]*Member 47 | 48 | // the set of all members of s1 that are not members of s2 49 | func (ms MemberSet) Diff(other MemberSet) MemberSet { 50 | diff := MemberSet{} 51 | for n, m := range ms { 52 | if _, ok := other[n]; !ok { 53 | diff[n] = m 54 | } 55 | } 56 | return diff 57 | } 58 | 59 | func (ms MemberSet) Get(id int) *Member { 60 | for _, m := range ms { 61 | idx := strings.LastIndex(m.Name, "-") 62 | mid, _ := strconv.ParseInt(m.Name[idx+1:], 10, 32) 63 | if int(mid) == id { 64 | return m 65 | } 66 | } 67 | return nil 68 | } 69 | 70 | // IsEqual tells whether two member sets are equal by checking 71 | // - they have the same set of members and member equality are judged by Name only. 72 | func (ms MemberSet) IsEqual(other MemberSet) bool { 73 | if ms.Size() != other.Size() { 74 | return false 75 | } 76 | for n := range ms { 77 | if _, ok := other[n]; !ok { 78 | return false 79 | } 80 | } 81 | return true 82 | } 83 | 84 | func (ms MemberSet) Size() int { 85 | return len(ms) 86 | } 87 | 88 | func (ms MemberSet) String() string { 89 | var mstring []string 90 | 91 | for m, v := range ms { 92 | mstring = append(mstring, fmt.Sprintf("%s:%s", m, v.Version)) 93 | } 94 | return strings.Join(mstring, ",") 95 | } 96 | 97 | func (ms MemberSet) PickOne() *Member { 98 | for _, m := range ms { 99 | return m 100 | } 101 | panic("empty") 102 | } 103 | 104 | func (ms MemberSet) Add(m *Member) { 105 | ms[m.Name] = m 106 | } 107 | 108 | func (ms MemberSet) Remove(name string) { 109 | delete(ms, name) 110 | } 111 | 112 | func (ms MemberSet) Ordinals() map[int]bool { 113 | ids := map[int]bool{} 114 | for _, m := range ms { 115 | ids[m.Ordinal()] = true 116 | } 117 | return ids 118 | } 119 | 120 | func (ms MemberSet) Names() []string { 121 | names := make([]string, 0) 122 | for _, m := range ms { 123 | names = append(names, m.Name) 124 | } 125 | return names 126 | } 127 | 128 | func (ms MemberSet) Duplicate() MemberSet { 129 | r := MemberSet{} 130 | for k, v := range ms { 131 | r[k] = v 132 | } 133 | return r 134 | } 135 | 136 | func allMembersHealth(ms MemberSet) bool { 137 | for _, m := range ms { 138 | if !m.RunningAndReady { 139 | return false 140 | } 141 | } 142 | return true 143 | } 144 | -------------------------------------------------------------------------------- /controllers/suite_test.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package controllers 19 | 20 | import ( 21 | "path/filepath" 22 | "testing" 23 | 24 | . "github.com/onsi/ginkgo" 25 | . "github.com/onsi/gomega" 26 | "k8s.io/client-go/kubernetes/scheme" 27 | "k8s.io/client-go/rest" 28 | "sigs.k8s.io/controller-runtime/pkg/client" 29 | "sigs.k8s.io/controller-runtime/pkg/envtest" 30 | "sigs.k8s.io/controller-runtime/pkg/envtest/printer" 31 | logf "sigs.k8s.io/controller-runtime/pkg/log" 32 | "sigs.k8s.io/controller-runtime/pkg/log/zap" 33 | 34 | dsv1alpha1 "dolphinscheduler-operator/api/v1alpha1" 35 | //+kubebuilder:scaffold:imports 36 | ) 37 | 38 | // These tests use Ginkgo (BDD-style Go testing framework). Refer to 39 | // http://onsi.github.io/ginkgo/ to learn more about Ginkgo. 40 | 41 | var cfg *rest.Config 42 | var k8sClient client.Client 43 | var testEnv *envtest.Environment 44 | 45 | func TestAPIs(t *testing.T) { 46 | RegisterFailHandler(Fail) 47 | 48 | RunSpecsWithDefaultAndCustomReporters(t, 49 | "Controller Suite", 50 | []Reporter{printer.NewlineReporter{}}) 51 | } 52 | 53 | var _ = BeforeSuite(func() { 54 | logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) 55 | 56 | By("bootstrapping test environment") 57 | testEnv = &envtest.Environment{ 58 | CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")}, 59 | ErrorIfCRDPathMissing: true, 60 | } 61 | 62 | cfg, err := testEnv.Start() 63 | Expect(err).NotTo(HaveOccurred()) 64 | Expect(cfg).NotTo(BeNil()) 65 | 66 | err = dsv1alpha1.AddToScheme(scheme.Scheme) 67 | Expect(err).NotTo(HaveOccurred()) 68 | 69 | //+kubebuilder:scaffold:Scheme 70 | 71 | k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) 72 | Expect(err).NotTo(HaveOccurred()) 73 | Expect(k8sClient).NotTo(BeNil()) 74 | 75 | }, 60) 76 | 77 | var _ = AfterSuite(func() { 78 | By("tearing down the test environment") 79 | err := testEnv.Stop() 80 | Expect(err).NotTo(HaveOccurred()) 81 | }) 82 | -------------------------------------------------------------------------------- /controllers/worker_reconcile.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package controllers 19 | 20 | import ( 21 | "context" 22 | dsv1alpha1 "dolphinscheduler-operator/api/v1alpha1" 23 | 24 | corev1 "k8s.io/api/core/v1" 25 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 26 | "sigs.k8s.io/controller-runtime/pkg/client" 27 | "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" 28 | ) 29 | 30 | func (r *DSWorkerReconciler) podMemberSet(ctx context.Context, cluster *dsv1alpha1.DSWorker) (MemberSet, error) { 31 | members := MemberSet{} 32 | pods := &corev1.PodList{} 33 | 34 | if err := r.Client.List(ctx, pods, client.InNamespace(cluster.Namespace), 35 | client.MatchingLabels(LabelsForCluster(dsv1alpha1.DsWorkerLabel))); err != nil { 36 | return members, err 37 | } 38 | 39 | if len(pods.Items) > 0 { 40 | for _, pod := range pods.Items { 41 | if pod.ObjectMeta.DeletionTimestamp.IsZero() { 42 | m := &Member{ 43 | Name: pod.Name, 44 | Namespace: pod.Namespace, 45 | Created: true, 46 | Version: pod.Labels[dsv1alpha1.DsVersionLabel], 47 | Phase: string(pod.Status.Phase), 48 | RunningAndReady: IsRunningAndReady(&pod), 49 | } 50 | members.Add(m) 51 | } 52 | } 53 | } 54 | 55 | return members, nil 56 | } 57 | 58 | func newDSWorkerPod(cr *dsv1alpha1.DSWorker) *corev1.Pod { 59 | var podName = cr.Name + "-pod" + dsv1alpha1.RandStr(6) 60 | return &corev1.Pod{ 61 | ObjectMeta: metav1.ObjectMeta{ 62 | Name: podName, 63 | Namespace: cr.Namespace, 64 | Labels: map[string]string{dsv1alpha1.DsAppName: dsv1alpha1.DsWorkerLabel, 65 | dsv1alpha1.DsVersionLabel: cr.Spec.Version, 66 | dsv1alpha1.DsServiceLabel: dsv1alpha1.DsServiceLabelValue, 67 | }, 68 | }, 69 | Spec: corev1.PodSpec{ 70 | Hostname: podName, 71 | Subdomain: dsv1alpha1.DsServiceLabelValue, 72 | ServiceAccountName: dsv1alpha1.DsServiceAccount, 73 | Containers: []corev1.Container{ 74 | { 75 | Name: cr.Name, 76 | Image: ImageName(cr.Spec.Repository, cr.Spec.Version), 77 | ImagePullPolicy: corev1.PullIfNotPresent, 78 | Env: []corev1.EnvVar{{ 79 | Name: dsv1alpha1.EnvZookeeper, 80 | Value: cr.Spec.ZookeeperConnect, 81 | }, { 82 | Name: dsv1alpha1.DataSourceDriveName, 83 | Value: cr.Spec.Datasource.DriveName, 84 | }, 85 | { 86 | Name: dsv1alpha1.DataSourceUrl, 87 | Value: cr.Spec.Datasource.Url, 88 | }, 89 | { 90 | Name: dsv1alpha1.DataSourceUserName, 91 | Value: cr.Spec.Datasource.UserName, 92 | }, 93 | { 94 | Name: dsv1alpha1.DataSourcePassWord, 95 | Value: cr.Spec.Datasource.Password, 96 | }, 97 | }, 98 | Command: []string{ 99 | "/bin/sh", "-c", 100 | }, 101 | Args: []string{"sed -i 's/alert-listen-host: localhost/alert-listen-host: $(DS_ALERT_SERVICE_SERVICE_HOST)/g' conf/application.yaml ;" + 102 | " sed -i 's/50052/$(DS_ALERT_SERVICE_SERVICE_PORT)/g' conf/application.yaml ; " + 103 | "./bin/start.sh"}, 104 | }, 105 | }, 106 | }, 107 | } 108 | } 109 | 110 | func (r *DSWorkerReconciler) newDSWorkerPod(ctx context.Context, cluster *dsv1alpha1.DSWorker) (*corev1.Pod, error) { 111 | // Create pod 112 | pod := newDSWorkerPod(cluster) 113 | if err := controllerutil.SetControllerReference(cluster, pod, r.Scheme); err != nil { 114 | return nil, err 115 | } 116 | AddLogVolumeToPod(pod, cluster.Spec.LogPvcName) 117 | AddLibVolumeToPod(pod, cluster.Spec.LibPvcName) 118 | applyPodPolicy(pod, cluster.Spec.Pod) 119 | return pod, nil 120 | } 121 | -------------------------------------------------------------------------------- /dist/LICENSE.tpl: -------------------------------------------------------------------------------- 1 | {{.LicenseContent }} 2 | END OF TERMS AND CONDITIONS 3 | 4 | APPENDIX: How to apply the Apache License to your work. 5 | 6 | To apply the Apache License to your work, attach the following 7 | boilerplate notice, with the fields enclosed by brackets "{}" 8 | replaced with your own identifying information. (Don't include 9 | the brackets!) The text should be enclosed in the appropriate 10 | comment syntax for the file format. We also recommend that a 11 | file or class name and description of purpose be included on the 12 | same "printed page" as the copyright notice for easier 13 | identification within third-party archives. 14 | 15 | Copyright {yyyy} {name of copyright owner} 16 | 17 | Licensed under the Apache License, Version 2.0 (the "License"); 18 | you may not use this file except in compliance with the License. 19 | You may obtain a copy of the License at 20 | 21 | http://www.apache.org/licenses/LICENSE-2.0 22 | 23 | Unless required by applicable law or agreed to in writing, software 24 | distributed under the License is distributed on an "AS IS" BASIS, 25 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | See the License for the specific language governing permissions and 27 | limitations under the License. 28 | 29 | ======================================================================= 30 | Apache DolphinScheduler Subcomponents: 31 | 32 | The Apache DolphinScheduler project contains subcomponents with separate copyright 33 | notices and license terms. Your use of the source code for the these 34 | subcomponents is subject to the terms and conditions of the following 35 | licenses. 36 | 37 | {{ range .Groups }} 38 | ======================================================================== 39 | {{.LicenseID}} licenses 40 | ======================================================================== 41 | 42 | The following components are provided under the {{.LicenseID}} License. See project link for details. 43 | The text of each license is also included at licenses/license-[project].txt. 44 | {{range .Deps}} 45 | {{.Name}} {{.Version}} {{.LicenseID}} 46 | {{- end }} 47 | {{ end }} 48 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-beorn7-perks.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 Blake Mizerany 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-cespare-xxhash-v2.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Caleb Spare 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-davecgh-go-spew.txt: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-evanphx-json-patch.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Evan Phoenix 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of the Evan Phoenix nor the names of its contributors 13 | may be used to endorse or promote products derived from this software 14 | without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-form3tech-oss-jwt-go.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Dave Grijalva 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | 9 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-fsnotify-fsnotify.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 The Go Authors. All rights reserved. 2 | Copyright (c) 2012-2019 fsnotify Authors. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-gogo-protobuf.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, The GoGo Authors. All rights reserved. 2 | 3 | Protocol Buffers for Go with Gadgets 4 | 5 | Go support for Protocol Buffers - Google's data interchange format 6 | 7 | Copyright 2010 The Go Authors. All rights reserved. 8 | https://github.com/golang/protobuf 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are 12 | met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the following disclaimer 18 | in the documentation and/or other materials provided with the 19 | distribution. 20 | * Neither the name of Google Inc. nor the names of its 21 | contributors may be used to endorse or promote products derived from 22 | this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | 36 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-golang-protobuf.txt: -------------------------------------------------------------------------------- 1 | Copyright 2010 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-google-go-cmp.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-google-uuid.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009,2014 Google Inc. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-imdario-mergo.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Dario Castañé. All rights reserved. 2 | Copyright (c) 2012 The Go Authors. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-json-iterator-go.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 json-iterator 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-nxadm-tail.txt: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | 3 | # © Copyright 2015 Hewlett Packard Enterprise Development LP 4 | Copyright (c) 2014 ActiveState 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-onsi-ginkgo.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Onsi Fakhouri 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-onsi-gomega.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Onsi Fakhouri 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-pkg-errors.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Dave Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /dist/licenses/license-github.com-spf13-pflag.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Alex Ogier. All rights reserved. 2 | Copyright (c) 2012 The Go Authors. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /dist/licenses/license-go.uber.org-atomic.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Uber Technologies, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist/licenses/license-go.uber.org-multierr.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Uber Technologies, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist/licenses/license-go.uber.org-zap.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016-2017 Uber Technologies, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist/licenses/license-golang.org-x-crypto.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /dist/licenses/license-golang.org-x-net.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /dist/licenses/license-golang.org-x-oauth2.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /dist/licenses/license-golang.org-x-sys.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /dist/licenses/license-golang.org-x-term.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /dist/licenses/license-golang.org-x-text.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /dist/licenses/license-golang.org-x-time.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /dist/licenses/license-google.golang.org-protobuf.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /dist/licenses/license-gopkg.in-inf.v0.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Péter Surányi. Portions Copyright (c) 2009 The Go 2 | Authors. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /dist/licenses/license-gopkg.in-tomb.v1.txt: -------------------------------------------------------------------------------- 1 | tomb - support for clean goroutine termination in Go. 2 | 3 | Copyright (c) 2010-2011 - Gustavo Niemeyer 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | * Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 23 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /dist/licenses/license-gopkg.in-yaml.v3.txt: -------------------------------------------------------------------------------- 1 | 2 | This project is covered by two different licenses: MIT and Apache. 3 | 4 | #### MIT License #### 5 | 6 | The following files were ported to Go from C files of libyaml, and thus 7 | are still covered by their original MIT license, with the additional 8 | copyright staring in 2011 when the project was ported over: 9 | 10 | apic.go emitterc.go parserc.go readerc.go scannerc.go 11 | writerc.go yamlh.go yamlprivateh.go 12 | 13 | Copyright (c) 2006-2010 Kirill Simonov 14 | Copyright (c) 2006-2011 Kirill Simonov 15 | 16 | Permission is hereby granted, free of charge, to any person obtaining a copy of 17 | this software and associated documentation files (the "Software"), to deal in 18 | the Software without restriction, including without limitation the rights to 19 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 20 | of the Software, and to permit persons to whom the Software is furnished to do 21 | so, subject to the following conditions: 22 | 23 | The above copyright notice and this permission notice shall be included in all 24 | copies or substantial portions of the Software. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 29 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 30 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 31 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 32 | SOFTWARE. 33 | 34 | ### Apache License ### 35 | 36 | All the remaining project files are covered by the Apache license: 37 | 38 | Copyright (c) 2011-2019 Canonical Ltd 39 | 40 | Licensed under the Apache License, Version 2.0 (the "License"); 41 | you may not use this file except in compliance with the License. 42 | You may obtain a copy of the License at 43 | 44 | http://www.apache.org/licenses/LICENSE-2.0 45 | 46 | Unless required by applicable law or agreed to in writing, software 47 | distributed under the License is distributed on an "AS IS" BASIS, 48 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 49 | See the License for the specific language governing permissions and 50 | limitations under the License. 51 | -------------------------------------------------------------------------------- /dist/licenses/license-sigs.k8s.io-yaml.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Sam Ghods 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | 24 | Copyright (c) 2012 The Go Authors. All rights reserved. 25 | 26 | Redistribution and use in source and binary forms, with or without 27 | modification, are permitted provided that the following conditions are 28 | met: 29 | 30 | * Redistributions of source code must retain the above copyright 31 | notice, this list of conditions and the following disclaimer. 32 | * Redistributions in binary form must reproduce the above 33 | copyright notice, this list of conditions and the following disclaimer 34 | in the documentation and/or other materials provided with the 35 | distribution. 36 | * Neither the name of Google Inc. nor the names of its 37 | contributors may be used to endorse or promote products derived from 38 | this software without specific prior written permission. 39 | 40 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 41 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 42 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 43 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 44 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 46 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 47 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 48 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 49 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 50 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51 | -------------------------------------------------------------------------------- /dist/release-operator.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module dolphinscheduler-operator 2 | 3 | go 1.17 4 | 5 | require ( 6 | github.com/onsi/ginkgo v1.16.5 7 | github.com/onsi/gomega v1.17.0 8 | k8s.io/api v0.23.0 9 | k8s.io/apimachinery v0.23.0 10 | k8s.io/client-go v0.23.0 11 | sigs.k8s.io/controller-runtime v0.11.0 12 | ) 13 | 14 | require ( 15 | cloud.google.com/go v0.81.0 // indirect 16 | github.com/Azure/go-autorest v14.2.0+incompatible // indirect 17 | github.com/Azure/go-autorest/autorest v0.11.18 // indirect 18 | github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect 19 | github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect 20 | github.com/Azure/go-autorest/logger v0.2.1 // indirect 21 | github.com/Azure/go-autorest/tracing v0.6.0 // indirect 22 | github.com/beorn7/perks v1.0.1 // indirect 23 | github.com/cespare/xxhash/v2 v2.1.1 // indirect 24 | github.com/davecgh/go-spew v1.1.1 // indirect 25 | github.com/evanphx/json-patch v4.12.0+incompatible // indirect 26 | github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect 27 | github.com/fsnotify/fsnotify v1.5.1 // indirect 28 | github.com/go-logr/logr v1.2.0 // indirect 29 | github.com/go-logr/zapr v1.2.0 // indirect 30 | github.com/gogo/protobuf v1.3.2 // indirect 31 | github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect 32 | github.com/golang/protobuf v1.5.2 // indirect 33 | github.com/google/go-cmp v0.5.5 // indirect 34 | github.com/google/gofuzz v1.1.0 // indirect 35 | github.com/google/uuid v1.1.2 // indirect 36 | github.com/googleapis/gnostic v0.5.5 // indirect 37 | github.com/imdario/mergo v0.3.12 // indirect 38 | github.com/json-iterator/go v1.1.12 // indirect 39 | github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect 40 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 41 | github.com/modern-go/reflect2 v1.0.2 // indirect 42 | github.com/nxadm/tail v1.4.8 // indirect 43 | github.com/pkg/errors v0.9.1 // indirect 44 | github.com/prometheus/client_golang v1.11.0 // indirect 45 | github.com/prometheus/client_model v0.2.0 // indirect 46 | github.com/prometheus/common v0.28.0 // indirect 47 | github.com/prometheus/procfs v0.6.0 // indirect 48 | github.com/spf13/pflag v1.0.5 // indirect 49 | go.uber.org/atomic v1.7.0 // indirect 50 | go.uber.org/multierr v1.6.0 // indirect 51 | go.uber.org/zap v1.19.1 // indirect 52 | golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect 53 | golang.org/x/net v0.0.0-20210825183410-e898025ed96a // indirect 54 | golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect 55 | golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect 56 | golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect 57 | golang.org/x/text v0.3.7 // indirect 58 | golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect 59 | gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect 60 | google.golang.org/appengine v1.6.7 // indirect 61 | google.golang.org/protobuf v1.27.1 // indirect 62 | gopkg.in/inf.v0 v0.9.1 // indirect 63 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect 64 | gopkg.in/yaml.v2 v2.4.0 // indirect 65 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect 66 | k8s.io/apiextensions-apiserver v0.23.0 // indirect 67 | k8s.io/component-base v0.23.0 // indirect 68 | k8s.io/klog/v2 v2.30.0 // indirect 69 | k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect 70 | k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect 71 | sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect 72 | sigs.k8s.io/structured-merge-diff/v4 v4.2.0 // indirect 73 | sigs.k8s.io/yaml v1.3.0 // indirect 74 | ) 75 | -------------------------------------------------------------------------------- /hack/boilerplate.go.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package main 19 | 20 | import ( 21 | "flag" 22 | "os" 23 | 24 | // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) 25 | // to ensure that exec-entrypoint and run can make use of them. 26 | _ "k8s.io/client-go/plugin/pkg/client/auth" 27 | 28 | "k8s.io/apimachinery/pkg/runtime" 29 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 30 | clientgoscheme "k8s.io/client-go/kubernetes/scheme" 31 | ctrl "sigs.k8s.io/controller-runtime" 32 | "sigs.k8s.io/controller-runtime/pkg/healthz" 33 | "sigs.k8s.io/controller-runtime/pkg/log/zap" 34 | 35 | dsv1alpha1 "dolphinscheduler-operator/api/v1alpha1" 36 | "dolphinscheduler-operator/controllers" 37 | //+kubebuilder:scaffold:imports 38 | ) 39 | 40 | var ( 41 | scheme = runtime.NewScheme() 42 | setupLog = ctrl.Log.WithName("setup") 43 | ) 44 | 45 | func init() { 46 | utilruntime.Must(clientgoscheme.AddToScheme(scheme)) 47 | 48 | utilruntime.Must(dsv1alpha1.AddToScheme(scheme)) 49 | //+kubebuilder:scaffold:scheme 50 | } 51 | 52 | func main() { 53 | var metricsAddr string 54 | var enableLeaderElection bool 55 | var probeAddr string 56 | flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") 57 | flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") 58 | flag.BoolVar(&enableLeaderElection, "leader-elect", false, 59 | "Enable leader election for controller manager. "+ 60 | "Enabling this will ensure there is only one active controller manager.") 61 | opts := zap.Options{ 62 | Development: true, 63 | } 64 | opts.BindFlags(flag.CommandLine) 65 | flag.Parse() 66 | 67 | ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts))) 68 | 69 | mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ 70 | Scheme: scheme, 71 | MetricsBindAddress: metricsAddr, 72 | Port: 9443, 73 | HealthProbeBindAddress: probeAddr, 74 | LeaderElection: enableLeaderElection, 75 | LeaderElectionID: "c8424b0b.apache.dolphinscheduler.dev", 76 | }) 77 | if err != nil { 78 | setupLog.Error(err, "unable to start manager") 79 | os.Exit(1) 80 | } 81 | 82 | if err = (&controllers.DSMasterReconciler{ 83 | Client: mgr.GetClient(), 84 | Scheme: mgr.GetScheme(), 85 | }).SetupWithManager(mgr); err != nil { 86 | setupLog.Error(err, "unable to create controller", "controller", "DSMaster") 87 | os.Exit(1) 88 | } 89 | if err = (&controllers.DSWorkerReconciler{ 90 | Client: mgr.GetClient(), 91 | Scheme: mgr.GetScheme(), 92 | }).SetupWithManager(mgr); err != nil { 93 | setupLog.Error(err, "unable to create controller", "controller", "DSWorker") 94 | os.Exit(1) 95 | } 96 | if err = (&controllers.DSAlertReconciler{ 97 | Client: mgr.GetClient(), 98 | Scheme: mgr.GetScheme(), 99 | }).SetupWithManager(mgr); err != nil { 100 | setupLog.Error(err, "unable to create controller", "controller", "DSAlert") 101 | os.Exit(1) 102 | } 103 | if err = (&controllers.DSApiReconciler{ 104 | Client: mgr.GetClient(), 105 | Scheme: mgr.GetScheme(), 106 | }).SetupWithManager(mgr); err != nil { 107 | setupLog.Error(err, "unable to create controller", "controller", "DSApi") 108 | os.Exit(1) 109 | } 110 | //if os.Getenv("ENABLE_WEBHOOKS") != "false" { 111 | // if err = (&dsv1alpha1.DSMaster{}).SetupWebhookWithManager(mgr); err != nil { 112 | // setupLog.Error(err, "unable to create webhook", "webhook", "DSMaster") 113 | // os.Exit(1) 114 | // } 115 | //} 116 | //+kubebuilder:scaffold:builder 117 | 118 | if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil { 119 | setupLog.Error(err, "unable to set up health check") 120 | os.Exit(1) 121 | } 122 | if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil { 123 | setupLog.Error(err, "unable to set up ready check") 124 | os.Exit(1) 125 | } 126 | 127 | setupLog.Info("starting manager") 128 | if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { 129 | setupLog.Error(err, "problem running manager") 130 | os.Exit(1) 131 | } 132 | } 133 | --------------------------------------------------------------------------------