├── NOTICE ├── dist └── NOTICE ├── operator ├── dist │ └── LICENSE.tpl ├── hack │ └── boilerplate.go.txt ├── config │ ├── prometheus │ │ ├── kustomization.yaml │ │ └── monitor.yaml │ ├── certmanager │ │ ├── kustomization.yaml │ │ ├── kustomizeconfig.yaml │ │ └── certificate.yaml │ ├── rbac │ │ ├── service_account.yaml │ │ ├── auth_proxy_client_clusterrole.yaml │ │ ├── role_patch.yaml │ │ ├── role_binding.yaml │ │ ├── auth_proxy_role_binding.yaml │ │ ├── leader_election_role_binding.yaml │ │ ├── auth_proxy_service.yaml │ │ ├── auth_proxy_role.yaml │ │ ├── ui_viewer_role.yaml │ │ ├── fetcher_viewer_role.yaml │ │ ├── storage_viewer_role.yaml │ │ ├── swagent_viewer_role.yaml │ │ ├── javaagent_viewer_role.yaml │ │ ├── oapserver_viewer_role.yaml │ │ ├── satellite_viewer_role.yaml │ │ ├── oapserverconfig_viewer_role.yaml │ │ ├── ui_editor_role.yaml │ │ ├── swagent_editor_role.yaml │ │ ├── fetcher_editor_role.yaml │ │ ├── storage_editor_role.yaml │ │ ├── javaagent_editor_role.yaml │ │ ├── oapserver_editor_role.yaml │ │ ├── oapserverdynamicconfig_viewer_role.yaml │ │ ├── satellite_editor_role.yaml │ │ ├── oapserverconfig_editor_role.yaml │ │ ├── oapserverdynamicconfig_editor_role.yaml │ │ ├── leader_election_role.yaml │ │ ├── operator_eventexporter_viewer_role.yaml │ │ ├── operator_eventexporter_editor_role.yaml │ │ └── kustomization.yaml │ ├── webhook │ │ ├── kustomization.yaml │ │ ├── service.yaml │ │ ├── ns_selector_patch.yaml │ │ └── kustomizeconfig.yaml │ ├── samples │ │ ├── satellite.yaml │ │ ├── minimal.yaml │ │ ├── banyandb.yaml │ │ ├── swagent.yaml │ │ ├── default.yaml │ │ ├── fetcher.yaml │ │ └── eventexporter.yaml │ ├── manager │ │ ├── controller_manager_config.yaml │ │ └── kustomization.yaml │ ├── crd │ │ ├── patches │ │ │ ├── cainjection_in_uis.yaml │ │ │ ├── cainjection_in_fetchers.yaml │ │ │ ├── cainjection_in_storages.yaml │ │ │ ├── cainjection_in_swagents.yaml │ │ │ ├── cainjection_in_javaagents.yaml │ │ │ ├── cainjection_in_oapservers.yaml │ │ │ ├── cainjection_in_satellites.yaml │ │ │ ├── cainjection_in_oapserverconfigs.yaml │ │ │ ├── cainjection_in_operator_eventexporters.yaml │ │ │ ├── cainjection_in_oapserverdynamicconfigs.yaml │ │ │ ├── webhook_in_uis.yaml │ │ │ ├── webhook_in_fetchers.yaml │ │ │ ├── webhook_in_storages.yaml │ │ │ ├── webhook_in_swagents.yaml │ │ │ ├── webhook_in_javaagents.yaml │ │ │ ├── webhook_in_oapservers.yaml │ │ │ ├── webhook_in_satellites.yaml │ │ │ ├── webhook_in_oapserverconfigs.yaml │ │ │ ├── webhook_in_operator_eventexporters.yaml │ │ │ └── webhook_in_oapserverdynamicconfigs.yaml │ │ └── kustomizeconfig.yaml │ └── default │ │ ├── manager_config_patch.yaml │ │ ├── manager_webhook_patch.yaml │ │ ├── webhookcainjection_patch.yaml │ │ └── manager_auth_proxy_patch.yaml ├── pkg │ └── operator │ │ └── manifests │ │ ├── fetcher │ │ └── templates │ │ │ ├── service_account.yaml │ │ │ ├── cluster_role.yaml │ │ │ └── cluster_role_binding.yaml │ │ ├── oapserver │ │ └── templates │ │ │ ├── service_account.yaml │ │ │ ├── cluster_role_binding.yaml │ │ │ ├── cluster_role.yaml │ │ │ └── ingress.yaml │ │ ├── banyandb │ │ └── templates │ │ │ ├── service_account.yaml │ │ │ ├── ingress.yaml │ │ │ └── http_service.yaml │ │ ├── eventexporter │ │ └── templates │ │ │ ├── service_account.yaml │ │ │ ├── cluster_role_binding.yaml │ │ │ └── cluster_role.yaml │ │ ├── satellite │ │ └── templates │ │ │ ├── service_account.yaml │ │ │ ├── cluster_role.yaml │ │ │ ├── cluster_role_binding.yaml │ │ │ └── service.yaml │ │ ├── storage │ │ └── elasticsearch │ │ │ └── templates │ │ │ ├── service_account.yaml │ │ │ └── service.yaml │ │ ├── injector │ │ └── templates │ │ │ └── javaagent.yaml │ │ └── ui │ │ └── templates │ │ ├── service.yaml │ │ └── ingress.yaml ├── apis │ └── operator │ │ └── v1alpha1 │ │ └── groupversion_info.go └── Dockerfile ├── adapter ├── dist │ └── LICENSE.tpl ├── config │ ├── namespaced │ │ ├── apiservice │ │ │ ├── kustomization.yaml │ │ │ └── external.yaml │ │ ├── adapter │ │ │ └── kustomization.yaml │ │ ├── kustomization.yaml │ │ └── rbac │ │ │ ├── custom_metrics_cluster_role.yaml │ │ │ ├── kustomization.yaml │ │ │ ├── custom_metrics_resource_reader_cluster_role.yaml │ │ │ ├── apiserver_auth_delegator_cluster_role_binding.yaml │ │ │ ├── apiserver_resource_reader_cluster_role_binding.yaml.yaml │ │ │ └── hpa_custom_metrics_cluster_role_binding.yaml │ ├── kustomization.yaml │ └── apiserver_auth_reader_role_binding.yaml ├── pkg │ └── api │ │ └── openapi-gen.go └── Dockerfile ├── docs ├── README.md ├── examples │ ├── istio-controlplane.md │ └── default-backend.md └── binary-readme.md ├── test └── e2e │ ├── verify │ ├── affinity.yaml │ ├── replicas.yaml │ ├── satellite-replicas.yaml │ ├── indices.yaml │ ├── swagent-volumemount.yaml │ ├── bootstrap-plugin.yaml │ ├── optional-plugin.yaml │ ├── endpoint.yaml │ ├── eventexporter-event.yaml │ ├── swagent-initcontainer.yaml │ ├── hpa-metrics.yaml │ ├── metrics.yaml │ ├── service-apdex.yaml │ ├── satellite-hpa-metrics.yaml │ ├── service.yaml │ ├── swagent-target-container.yaml │ ├── swagent-configmap-target-container.yaml │ └── swagent-configmap-initcontainer.yaml │ ├── kind.yaml │ ├── external-storage.yaml │ ├── internal-storage.yaml │ ├── ui-cases.yaml │ ├── hpa-demo.yaml │ ├── satellite-hpa-demo.yaml │ ├── deploy-elasticsearch.yaml │ ├── skywalking-components-with-storage.yaml │ ├── skywalking-components.yaml │ ├── skywalking-components-with-banyandb.yaml │ ├── oapserver-cases.yaml │ ├── demo-swagent.yaml │ └── resource.yaml ├── hack ├── boilerplate.go.txt ├── build-header.sh └── install-kubebuilder.sh ├── .dockerignore ├── .github └── dependabot.yml ├── .asf.yaml ├── .gitignore └── golangci.yml /NOTICE: -------------------------------------------------------------------------------- 1 | Apache SkyWalking 2 | Copyright 2017-2021 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /dist/NOTICE: -------------------------------------------------------------------------------- 1 | Apache SkyWalking 2 | Copyright 2017-2021 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /operator/dist/LICENSE.tpl: -------------------------------------------------------------------------------- 1 | {{.LicenseContent }} 2 | {{ range .Groups }} 3 | ======================================================================== 4 | {{.LicenseID}} licenses 5 | ======================================================================== 6 | {{range .Deps}} 7 | {{.Name}} {{.Version}} {{.LicenseID}} 8 | {{- end }} 9 | {{ end }} 10 | -------------------------------------------------------------------------------- /adapter/dist/LICENSE.tpl: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | Metric Adapter related licenses 3 | ======================================================================== 4 | 5 | The following components are used in the metric adapter.See project link for details. 6 | The text of each license is also included at licenses/adapter-licenses/LICENSE-[project].txt. 7 | {{ range .Groups }} 8 | ======================================================================== 9 | {{.LicenseID}} licenses 10 | ======================================================================== 11 | {{range .Deps}} 12 | {{.Name}} {{.Version}} {{.LicenseID}} 13 | {{- end }} 14 | {{ end }} 15 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | Welcome to Apache SkyWalking Cloud on Kubernetes Document Repository 2 | ============ 3 | 4 | Here you can lean all you need to know about Apache SkyWalking Cloud on Kubernetes(SWCK). This 5 | repository provides how to onboard and customize the agent injector, operator and adapter. 6 | 7 | * Design. Some materials regarding the design decision under the hood. 8 | * Setup. Several instruments to onboard the agent injector, operator and adapter. 9 | * Examples. A number of examples of how to use SWCK. 10 | 11 | We're always looking for help to improve our documentation and codes, so please don’t hesitate to file an issue 12 | if you see any problems. Or better yet, directly contribute by submitting a pull request to help us get better! 13 | 14 | -------------------------------------------------------------------------------- /test/e2e/verify/affinity.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | kind-control-plane 17 | -------------------------------------------------------------------------------- /hack/boilerplate.go.txt: -------------------------------------------------------------------------------- 1 | // Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // 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. -------------------------------------------------------------------------------- /operator/hack/boilerplate.go.txt: -------------------------------------------------------------------------------- 1 | // Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // 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. -------------------------------------------------------------------------------- /test/e2e/verify/replicas.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains . }} 17 | - key: "replicas" 18 | value: 3 19 | {{- end }} -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | bin/ 19 | testbin/ 20 | build/bin 21 | build/release/ 22 | -------------------------------------------------------------------------------- /test/e2e/verify/satellite-replicas.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains . }} 17 | - key: "replicas" 18 | value: 3 19 | {{- end }} -------------------------------------------------------------------------------- /operator/config/prometheus/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /test/e2e/verify/indices.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains . }} 17 | - key: "indices" 18 | value: {{ notEmpty .value }} 19 | {{- end }} -------------------------------------------------------------------------------- /test/e2e/verify/swagent-volumemount.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains .}} 17 | - emptyDir: {} 18 | name: sky-agent-test-002 19 | {{- end}} -------------------------------------------------------------------------------- /adapter/config/namespaced/apiservice/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | - external.yaml 20 | -------------------------------------------------------------------------------- /test/e2e/verify/bootstrap-plugin.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains . }} 17 | - key: {{ ge .key 0 }} 18 | value: {{ notEmpty .value }} 19 | {{- end }} -------------------------------------------------------------------------------- /test/e2e/verify/optional-plugin.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains . }} 17 | - key: {{ ge .key 0 }} 18 | value: {{ notEmpty .value }} 19 | {{- end }} -------------------------------------------------------------------------------- /test/e2e/verify/endpoint.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains .}} 17 | - id: {{ b64enc "Your_ApplicationName" }}.1_{{ b64enc "GET:/hello" }} 18 | name: 'GET:/hello' 19 | {{- end}} -------------------------------------------------------------------------------- /operator/config/certmanager/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /operator/config/rbac/service_account.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /adapter/config/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | namePrefix: skywalking-custom-metrics- 19 | 20 | resources: 21 | - namespaced 22 | - apiserver_auth_reader_role_binding.yaml 23 | -------------------------------------------------------------------------------- /test/e2e/verify/eventexporter-event.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains . }} 17 | - service: demo 18 | name: Pulled 19 | - service: demo 20 | name: Started 21 | - service: demo 22 | name: Created 23 | {{- end}} -------------------------------------------------------------------------------- /test/e2e/verify/swagent-initcontainer.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains .}} 17 | - image: apache/skywalking-java-agent:8.16.0-java8 18 | name: swagent-002 19 | volumeMounts: 20 | - montPath: /sky/agent 21 | name: sky-agent-test-002 22 | {{- end}} -------------------------------------------------------------------------------- /operator/config/webhook/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | 25 | patchesStrategicMerge: 26 | - ns_selector_patch.yaml -------------------------------------------------------------------------------- /test/e2e/verify/hpa-metrics.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains . }} 17 | - key: {{ notEmpty .key }} 18 | value: 19 | value: 0 20 | isemptyvalue: true 21 | - key: {{ notEmpty .key }} 22 | value: 23 | value: {{ gt .value.value 15 }} 24 | isemptyvalue: false 25 | {{- end }} -------------------------------------------------------------------------------- /test/e2e/verify/metrics.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains . }} 17 | - key: {{ notEmpty .key }} 18 | value: 19 | value: {{ gt .value.value 0 }} 20 | isemptyvalue: false 21 | - key: {{ notEmpty .key }} 22 | value: 23 | value: 0 24 | isemptyvalue: true 25 | {{- end }} -------------------------------------------------------------------------------- /test/e2e/verify/service-apdex.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains . }} 17 | - key: {{ notEmpty .key }} 18 | value: 19 | value: 0 20 | isemptyvalue: true 21 | - key: {{ notEmpty .key }} 22 | value: 23 | value: {{ gt .value.value 0 }} 24 | isemptyvalue: false 25 | {{- end }} -------------------------------------------------------------------------------- /operator/config/rbac/auth_proxy_client_clusterrole.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /test/e2e/verify/satellite-hpa-metrics.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains . }} 17 | - key: {{ notEmpty .key }} 18 | value: 19 | value: 0 20 | isemptyvalue: true 21 | - key: {{ notEmpty .key }} 22 | value: 23 | value: {{ ge .value.value 4 }} 24 | isemptyvalue: false 25 | {{- end }} -------------------------------------------------------------------------------- /test/e2e/verify/service.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | {{- contains . }} 19 | - id: {{ b64enc "Your_ApplicationName" }}.1 20 | name: Your_ApplicationName 21 | group: "" 22 | shortname: "Your_ApplicationName" 23 | layers: 24 | - GENERAL 25 | normal: true 26 | {{- end }} -------------------------------------------------------------------------------- /adapter/config/namespaced/adapter/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | - adapter.yaml 20 | apiVersion: kustomize.config.k8s.io/v1beta1 21 | kind: Kustomization 22 | images: 23 | - name: metrics-adapter 24 | newName: apache/skywalking-swck 25 | newTag: v0.8.0 26 | -------------------------------------------------------------------------------- /operator/config/rbac/role_patch.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | - op: add 19 | path: /rules/0 20 | value: 21 | apiGroups: 22 | - certificates.k8s.io 23 | resources: 24 | - signers 25 | resourceNames: 26 | - kubernetes.io/* 27 | verbs: 28 | - approve 29 | -------------------------------------------------------------------------------- /test/e2e/verify/swagent-target-container.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains .}} 17 | env: 18 | - name: JAVA_TOOL_OPTIONS 19 | value: -javaagent:/sky/agent/skywalking-agent.jar 20 | - name: SW_LOGGING_LEVEL 21 | value: "DEBUG" 22 | volumeMounts: 23 | - mountPath: /sky/agent 24 | name: sky-agent-test-002 25 | {{- end}} 26 | -------------------------------------------------------------------------------- /test/e2e/verify/swagent-configmap-target-container.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains .}} 17 | env: 18 | - name: JAVA_TOOL_OPTIONS 19 | value: -javaagent:/sky/agent/skywalking-agent.jar 20 | - name: SW_LOGGING_LEVEL 21 | value: "DEBUG" 22 | volumeMounts: 23 | - mountPath: /sky/agent 24 | name: sky-agent-test-001 25 | {{- end}} 26 | -------------------------------------------------------------------------------- /operator/config/webhook/service.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /test/e2e/verify/swagent-configmap-initcontainer.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | {{- contains .}} 17 | - image: apache/skywalking-java-agent:8.16.0-java8 18 | name: swagent-001 19 | volumeMounts: 20 | - montPath: /sky/agent 21 | name: sky-agent-test-001 22 | - mountPath: /sky/agent/config 23 | name: java-agent-configmap-test-001-volume 24 | {{- end}} -------------------------------------------------------------------------------- /adapter/config/namespaced/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | # If you update the namespace, ../apiserver_auth_reader_role_binding_patch.yaml should be changed correspondingly. 20 | namespace: skywalking-custom-metrics-system 21 | 22 | resources: 23 | - rbac 24 | - adapter 25 | - apiservice 26 | -------------------------------------------------------------------------------- /operator/config/samples/satellite.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: operator.skywalking.apache.org/v1alpha1 20 | kind: Satellite 21 | metadata: 22 | name: default 23 | spec: 24 | version: 0.4.0 25 | instances: 1 26 | image: apache/skywalking-satellite:v0.4.0 27 | service: 28 | template: 29 | type: ClusterIP -------------------------------------------------------------------------------- /adapter/config/namespaced/rbac/custom_metrics_cluster_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: server-resources 22 | rules: 23 | - apiGroups: 24 | - custom.metrics.k8s.io 25 | - external.metrics.k8s.io 26 | resources: ["*"] 27 | verbs: ["*"] 28 | -------------------------------------------------------------------------------- /adapter/config/namespaced/rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | - apiserver_auth_delegator_cluster_role_binding.yaml 20 | - apiserver_resource_reader_cluster_role_binding.yaml.yaml 21 | - custom_metrics_cluster_role.yaml 22 | - custom_metrics_resource_reader_cluster_role.yaml 23 | - hpa_custom_metrics_cluster_role_binding.yaml -------------------------------------------------------------------------------- /test/e2e/kind.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # this config file contains all config fields with comments 17 | # NOTE: this is not a particularly useful config file 18 | kind: Cluster 19 | apiVersion: kind.x-k8s.io/v1alpha4 20 | # control plane node 21 | nodes: 22 | - role: control-plane 23 | image: kindest/node:v1.21.10 24 | - role: worker 25 | image: kindest/node:v1.21.10 26 | 27 | -------------------------------------------------------------------------------- /operator/config/rbac/role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /adapter/pkg/api/openapi-gen.go: -------------------------------------------------------------------------------- 1 | //go:build codegen 2 | // +build codegen 3 | 4 | // Licensed to Apache Software Foundation (ASF) under one or more contributor 5 | // license agreements. See the NOTICE file distributed with 6 | // this work for additional information regarding copyright 7 | // ownership. Apache Software Foundation (ASF) licenses this file to you under 8 | // the Apache License, Version 2.0 (the "License"); you may 9 | // not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, 15 | // software distributed under the License is distributed on an 16 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | // KIND, either express or implied. See the License for the 18 | // specific language governing permissions and limitations 19 | // under the License. 20 | 21 | // Package is only a stub to ensure k8s.io/kube-openapi/cmd/openapi-gen is vendored 22 | // so the same version of kube-openapi is used to generate and render the openapi spec 23 | 24 | package main 25 | 26 | import ( 27 | _ "k8s.io/kube-openapi/cmd/openapi-gen" 28 | ) 29 | -------------------------------------------------------------------------------- /operator/config/manager/controller_manager_config.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: v1alpha1.swck.skywalking.apache.org 29 | -------------------------------------------------------------------------------- /operator/config/rbac/auth_proxy_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /operator/config/crd/patches/cainjection_in_uis.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: uis.operator.skywalking.apache.org 25 | -------------------------------------------------------------------------------- /operator/config/samples/minimal.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: operator.skywalking.apache.org/v1alpha1 19 | kind: OAPServer 20 | metadata: 21 | name: minimal 22 | spec: 23 | version: 9.1.0 24 | instances: 1 25 | 26 | --- 27 | apiVersion: operator.skywalking.apache.org/v1alpha1 28 | kind: UI 29 | metadata: 30 | name: minimal 31 | spec: 32 | version: 9.1.0 33 | instances: 1 34 | -------------------------------------------------------------------------------- /operator/config/rbac/leader_election_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /adapter/config/namespaced/rbac/custom_metrics_resource_reader_cluster_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: resource-reader 22 | rules: 23 | - apiGroups: 24 | - "" 25 | resources: 26 | - pods 27 | - nodes 28 | - nodes/stats 29 | verbs: 30 | - get 31 | - list 32 | - watch 33 | -------------------------------------------------------------------------------- /operator/config/crd/patches/cainjection_in_fetchers.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: fetchers.operator.skywalking.apache.org 25 | -------------------------------------------------------------------------------- /operator/config/crd/patches/cainjection_in_storages.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: storages.operator.skywalking.apache.org 25 | -------------------------------------------------------------------------------- /operator/config/crd/patches/cainjection_in_swagents.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: swagents.operator.skywalking.apache.org 25 | -------------------------------------------------------------------------------- /adapter/config/namespaced/rbac/apiserver_auth_delegator_cluster_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: system:auth-delegator 22 | roleRef: 23 | apiGroup: rbac.authorization.k8s.io 24 | kind: ClusterRole 25 | name: system:auth-delegator 26 | subjects: 27 | - kind: ServiceAccount 28 | name: apiserver 29 | 30 | -------------------------------------------------------------------------------- /adapter/config/namespaced/rbac/apiserver_resource_reader_cluster_role_binding.yaml.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: resource-reader 22 | roleRef: 23 | apiGroup: rbac.authorization.k8s.io 24 | kind: ClusterRole 25 | name: resource-reader 26 | subjects: 27 | - kind: ServiceAccount 28 | name: apiserver 29 | 30 | -------------------------------------------------------------------------------- /operator/config/crd/patches/cainjection_in_javaagents.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: javaagents.operator.skywalking.apache.org 25 | -------------------------------------------------------------------------------- /operator/config/crd/patches/cainjection_in_oapservers.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: oapservers.operator.skywalking.apache.org 25 | -------------------------------------------------------------------------------- /operator/config/crd/patches/cainjection_in_satellites.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: satellites.operator.skywalking.apache.org 25 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/fetcher/templates/service_account.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: {{ .Name }}-fetcher 22 | namespace: {{ .Namespace }} 23 | labels: 24 | operator.skywalking.apache.org/fetcher-name: {{ .Name }} 25 | operator.skywalking.apache.org/application: fetcher 26 | operator.skywalking.apache.org/component: rbac 27 | -------------------------------------------------------------------------------- /operator/config/rbac/auth_proxy_service.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/oapserver/templates/service_account.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: {{ .Name }}-oap 22 | namespace: {{ .Namespace }} 23 | labels: 24 | operator.skywalking.apache.org/oap-server-name: {{ .Name }} 25 | operator.skywalking.apache.org/application: oapserver 26 | operator.skywalking.apache.org/component: rbac 27 | 28 | -------------------------------------------------------------------------------- /operator/config/crd/patches/cainjection_in_oapserverconfigs.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: oapserverconfigs.operator.skywalking.apache.org 25 | -------------------------------------------------------------------------------- /operator/config/rbac/auth_proxy_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/banyandb/templates/service_account.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: {{ .Name }}-banyandb 22 | namespace: {{ .Namespace }} 23 | labels: 24 | operator.skywalking.apache.org/oap-server-name: {{ .Name }} 25 | operator.skywalking.apache.org/application: banyandb 26 | operator.skywalking.apache.org/component: rbac 27 | 28 | -------------------------------------------------------------------------------- /operator/config/crd/patches/cainjection_in_operator_eventexporters.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: eventexporters.operator.skywalking.apache.org 25 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/eventexporter/templates/service_account.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: {{ .Name }}-eventexporter 22 | namespace: {{ .Namespace }} 23 | labels: 24 | operator.skywalking.apache.org/fetcher-name: {{ .Name }} 25 | operator.skywalking.apache.org/application: eventexporter 26 | operator.skywalking.apache.org/component: rbac 27 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/satellite/templates/service_account.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: {{ .Name }}-satellite 22 | namespace: {{ .Namespace }} 23 | labels: 24 | operator.skywalking.apache.org/satellite-server-name: {{ .Name }} 25 | operator.skywalking.apache.org/application: satellite 26 | operator.skywalking.apache.org/component: rbac 27 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/storage/elasticsearch/templates/service_account.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: {{ .Name }}-elasticsearch 22 | namespace: {{ .Namespace }} 23 | labels: 24 | operator.skywalking.apache.org/es-name: {{ .Name }} 25 | operator.skywalking.apache.org/application: elasticsearch 26 | operator.skywalking.apache.org/component: rbac 27 | -------------------------------------------------------------------------------- /adapter/config/namespaced/rbac/hpa_custom_metrics_cluster_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: hpa-controller 22 | roleRef: 23 | apiGroup: rbac.authorization.k8s.io 24 | kind: ClusterRole 25 | name: server-resources 26 | subjects: 27 | - kind: ServiceAccount 28 | name: horizontal-pod-autoscaler 29 | namespace: kube-system 30 | -------------------------------------------------------------------------------- /operator/config/crd/patches/cainjection_in_oapserverdynamicconfigs.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: oapserverdynamicconfigs.operator.skywalking.apache.org 25 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/satellite/templates/cluster_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: ClusterRole 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | metadata: 21 | name: swck:satellite 22 | labels: 23 | operator.skywalking.apache.org/application: satellite 24 | operator.skywalking.apache.org/component: rbac 25 | rules: 26 | - apiGroups: [""] 27 | resources: ["pods"] 28 | verbs: ["get", "watch", "list"] 29 | -------------------------------------------------------------------------------- /test/e2e/external-storage.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | apiVersion: operator.skywalking.apache.org/v1alpha1 17 | kind: Storage 18 | metadata: 19 | name: sample 20 | spec: 21 | type: elasticsearch 22 | connectType: external 23 | address: "http://es-out.default:9200" #please use your elasticsearch cluster's address 24 | version: latest 25 | resource: 26 | limit: "200m" 27 | requests: "100m" 28 | security: 29 | user: 30 | secretName: default 31 | 32 | -------------------------------------------------------------------------------- /test/e2e/internal-storage.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | apiVersion: operator.skywalking.apache.org/v1alpha1 17 | kind: Storage 18 | metadata: 19 | name: sample 20 | spec: 21 | type: elasticsearch 22 | connectType: internal 23 | version: 7.5.1 24 | instances: 1 25 | image: docker.elastic.co/elasticsearch/elasticsearch:7.5.1 26 | resource: 27 | limit: "200m" 28 | requests: "100m" 29 | security: 30 | user: 31 | secretName: default 32 | tls: true -------------------------------------------------------------------------------- /operator/config/manager/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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/skywalking-swck 33 | newTag: v0.8.0 34 | -------------------------------------------------------------------------------- /adapter/config/namespaced/apiservice/external.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: apiregistration.k8s.io/v1 19 | kind: APIService 20 | metadata: 21 | name: v1beta1.external.metrics.k8s.io 22 | spec: 23 | service: 24 | name: apiserver 25 | namespace: skywalking-custom-metrics-system 26 | group: external.metrics.k8s.io 27 | version: v1beta1 28 | insecureSkipTLSVerify: true 29 | groupPriorityMinimum: 100 30 | versionPriority: 100 31 | -------------------------------------------------------------------------------- /test/e2e/ui-cases.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | cases: 17 | # test ui 18 | - query: swctl --display yaml --base-url=http://${service_skywalking_system_ui_host}:${service_skywalking_system_ui_80}/graphql service ls 19 | expected: verify/service.yaml 20 | - query: swctl --display yaml --base-url=http://${service_skywalking_system_ui_host}:${service_skywalking_system_ui_80}/graphql endpoint list --keyword=hello --service-name Your_ApplicationName 21 | expected: verify/endpoint.yaml -------------------------------------------------------------------------------- /hack/build-header.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one or more 5 | # contributor license agreements. See the NOTICE file distributed with 6 | # this work for additional information regarding copyright ownership. 7 | # The ASF licenses this file to You under the Apache License, Version 2.0 8 | # (the "License"); you may not use this file except in compliance with 9 | # the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | set -ex 20 | 21 | SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 22 | 23 | [[ -z "$1" ]] && { echo "\nPlease call '$0 ' to run this command!\n"; exit 1; } 24 | TARGET=$1 25 | OUT=$(mktemp) || { echo "Failed to create temp file"; exit 1; } 26 | 27 | cat "${SCRIPTDIR}/boilerplate.go.txt" > "${OUT}" 28 | echo "" >> "${OUT}" 29 | cat "${TARGET}" >> "${OUT}" 30 | mv "${OUT}" "${TARGET}" 31 | -------------------------------------------------------------------------------- /operator/config/webhook/ns_selector_patch.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: admissionregistration.k8s.io/v1 19 | kind: MutatingWebhookConfiguration 20 | metadata: 21 | name: mutating-webhook-configuration 22 | webhooks: 23 | - clientConfig: 24 | service: 25 | name: webhook-service 26 | namespace: system 27 | path: /mutate-v1-pod 28 | name: mpod.kb.io 29 | namespaceSelector: 30 | matchLabels: 31 | swck-injection: enabled 32 | -------------------------------------------------------------------------------- /adapter/config/apiserver_auth_reader_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: auth-reader 22 | namespace: kube-system 23 | roleRef: 24 | apiGroup: rbac.authorization.k8s.io 25 | kind: Role 26 | name: extension-apiserver-authentication-reader 27 | subjects: 28 | - kind: ServiceAccount 29 | name: skywalking-custom-metrics-apiserver 30 | namespace: skywalking-custom-metrics-system 31 | 32 | -------------------------------------------------------------------------------- /operator/config/rbac/ui_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 uis. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: ui-viewer-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - uis 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - operator.skywalking.apache.org 34 | resources: 35 | - uis/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /operator/config/rbac/fetcher_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 fetchers. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: fetcher-viewer-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - fetchers 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - operator.skywalking.apache.org 34 | resources: 35 | - fetchers/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /operator/config/rbac/storage_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 storages. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: storage-viewer-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - storages 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - operator.skywalking.apache.org 34 | resources: 35 | - storages/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /operator/config/rbac/swagent_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 swagents. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: swagent-viewer-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - swagents 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - operator.skywalking.apache.org 34 | resources: 35 | - swagents/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /operator/config/rbac/javaagent_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 javaagents. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: javaagent-viewer-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - javaagents 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - operator.skywalking.apache.org 34 | resources: 35 | - javaagents/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /operator/config/rbac/oapserver_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 oapservers. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: oapserver-viewer-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - oapservers 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - operator.skywalking.apache.org 34 | resources: 35 | - oapservers/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /operator/config/rbac/satellite_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 satellites. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: satellite-viewer-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - satellites 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - operator.skywalking.apache.org 34 | resources: 35 | - satellites/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 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 | version: 2 18 | updates: 19 | - package-ecosystem: "gomod" 20 | directory: "/adapter" 21 | schedule: 22 | interval: "daily" 23 | assignees: 24 | - "kezhenxu94" 25 | groups: 26 | actions-deps: 27 | patterns: 28 | - "*" 29 | - package-ecosystem: "gomod" 30 | directory: "/operator" 31 | schedule: 32 | interval: "daily" 33 | assignees: 34 | - "kezhenxu94" 35 | groups: 36 | actions-deps: 37 | patterns: 38 | - "*" 39 | -------------------------------------------------------------------------------- /operator/config/certmanager/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /operator/config/crd/patches/webhook_in_uis.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: uis.operator.skywalking.apache.org 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 | -------------------------------------------------------------------------------- /operator/config/crd/patches/webhook_in_fetchers.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: fetchers.operator.skywalking.apache.org 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 | -------------------------------------------------------------------------------- /operator/config/crd/patches/webhook_in_storages.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: storages.operator.skywalking.apache.org 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 | -------------------------------------------------------------------------------- /operator/config/crd/patches/webhook_in_swagents.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: swagents.operator.skywalking.apache.org 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 | -------------------------------------------------------------------------------- /operator/config/crd/patches/webhook_in_javaagents.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: javaagents.operator.skywalking.apache.org 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 | -------------------------------------------------------------------------------- /operator/config/crd/patches/webhook_in_oapservers.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: oapservers.operator.skywalking.apache.org 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 | -------------------------------------------------------------------------------- /operator/config/crd/patches/webhook_in_satellites.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: satellites.operator.skywalking.apache.org 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 | -------------------------------------------------------------------------------- /operator/config/rbac/oapserverconfig_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 oapserverconfigs. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: oapserverconfig-viewer-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - oapserverconfigs 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - operator.skywalking.apache.org 34 | resources: 35 | - oapserverconfigs/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /operator/config/rbac/ui_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 uis. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: ui-editor-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - uis 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - operator.skywalking.apache.org 38 | resources: 39 | - uis/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/fetcher/templates/cluster_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: ClusterRole 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | metadata: 21 | name: swck:fetcher 22 | labels: 23 | operator.skywalking.apache.org/application: fetcher 24 | operator.skywalking.apache.org/component: rbac 25 | rules: 26 | - apiGroups: [""] 27 | resources: ["nodes", "nodes/proxy", "endpoints", "services", "pods"] 28 | verbs: ["get", "watch", "list"] 29 | - apiGroups: [""] 30 | resources: ["configmaps"] 31 | verbs: ["get"] 32 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/fetcher/templates/cluster_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: swck:fetcher 22 | labels: 23 | operator.skywalking.apache.org/application: fetcher 24 | operator.skywalking.apache.org/component: rbac 25 | roleRef: 26 | apiGroup: rbac.authorization.k8s.io 27 | kind: ClusterRole 28 | name: swck:fetcher 29 | subjects: 30 | - kind: ServiceAccount 31 | name: {{ .Name }}-fetcher 32 | namespace: {{ .Namespace }} 33 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/oapserver/templates/cluster_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: swck:oapserver 22 | labels: 23 | operator.skywalking.apache.org/application: oapserver 24 | operator.skywalking.apache.org/component: rbac 25 | roleRef: 26 | apiGroup: rbac.authorization.k8s.io 27 | kind: ClusterRole 28 | name: swck:oapserver 29 | subjects: 30 | - kind: ServiceAccount 31 | name: {{ .Name }}-oap 32 | namespace: {{ .Namespace }} 33 | -------------------------------------------------------------------------------- /operator/config/crd/patches/webhook_in_oapserverconfigs.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: oapserverconfigs.operator.skywalking.apache.org 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 | -------------------------------------------------------------------------------- /operator/config/crd/patches/webhook_in_operator_eventexporters.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: eventexporters.operator.skywalking.apache.org 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 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/satellite/templates/cluster_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: swck:satellite 22 | labels: 23 | operator.skywalking.apache.org/application: satellite 24 | operator.skywalking.apache.org/component: rbac 25 | roleRef: 26 | apiGroup: rbac.authorization.k8s.io 27 | kind: ClusterRole 28 | name: swck:satellite 29 | subjects: 30 | - kind: ServiceAccount 31 | name: {{ .Name }}-satellite 32 | namespace: {{ .Namespace }} 33 | -------------------------------------------------------------------------------- /operator/config/rbac/swagent_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 swagents. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: swagent-editor-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - swagents 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - operator.skywalking.apache.org 38 | resources: 39 | - swagents/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /operator/config/crd/patches/webhook_in_oapserverdynamicconfigs.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: oapserverdynamicconfigs.operator.skywalking.apache.org 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 | -------------------------------------------------------------------------------- /operator/config/rbac/fetcher_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 fetchers. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: fetcher-editor-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - fetchers 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - operator.skywalking.apache.org 38 | resources: 39 | - fetchers/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /operator/config/rbac/storage_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 storages. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: storage-editor-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - storages 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - operator.skywalking.apache.org 38 | resources: 39 | - storages/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /operator/config/rbac/javaagent_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 javaagents. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: javaagent-editor-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - javaagents 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - operator.skywalking.apache.org 38 | resources: 39 | - javaagents/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /operator/config/rbac/oapserver_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 oapservers. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: oapserver-editor-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - oapservers 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - operator.skywalking.apache.org 38 | resources: 39 | - oapservers/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /operator/config/rbac/oapserverdynamicconfig_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 oapserverdynamicconfigs. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: oapserverdynamicconfig-viewer-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - oapserverdynamicconfigs 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - operator.skywalking.apache.org 34 | resources: 35 | - oapserverdynamicconfigs/status 36 | verbs: 37 | - get 38 | -------------------------------------------------------------------------------- /operator/config/rbac/satellite_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 satellites. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: satellite-editor-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - satellites 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - operator.skywalking.apache.org 38 | resources: 39 | - satellites/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/eventexporter/templates/cluster_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: swck:eventexporter 22 | labels: 23 | operator.skywalking.apache.org/application: eventexporter 24 | operator.skywalking.apache.org/component: rbac 25 | roleRef: 26 | apiGroup: rbac.authorization.k8s.io 27 | kind: ClusterRole 28 | name: swck:eventexporter 29 | subjects: 30 | - kind: ServiceAccount 31 | name: {{ .Name }}-eventexporter 32 | namespace: {{ .Namespace }} 33 | -------------------------------------------------------------------------------- /hack/install-kubebuilder.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one or more 5 | # contributor license agreements. See the NOTICE file distributed with 6 | # this work for additional information regarding copyright ownership. 7 | # The ASF licenses this file to You under the Apache License, Version 2.0 8 | # (the "License"); you may not use this file except in compliance with 9 | # the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | set -ex 19 | 20 | os=$(go env GOOS) 21 | arch=$(go env GOARCH) 22 | export K8S_VERSION=1.19.2 23 | export PATH=$PATH:/usr/local/kubebuilder/bin 24 | sudo mkdir -p /usr/local/kubebuilder/bin 25 | curl -sSLo kubebuilder https://github.com/kubernetes-sigs/kubebuilder/releases/download/v3.2.0/kubebuilder_${os}_${arch} 26 | sudo mv ./kubebuilder /usr/local/bin/ 27 | 28 | curl -sSLo envtest-bins.tar.gz "https://go.kubebuilder.io/test-tools/${K8S_VERSION}/${os}/${arch}" 29 | sudo tar -C /usr/local/kubebuilder --strip-components=1 -zvxf envtest-bins.tar.gz -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/oapserver/templates/cluster_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: ClusterRole 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | metadata: 21 | name: swck:oapserver 22 | labels: 23 | operator.skywalking.apache.org/application: oapserver 24 | operator.skywalking.apache.org/component: rbac 25 | rules: 26 | - apiGroups: [""] 27 | resources: ["pods", "endpoints", "services", "configmaps"] 28 | verbs: ["get", "watch", "list"] 29 | - apiGroups: ["extensions"] 30 | resources: ["deployments", "replicasets"] 31 | verbs: ["get", "watch", "list"] 32 | -------------------------------------------------------------------------------- /operator/config/samples/banyandb.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: operator.skywalking.apache.org/v1alpha1 19 | kind: BanyanDB 20 | metadata: 21 | name: banyandb-sample 22 | spec: 23 | version: 1.0.9 24 | counts: 1 25 | image: apache/skywalking-banyandb:latest 26 | config: 27 | - "standalone" 28 | 29 | affinity: 30 | nodeAffinity: 31 | requiredDuringSchedulingIgnoredDuringExecution: 32 | nodeSelectorTerms: 33 | - matchExpressions: 34 | - key: storage 35 | operator: In 36 | values: 37 | - banyandb 38 | -------------------------------------------------------------------------------- /operator/config/rbac/oapserverconfig_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 oapserverconfigs. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: oapserverconfig-editor-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - oapserverconfigs 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - operator.skywalking.apache.org 38 | resources: 39 | - oapserverconfigs/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/eventexporter/templates/cluster_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: ClusterRole 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | metadata: 21 | name: swck:eventexporter 22 | labels: 23 | operator.skywalking.apache.org/application: eventexporter 24 | operator.skywalking.apache.org/component: rbac 25 | rules: 26 | - apiGroups: [""] 27 | resources: ["pods", "endpoints", "configmaps", "events", "services"] 28 | verbs: ["get", "watch", "list"] 29 | - apiGroups: ["extensions"] 30 | resources: ["deployments", "replicasets"] 31 | verbs: ["get", "watch", "list"] 32 | -------------------------------------------------------------------------------- /operator/config/prometheus/monitor.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /operator/config/default/manager_config_patch.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /operator/config/crd/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /operator/config/rbac/oapserverdynamicconfig_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 oapserverdynamicconfigs. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | name: oapserverdynamicconfig-editor-role 23 | rules: 24 | - apiGroups: 25 | - operator.skywalking.apache.org 26 | resources: 27 | - oapserverdynamicconfigs 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - operator.skywalking.apache.org 38 | resources: 39 | - oapserverdynamicconfigs/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /.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 SkyWalking Cloud on Kubernetes 20 | homepage: https://skywalking.apache.org/ 21 | labels: 22 | - skywalking 23 | - observability 24 | - apm 25 | - distributed-tracing 26 | - kubernetes 27 | - operator 28 | enabled_merge_buttons: 29 | squash: true 30 | merge: false 31 | rebase: false 32 | protected_branches: 33 | master: 34 | required_status_checks: 35 | strict: true 36 | contexts: 37 | - build 38 | required_pull_request_reviews: 39 | dismiss_stale_reviews: true 40 | required_approving_review_count: 1 41 | 42 | -------------------------------------------------------------------------------- /operator/config/samples/swagent.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: operator.skywalking.apache.org/v1alpha1 19 | kind: SwAgent 20 | metadata: 21 | name: swagent-sample 22 | spec: 23 | containerMatcher: '' 24 | selector: 25 | javaSidecar: 26 | name: swagent-sample 27 | image: apache/skywalking-java-agent:8.16.0-java8 28 | env: 29 | - name: "SW_LOGGING_LEVEL" 30 | value: "DEBUG" 31 | - name: "SW_AGENT_COLLECTOR_BACKEND_SERVICES" 32 | value: "skywalking-system-oap.skywalking-system.svc:11800" 33 | sharedVolumeName: "sky-agent-test-001" 34 | optionalPlugins: 35 | - "webflux" 36 | - "cloud-gateway-2.1.x" 37 | -------------------------------------------------------------------------------- /test/e2e/hpa-demo.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | apiVersion: autoscaling/v2beta2 17 | kind: HorizontalPodAutoscaler 18 | metadata: 19 | name: hpa-demo 20 | namespace: skywalking-system 21 | spec: 22 | scaleTargetRef: 23 | apiVersion: apps/v1 24 | kind: Deployment 25 | name: demo 26 | minReplicas: 1 27 | maxReplicas: 3 28 | metrics: 29 | - type: External 30 | external: 31 | metric: 32 | name: skywalking.apache.org|service_cpm 33 | selector: 34 | matchLabels: 35 | "service.str.0": "Your" 36 | "service.byte.1": "5f" 37 | "service.str.2": "ApplicationName" 38 | target: 39 | type: Value 40 | value: 5 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | build/bin 27 | build/release/ 28 | apiserver.local* 29 | 30 | # Test binary, build with `go test -c` 31 | *.test 32 | 33 | # Output of the go coverage tool, specifically when used with LiteIDE 34 | *.out 35 | 36 | # Kubernetes Generated files - skip generated files, except for vendored files 37 | 38 | !vendor/**/zz_generated.* 39 | 40 | # editor and IDE paraphernalia 41 | .idea 42 | *.swp 43 | *.swo 44 | *~ 45 | .vscode 46 | *.code-workspace 47 | 48 | .DS_Store 49 | .env 50 | **/dist/licenses 51 | **/dist/LICENSE 52 | -------------------------------------------------------------------------------- /operator/config/default/manager_webhook_patch.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: skywalking-swck-controller-manager-cert 41 | 42 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/storage/elasticsearch/templates/service.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: Service 19 | apiVersion: v1 20 | metadata: 21 | name: {{ .Spec.ServiceName }} 22 | namespace: {{ .Namespace }} 23 | labels: 24 | app: es 25 | operator.skywalking.apache.org/es-name: {{ .Name }} 26 | operator.skywalking.apache.org/application: elasticsearch 27 | operator.skywalking.apache.org/component: service 28 | spec: 29 | clusterIP: None 30 | selector: 31 | app: es 32 | operator.skywalking.apache.org/es-name: {{ .Name }} 33 | publishNotReadyAddresses: true 34 | ports: 35 | - name: http 36 | port: 9200 37 | - name: transport 38 | port: 9300 39 | 40 | -------------------------------------------------------------------------------- /operator/config/rbac/leader_election_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /operator/config/samples/default.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: operator.skywalking.apache.org/v1alpha1 19 | kind: OAPServer 20 | metadata: 21 | name: default 22 | spec: 23 | version: 9.5.0 24 | instances: 1 25 | image: apache/skywalking-oap-server:9.5.0 26 | service: 27 | template: 28 | type: ClusterIP 29 | 30 | --- 31 | apiVersion: operator.skywalking.apache.org/v1alpha1 32 | kind: UI 33 | metadata: 34 | name: default 35 | spec: 36 | version: 9.5.0 37 | instances: 1 38 | image: apache/skywalking-ui:9.5.0 39 | OAPServerAddress: http://default-oap.default:12800 40 | service: 41 | template: 42 | type: ClusterIP 43 | ingress: 44 | host: demo.ui.skywalking 45 | -------------------------------------------------------------------------------- /test/e2e/satellite-hpa-demo.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | apiVersion: autoscaling/v2beta2 17 | kind: HorizontalPodAutoscaler 18 | metadata: 19 | name: hpa-demo 20 | namespace: skywalking-system 21 | spec: 22 | scaleTargetRef: 23 | apiVersion: apps/v1 24 | kind: Deployment 25 | name: skywalking-system-satellite 26 | minReplicas: 1 27 | maxReplicas: 3 28 | metrics: 29 | - type: External 30 | external: 31 | metric: 32 | name: skywalking.apache.org|satellite_service_grpc_connect_count 33 | selector: 34 | matchLabels: 35 | "service.str.3": "satellite" 36 | "service.byte.4": "2d" 37 | "service.str.5": "service" 38 | target: 39 | type: Value 40 | value: 2 -------------------------------------------------------------------------------- /operator/config/default/webhookcainjection_patch.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /test/e2e/deploy-elasticsearch.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | apiVersion: apps/v1 17 | kind: StatefulSet 18 | metadata: 19 | name: es 20 | labels: 21 | k8s-app: es 22 | spec: 23 | replicas: 1 24 | serviceName: es 25 | selector: 26 | matchLabels: 27 | k8s-app: es 28 | template: 29 | metadata: 30 | labels: 31 | k8s-app: es 32 | spec: 33 | containers: 34 | - name: es 35 | image: docker.elastic.co/elasticsearch/elasticsearch:7.5.1 36 | env: 37 | - name: discovery.type 38 | value: single-node 39 | --- 40 | apiVersion: v1 41 | kind: Service 42 | metadata: 43 | name: es-out 44 | labels: 45 | k8s-app: es 46 | spec: 47 | selector: 48 | k8s-app: es 49 | ports: 50 | - name: out 51 | port: 9200 52 | protocol: TCP -------------------------------------------------------------------------------- /test/e2e/skywalking-components-with-storage.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: operator.skywalking.apache.org/v1alpha1 19 | kind: OAPServer 20 | metadata: 21 | name: default 22 | spec: 23 | version: 9.5.0 24 | instances: 1 25 | image: apache/skywalking-oap-server:9.5.0 26 | service: 27 | template: 28 | type: ClusterIP 29 | storage: 30 | name: sample 31 | --- 32 | apiVersion: operator.skywalking.apache.org/v1alpha1 33 | kind: UI 34 | metadata: 35 | name: skywalking-system 36 | namespace: skywalking-system 37 | spec: 38 | version: 9.5.0 39 | instances: 1 40 | image: apache/skywalking-ui:9.5.0 41 | OAPServerAddress: http://default-oap.default:12800 42 | service: 43 | template: 44 | type: ClusterIP 45 | ingress: 46 | host: demo.ui.skywalking 47 | -------------------------------------------------------------------------------- /test/e2e/skywalking-components.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: operator.skywalking.apache.org/v1alpha1 19 | kind: OAPServer 20 | metadata: 21 | name: skywalking-system 22 | namespace: skywalking-system 23 | spec: 24 | version: 9.5.0 25 | instances: 1 26 | image: apache/skywalking-oap-server:9.5.0 27 | service: 28 | template: 29 | type: ClusterIP 30 | --- 31 | apiVersion: operator.skywalking.apache.org/v1alpha1 32 | kind: UI 33 | metadata: 34 | name: skywalking-system 35 | namespace: skywalking-system 36 | spec: 37 | version: 9.5.0 38 | instances: 1 39 | image: apache/skywalking-ui:9.5.0 40 | OAPServerAddress: http://skywalking-system-oap.skywalking-system:12800 41 | service: 42 | template: 43 | type: ClusterIP 44 | ingress: 45 | host: demo.ui.skywalking 46 | -------------------------------------------------------------------------------- /operator/config/rbac/operator_eventexporter_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 eventexporters. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | labels: 23 | app.kubernetes.io/name: clusterrole 24 | app.kubernetes.io/instance: eventexporter-viewer-role 25 | app.kubernetes.io/component: rbac 26 | app.kubernetes.io/created-by: skywalking-swck 27 | app.kubernetes.io/part-of: skywalking-swck 28 | app.kubernetes.io/managed-by: kustomize 29 | name: eventexporter-viewer-role 30 | rules: 31 | - apiGroups: 32 | - operator.skywalking.apache.org 33 | resources: 34 | - eventexporters 35 | verbs: 36 | - get 37 | - list 38 | - watch 39 | - apiGroups: 40 | - operator.skywalking.apache.org 41 | resources: 42 | - eventexporters/status 43 | verbs: 44 | - get 45 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/injector/templates/javaagent.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | {{- $configuration := config }} 19 | apiVersion: operator.skywalking.apache.org/v1alpha1 20 | kind: JavaAgent 21 | metadata: 22 | name: {{SelectorName}}-javaagent 23 | namespace: {{Namespace}} 24 | labels: 25 | {{labelKey}}: {{labelValue}} 26 | ownerReferences: 27 | - apiVersion: {{ownerReference.APIVersion}} 28 | blockOwnerDeletion: {{ownerReference.BlockOwnerDeletion}} 29 | controller: {{ownerReference.Controller}} 30 | kind: {{ownerReference.Kind}} 31 | name: {{ownerReference.Name}} 32 | uid: {{ownerReference.UID}} 33 | spec: 34 | podSelector: {{PodSelector}} 35 | serviceName: {{ServiceName}} 36 | backendService: {{BackendService}} 37 | agentConfiguration: 38 | {{ range $key, $value := $configuration }} 39 | {{$key}}: {{$value}} 40 | {{- end -}} -------------------------------------------------------------------------------- /test/e2e/skywalking-components-with-banyandb.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: operator.skywalking.apache.org/v1alpha1 19 | kind: OAPServer 20 | metadata: 21 | name: default 22 | spec: 23 | version: 9.5.0 24 | instances: 1 25 | image: apache/skywalking-oap-server:9.5.0 26 | service: 27 | template: 28 | type: ClusterIP 29 | config: 30 | - name: SW_STORAGE_BANYANDB_HOST 31 | value: banyandb-test-banyandb-grpc.default 32 | --- 33 | apiVersion: operator.skywalking.apache.org/v1alpha1 34 | kind: UI 35 | metadata: 36 | name: skywalking-system 37 | namespace: skywalking-system 38 | spec: 39 | version: 9.5.0 40 | instances: 1 41 | image: apache/skywalking-ui:9.5.0 42 | OAPServerAddress: http://default-oap.default:12800 43 | service: 44 | template: 45 | type: ClusterIP 46 | ingress: 47 | host: demo.ui.skywalking 48 | -------------------------------------------------------------------------------- /operator/apis/operator/v1alpha1/groupversion_info.go: -------------------------------------------------------------------------------- 1 | // Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | // license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright 4 | // ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | // the Apache License, Version 2.0 (the "License"); you may 6 | // not use this file except in compliance with the License. 7 | // 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 operator v1alpha1 API group 19 | // +kubebuilder:object:generate=true 20 | // +groupName=operator.skywalking.apache.org 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: "operator.skywalking.apache.org", 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 | -------------------------------------------------------------------------------- /golangci.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | linters: 17 | enable: 18 | - errcheck 19 | - goconst 20 | - revive 21 | - ineffassign 22 | - lll 23 | - misspell 24 | - unconvert 25 | - govet 26 | - goimports 27 | - prealloc 28 | - unused 29 | - staticcheck 30 | - gosimple 31 | - megacheck 32 | disable: 33 | - interfacer 34 | linters-settings: 35 | lll: 36 | line-length: 170 37 | goconst: 38 | min-occurrences: 4 39 | govet: 40 | check-shadowing: true 41 | run: 42 | deadline: 10m 43 | skip-dirs: 44 | - config 45 | - docs 46 | - dist 47 | issues: 48 | exclude: 49 | - 'SA1019: Package github.com/golang/protobuf/proto is deprecated: Use the "google.golang.org/protobuf/proto" package instead.' 50 | - 'SA1019: Package github.com/golang/protobuf/jsonpb is deprecated: Use the "google.golang.org/protobuf/encoding/protojson" package instead.' 51 | -------------------------------------------------------------------------------- /docs/examples/istio-controlplane.md: -------------------------------------------------------------------------------- 1 | # Fetch metrics from the Istio control plane(istiod) 2 | 3 | In this example, you will learn how to setup a Fetcher to fetch Istio control plane metrics, 4 | then push them to OAP server. 5 | 6 | ## Install Operator 7 | 8 | Follow [Operator installation instrument](../../README.md#operator) to install the operator. 9 | 10 | ## Install Istio control plane 11 | 12 | Follow [Install with istioctl](https://istio.io/latest/docs/setup/install/istioctl/) to install a 13 | istiod. 14 | 15 | ## Deploy Fetcher, OAP server and UI with default settings 16 | 17 | Clone this repo, then change current directory to [samples](../../operator/config/samples). 18 | 19 | Issue the below command to deploy an OAP server and UI. 20 | 21 | ```shell 22 | kubectl apply -f fetcher.yaml 23 | ``` 24 | 25 | Get created custom resources as below: 26 | 27 | ```shell 28 | $ kubectl get oapserver,ui,fetcher 29 | NAME INSTANCES RUNNING ADDRESS 30 | oapserver.operator.skywalking.apache.org/default 1 1 default-oap.skywalking-swck-system 31 | 32 | NAME INSTANCES RUNNING INTERNALADDRESS EXTERNALIPS PORTS 33 | ui.operator.skywalking.apache.org/default 1 1 default-ui.skywalking-swck-system [80] 34 | 35 | NAME AGE 36 | fetcher.operator.skywalking.apache.org/istio-prod-cluster 36h 37 | ``` 38 | 39 | # View Istio Control Plane Dashboard from UI 40 | 41 | Follow [View the UI](./default-backend.md#view-the-ui) to access the UI service. 42 | 43 | Navigate to `Dashboard->Istio Control Plane` to view relevant metric diagrams. 44 | -------------------------------------------------------------------------------- /adapter/Dockerfile: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Build the manager binary 17 | FROM golang:1.25 As builder 18 | 19 | WORKDIR /workspace 20 | # Copy the Go Modules manifests 21 | COPY go.mod go.mod 22 | COPY go.sum go.sum 23 | # cache deps before building and copying source so that we don't need to re-download as much 24 | # and so that source changes don't invalidate our downloaded layer 25 | RUN go mod download 26 | 27 | # Copy the go source 28 | COPY main.go main.go 29 | COPY pkg/ pkg/ 30 | 31 | # Build 32 | RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o adapter main.go 33 | 34 | # Use distroless as minimal base image to package the manager binary 35 | # Refer to https://github.com/GoogleContainerTools/distroless for more details 36 | FROM gcr.io/distroless/static:nonroot 37 | WORKDIR /tmp 38 | COPY --from=builder --chown=nonroot:nonroot /workspace/adapter /adapter 39 | USER 65532:65532 40 | 41 | ENTRYPOINT ["/adapter"] 42 | -------------------------------------------------------------------------------- /operator/config/rbac/operator_eventexporter_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 eventexporters. 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | labels: 23 | app.kubernetes.io/name: clusterrole 24 | app.kubernetes.io/instance: eventexporter-editor-role 25 | app.kubernetes.io/component: rbac 26 | app.kubernetes.io/created-by: skywalking-swck 27 | app.kubernetes.io/part-of: skywalking-swck 28 | app.kubernetes.io/managed-by: kustomize 29 | name: eventexporter-editor-role 30 | rules: 31 | - apiGroups: 32 | - operator.skywalking.apache.org 33 | resources: 34 | - eventexporters 35 | verbs: 36 | - create 37 | - delete 38 | - get 39 | - list 40 | - patch 41 | - update 42 | - watch 43 | - apiGroups: 44 | - operator.skywalking.apache.org 45 | resources: 46 | - eventexporters/status 47 | verbs: 48 | - get 49 | -------------------------------------------------------------------------------- /operator/Dockerfile: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Build the manager binary 17 | FROM golang:1.25 AS builder 18 | 19 | WORKDIR /workspace 20 | # Copy the Go Modules manifests 21 | COPY go.mod go.mod 22 | COPY go.sum go.sum 23 | # cache deps before building and copying source so that we don't need to re-download as much 24 | # and so that source changes don't invalidate our downloaded layer 25 | RUN go mod download 26 | 27 | # Copy the go source 28 | COPY main.go main.go 29 | COPY apis/ apis/ 30 | COPY controllers/ controllers/ 31 | COPY pkg/ pkg/ 32 | 33 | # Build 34 | RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go 35 | 36 | # Use distroless as minimal base image to package the manager binary 37 | # Refer to https://github.com/GoogleContainerTools/distroless for more details 38 | FROM gcr.io/distroless/static:nonroot 39 | WORKDIR / 40 | COPY --from=builder /workspace/manager /manager 41 | USER 65532:65532 42 | 43 | ENTRYPOINT ["/manager"] 44 | -------------------------------------------------------------------------------- /test/e2e/oapserver-cases.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | cases: 17 | # test oapserver 18 | - query: swctl --display yaml --base-url=http://${service_default_oap_host}:${service_default_oap_12800}/graphql service ls 19 | expected: verify/service.yaml 20 | - query: swctl --display yaml --base-url=http://${service_default_oap_host}:${service_default_oap_12800}/graphql metrics linear --name service_cpm --service-name Your_ApplicationName | yq e 'to_entries' - 21 | expected: verify/metrics.yaml 22 | - query: swctl --display yaml --base-url=http://${service_default_oap_host}:${service_default_oap_12800}/graphql endpoint list --keyword=hello --service-name Your_ApplicationName 23 | expected: verify/endpoint.yaml 24 | - query: swctl --display yaml --base-url=http://${service_default_oap_host}:${service_default_oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name GET:/hello --service-name Your_ApplicationName | yq e 'to_entries' - 25 | expected: verify/metrics.yaml -------------------------------------------------------------------------------- /operator/config/webhook/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | -------------------------------------------------------------------------------- /operator/config/default/manager_auth_proxy_patch.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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=10" 36 | ports: 37 | - containerPort: 8443 38 | protocol: TCP 39 | name: https 40 | - name: manager 41 | args: 42 | - "--health-probe-bind-address=:8081" 43 | - "--metrics-bind-address=127.0.0.1:8080" 44 | - "--leader-elect" 45 | -------------------------------------------------------------------------------- /operator/config/rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | 37 | patchesJson6902: 38 | - target: 39 | group: rbac.authorization.k8s.io 40 | version: v1 41 | kind: ClusterRole 42 | name: manager-role 43 | path: role_patch.yaml 44 | -------------------------------------------------------------------------------- /operator/config/samples/fetcher.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: operator.skywalking.apache.org/v1alpha1 19 | kind: Fetcher 20 | metadata: 21 | name: istio-prod-cluster 22 | spec: 23 | type: ["prometheus"] 24 | OAPServerAddress: "default-oap:11800" 25 | clusterName: "istio-prod-cluster" 26 | 27 | --- 28 | apiVersion: operator.skywalking.apache.org/v1alpha1 29 | kind: OAPServer 30 | metadata: 31 | name: default 32 | spec: 33 | version: 9.5.0 34 | instances: 1 35 | image: apache/skywalking-oap-server:9.5.0 36 | config: 37 | - name: SW_OTEL_RECEIVER 38 | value: default 39 | service: 40 | template: 41 | type: ClusterIP 42 | 43 | --- 44 | apiVersion: operator.skywalking.apache.org/v1alpha1 45 | kind: UI 46 | metadata: 47 | name: default 48 | spec: 49 | version: 9.5.0 50 | instances: 1 51 | image: apache/skywalking-ui:9.5.0 52 | OAPServerAddress: default-oap:12800 53 | service: 54 | template: 55 | type: ClusterIP 56 | ingress: 57 | host: demo.ui.skywalking 58 | -------------------------------------------------------------------------------- /docs/examples/default-backend.md: -------------------------------------------------------------------------------- 1 | # Deploy OAP server and UI with default settings 2 | 3 | In this example, we will deploy an OAP server and UI to Kubernetes cluster with 4 | default settings specified by their Custom Resource Defines(CRD). 5 | 6 | ## Install Operator 7 | 8 | Follow [Operator installation instrument](../../README.md#operator) to install the operator. 9 | 10 | ## Deploy OAP server and UI with default setting 11 | 12 | Clone this repo, then change current directory to [samples](../../operator/config/samples). 13 | 14 | Issue the below command to deploy an OAP server and UI. 15 | 16 | ```shell 17 | kubectl apply -f default.yaml 18 | ``` 19 | 20 | Get created custom resources as below: 21 | 22 | ```shell 23 | $ kubectl get oapserver,ui 24 | NAME INSTANCES RUNNING ADDRESS 25 | oapserver.operator.skywalking.apache.org/default 1 1 default-oap.skywalking-swck-system 26 | 27 | NAME INSTANCES RUNNING INTERNALADDRESS EXTERNALIPS PORTS 28 | ui.operator.skywalking.apache.org/default 1 1 default-ui.skywalking-swck-system [80] 29 | ``` 30 | 31 | ## View the UI 32 | In order to view the UI from your browser, you should get the external address from the ingress generated by the UI custom resource firstly. 33 | 34 | ```shell 35 | $ kubectl get ingresses 36 | NAME HOSTS ADDRESS PORTS AGE 37 | default-ui demo.ui.skywalking 80 33h 38 | ``` 39 | 40 | Edit your local `/etc/hosts` to append the following host-ip mapping. 41 | 42 | ``` 43 | demo.ui.skywalking 44 | ``` 45 | 46 | Finally, navigate your browser to `demo.ui.skywalking` to access UI service. 47 | 48 | Notice, please install an ingress controller to your Kubernetes environment. 49 | -------------------------------------------------------------------------------- /docs/binary-readme.md: -------------------------------------------------------------------------------- 1 | Apache SkyWalking Cloud on Kubernetes 2 | ============ 3 | 4 | ![](https://github.com/apache/skywalking-swck/workflows/Build/badge.svg?branch=master) 5 | 6 | Sky Walking logo 7 | 8 | A bridge project between [Apache SkyWalking](https://github.com/apache/skywalking) and Kubernetes. 9 | 10 | SWCK is a platform for the SkyWalking user, provisions, upgrades, maintains SkyWalking relevant components, and makes them work natively on Kubernetes. 11 | 12 | # Features 13 | 14 | 1. Java Agent Injector: Inject the java agent into the application pod natively. 15 | 1. Operator: Provision and maintain SkyWalking backend components. 16 | 1. Custom Metrics Adapter: Provides custom metrics come from SkyWalking OAP cluster for autoscaling by Kubernetes HPA 17 | 18 | # Build images 19 | 20 | Issue below instrument to get the docker image: 21 | 22 | ``` 23 | make 24 | ``` 25 | 26 | or 27 | 28 | ``` 29 | make build 30 | ``` 31 | 32 | To onboard operator or adapter, you should push the image to a registry where the kubernetes cluster can pull it. 33 | 34 | ## Onboard Java Agent Injector and Operator 35 | 36 | The java agent injector and operator share a same binary. To onboard them, you should follow: 37 | 38 | * To install the java agent injector and operator in an existing cluster, make sure you have [`cert-manager`](https://cert-manager.io/docs/installation/) installed. 39 | * Apply the manifests for the Controller and CRDs in `config`: 40 | 41 | ``` 42 | kubectl apply -f config/operator-bundle.yaml 43 | ``` 44 | 45 | ## Onboard Custom Metrics Adapter 46 | 47 | * Deploy OAP server by referring to Operator Quick Start. 48 | * Apply the manifests for an adapter in `config`: 49 | 50 | ``` 51 | kubectl apply -f config/adapter-bundle.yaml 52 | ``` 53 | 54 | # License 55 | [Apache 2.0 License.](/LICENSE) 56 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/oapserver/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | {{- $ingress := .Spec.Service.Ingress }} 19 | {{ if $ingress.Host }} 20 | apiVersion: networking.k8s.io/v1 21 | kind: Ingress 22 | metadata: 23 | name: {{ .Name }}-ui 24 | namespace: {{ .Namespace }} 25 | labels: 26 | app: ui 27 | operator.skywalking.apache.org/ui-name: {{ .Name }} 28 | operator.skywalking.apache.org/application: ui 29 | operator.skywalking.apache.org/component: deployment 30 | annotations: 31 | {{- range $key, $value := $ingress.Annotations }} 32 | {{ $key }}: {{ $value | quote }} 33 | {{- end }} 34 | spec: 35 | rules: 36 | - host: {{ $ingress.Host }} 37 | http: 38 | paths: 39 | - path: /* 40 | backend: 41 | serviceName: {{ .Name }}-oap 42 | servicePort: 12800 43 | {{- if $ingress.IngressClassName }} 44 | ingressClassName: {{ $ingress.IngressClassName }} 45 | {{end}} 46 | {{- if $ingress.TLS }} 47 | tls: 48 | {{ toYAML $ingress.TLS | indent 4 }} 49 | {{end}} 50 | {{end}} 51 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/ui/templates/service.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | {{- $svc := .Spec.Service.Template }} 16 | apiVersion: v1 17 | kind: Service 18 | metadata: 19 | name: {{ .Name }}-ui 20 | namespace: {{ .Namespace }} 21 | labels: 22 | app: ui 23 | operator.skywalking.apache.org/ui-name: {{ .Name }} 24 | operator.skywalking.apache.org/application: ui 25 | operator.skywalking.apache.org/component: service 26 | spec: 27 | type: {{ $svc.Type }} 28 | ports: 29 | - port: 80 30 | targetPort: 8080 31 | name: page 32 | {{- if $svc.ExternalIPs }} 33 | externalIPs: 34 | {{- range $value := $svc.ExternalIPs }} 35 | - {{ $value | quote }} 36 | {{- end }} 37 | {{- end }} 38 | {{- if $svc.LoadBalancerIP }} 39 | loadBalancerIP: {{ $svc.LoadBalancerIP }} 40 | {{- end }} 41 | {{- if $svc.LoadBalancerSourceRanges }} 42 | loadBalancerSourceRanges: 43 | {{- range $value := $svc.LoadBalancerSourceRanges }} 44 | - {{ $value | quote}} 45 | {{- end }} 46 | {{- end }} 47 | selector: 48 | app: ui 49 | operator.skywalking.apache.org/ui-name: {{ .Name }} 50 | -------------------------------------------------------------------------------- /operator/config/certmanager/certificate.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: skywalking-swck-controller-manager-cert # this secret will not be prefixed, since it's not managed by kustomize 43 | -------------------------------------------------------------------------------- /test/e2e/demo-swagent.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | apiVersion: apps/v1 17 | kind: Deployment 18 | metadata: 19 | name: demo 20 | namespace: skywalking-system 21 | spec: 22 | selector: 23 | matchLabels: 24 | app: demo 25 | template: 26 | metadata: 27 | labels: 28 | swck-java-agent-injected: "true" 29 | app: demo 30 | spec: 31 | containers: 32 | - name: demo1 33 | imagePullPolicy: IfNotPresent 34 | image: ghcr.io/apache/skywalking-swck-spring-demo:v0.0.1 35 | command: ["java"] 36 | args: ["-jar","/app.jar"] 37 | ports: 38 | - containerPort: 8085 39 | readinessProbe: 40 | httpGet: 41 | path: /hello 42 | port: 8085 43 | initialDelaySeconds: 3 44 | periodSeconds: 3 45 | failureThreshold: 10 46 | --- 47 | apiVersion: v1 48 | kind: Service 49 | metadata: 50 | name: demo 51 | namespace: skywalking-system 52 | spec: 53 | type: ClusterIP 54 | ports: 55 | - name: 8085-tcp 56 | port: 8085 57 | protocol: TCP 58 | targetPort: 8085 59 | selector: 60 | app: demo 61 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/ui/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | {{- $ingress := .Spec.Service.Ingress }} 19 | {{ if $ingress.Host }} 20 | apiVersion: networking.k8s.io/v1 21 | kind: Ingress 22 | metadata: 23 | name: {{ .Name }}-ui 24 | namespace: {{ .Namespace }} 25 | labels: 26 | app: ui 27 | operator.skywalking.apache.org/ui-name: {{ .Name }} 28 | operator.skywalking.apache.org/application: ui 29 | operator.skywalking.apache.org/component: deployment 30 | annotations: 31 | {{- range $key, $value := $ingress.Annotations }} 32 | {{ $key }}: {{ $value | quote }} 33 | {{- end }} 34 | spec: 35 | rules: 36 | - host: {{ $ingress.Host }} 37 | http: 38 | paths: 39 | - backend: 40 | service: 41 | name: {{ .Name }}-ui 42 | port: 43 | number: 80 44 | path: / 45 | pathType: Prefix 46 | {{- if $ingress.IngressClassName }} 47 | ingressClassName: {{ $ingress.IngressClassName }} 48 | {{end}} 49 | {{- if $ingress.TLS }} 50 | tls: 51 | {{ toYAML $ingress.TLS | indent 4 }} 52 | {{end}} 53 | {{end}} 54 | -------------------------------------------------------------------------------- /test/e2e/resource.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 | --- 20 | apiVersion: apps/v1 21 | kind: Deployment 22 | metadata: 23 | name: songs-deployment 24 | namespace: skywalking-system 25 | labels: 26 | app: songs 27 | spec: 28 | replicas: 1 29 | selector: 30 | matchLabels: 31 | app: songs 32 | template: 33 | metadata: 34 | labels: 35 | swck-java-agent-injected: "true" 36 | app: songs 37 | annotations: 38 | agent.skywalking.apache.org/agent.service_name: "agent::songs" 39 | agent.skywalking.apache.org/collector.backend_service: "oap-service:11800" 40 | agent.skywalking.apache.org/agent.instance_name: "songs" 41 | spec: 42 | containers: 43 | - name: songs 44 | image: ghcr.io/apache/skywalking-showcase/songs-service:7c17079-agentless 45 | imagePullPolicy: IfNotPresent 46 | ports: 47 | - containerPort: 80 48 | 49 | --- 50 | apiVersion: v1 51 | kind: Service 52 | metadata: 53 | name: songs 54 | namespace: skywalking-system 55 | spec: 56 | selector: 57 | app: songs 58 | ports: 59 | - protocol: TCP 60 | port: 80 61 | targetPort: 80 -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/banyandb/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | {{- $ingress := .Spec.HTTPSvc.Ingress }} 19 | {{ if $ingress.Host }} 20 | apiVersion: networking.k8s.io/v1 21 | kind: Ingress 22 | metadata: 23 | name: {{ .Name }}-banyandb 24 | namespace: {{ .Namespace }} 25 | labels: 26 | app: ui 27 | operator.skywalking.apache.org/ui-name: {{ .Name }} 28 | operator.skywalking.apache.org/application: ui 29 | operator.skywalking.apache.org/component: deployment 30 | annotations: 31 | {{- range $key, $value := $ingress.Annotations }} 32 | {{ $key }}: {{ $value | quote }} 33 | {{- end }} 34 | spec: 35 | rules: 36 | - host: {{ $ingress.Host }} 37 | http: 38 | paths: 39 | - backend: 40 | service: 41 | name: {{ .Name }}-banyandb-http 42 | port: 43 | number: 17913 44 | path: / 45 | pathType: Prefix 46 | {{- if $ingress.IngressClassName }} 47 | ingressClassName: {{ $ingress.IngressClassName }} 48 | {{end}} 49 | {{- if $ingress.TLS }} 50 | tls: 51 | {{ toYAML $ingress.TLS | indent 4 }} 52 | {{end}} 53 | {{end}} -------------------------------------------------------------------------------- /operator/config/samples/eventexporter.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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: operator.skywalking.apache.org/v1alpha1 19 | kind: EventExporter 20 | metadata: 21 | name: eventexporter-sample 22 | spec: 23 | replicas: 1 24 | config: | 25 | filters: 26 | - reason: "" 27 | message: "" 28 | minCount: 1 29 | type: "" 30 | action: "" 31 | kind: "Pod|Service" 32 | namespace: "^default$" 33 | name: "" 34 | service: "[^\\s]{1,}" 35 | exporters: 36 | - skywalking 37 | exporters: 38 | skywalking: 39 | template: 40 | source: 41 | service: "{{ .Service.Name }}" 42 | serviceInstance: "{{ .Pod.Name }}" 43 | endpoint: "" 44 | message: "{{ .Event.Message }}" 45 | address: "default-oap:11800" 46 | 47 | --- 48 | apiVersion: operator.skywalking.apache.org/v1alpha1 49 | kind: OAPServer 50 | metadata: 51 | name: default 52 | spec: 53 | version: 9.5.0 54 | instances: 1 55 | image: apache/skywalking-oap-server:9.5.0 56 | service: 57 | template: 58 | type: ClusterIP -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/satellite/templates/service.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | {{- $svc := .Spec.Service.Template }} 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | name: {{ .Name }}-satellite 23 | namespace: {{ .Namespace }} 24 | labels: 25 | app: satellite 26 | operator.skywalking.apache.org/satellite-server-name: {{ .Name }} 27 | operator.skywalking.apache.org/application: satellite 28 | operator.skywalking.apache.org/component: service 29 | spec: 30 | type: {{ $svc.Type }} 31 | ports: 32 | - port: 11800 33 | name: grpc 34 | - port: 1234 35 | name: http-monitoring 36 | {{- if $svc.ExternalIPs }} 37 | externalIPs: 38 | {{- range $value := $svc.ExternalIPs }} 39 | - {{ $value | quote }} 40 | {{- end }} 41 | {{- end }} 42 | {{- if $svc.LoadBalancerIP }} 43 | loadBalancerIP: {{ $svc.LoadBalancerIP }} 44 | {{- end }} 45 | {{- if $svc.LoadBalancerSourceRanges }} 46 | loadBalancerSourceRanges: 47 | {{- range $value := $svc.LoadBalancerSourceRanges }} 48 | - {{ $value | quote }} 49 | {{- end }} 50 | {{- end }} 51 | selector: 52 | app: satellite 53 | operator.skywalking.apache.org/satellite-server-name: {{ .Name }} 54 | -------------------------------------------------------------------------------- /operator/pkg/operator/manifests/banyandb/templates/http_service.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to Apache Software Foundation (ASF) under one or more contributor 2 | # license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright 4 | # ownership. Apache Software Foundation (ASF) licenses this file to you under 5 | # the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. 7 | # 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 | {{- if .Spec.HTTPSvc}} 19 | 20 | {{- $svc := .Spec.HTTPSvc.Template }} 21 | apiVersion: v1 22 | kind: Service 23 | metadata: 24 | name: {{ .Name }}-banyandb-http 25 | namespace: {{ .Namespace }} 26 | labels: 27 | app: banyandb 28 | operator.skywalking.apache.org/banyandb-name: {{ .Name }} 29 | operator.skywalking.apache.org/application: banyandb 30 | operator.skywalking.apache.org/component: service 31 | spec: 32 | type: {{ $svc.Type }} 33 | selector: 34 | app: banyandb 35 | operator.skywalking.apache.org/banyandb-name: {{ .Name }} 36 | ports: 37 | - port: 17913 38 | name: http 39 | 40 | {{- if $svc.ExternalIPs }} 41 | externalIPs: 42 | {{- range $value := $svc.ExternalIPs }} 43 | - {{ $value | quote }} 44 | {{- end }} 45 | {{- end }} 46 | 47 | {{- if $svc.LoadBalancerIP }} 48 | loadBalancerIP: {{ $svc.LoadBalancerIP }} 49 | {{- end }} 50 | 51 | {{- if $svc.LoadBalancerSourceRanges }} 52 | loadBalancerSourceRanges: 53 | {{- range $value := $svc.LoadBalancerSourceRanges }} 54 | - {{ $value | quote }} 55 | {{- end }} 56 | {{- end }} 57 | 58 | {{- end}} --------------------------------------------------------------------------------