You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "dashanji (via GitHub)" <gi...@apache.org> on 2023/11/05 14:33:34 UTC

[PR] Add a getting started doc for swck [skywalking-swck]

dashanji opened a new pull request, #100:
URL: https://github.com/apache/skywalking-swck/pull/100

   Add a document to help users quickly get started with swck, including the following aspects:
   - Create a local kubernetes cluster.
   - Build the docker image of operator and deploy it on the kubernetes cluster.
   - Deploy the skywalking components: OAPServer and UI.
   - Use the injector to inject the java agent to the application pod.
   - Access the UI and get the metric info.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1987057756

   @hanahmily friendly ping


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1795193196

   @hanahmily Please take a look.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1987059922

   @dashanji Please fix CI. And should we release a new version after this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1987112235

   And protobuf should be upgraded to last too.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily commented on code in PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#discussion_r1383651920


##########
docs/getting-started.md:
##########
@@ -0,0 +1,316 @@
+## Getting Started
+
+This document introduces how to create a kubernetes cluster locally using kind and how to deploy the basic skywalking components to the cluster.
+
+### Prerequisites
+- [docker](https://docs.docker.com/get-docker/)
+- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
+- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
+- [swctl](https://github.com/apache/skywalking-cli?tab=readme-ov-file#install)
+
+### Step1: Create a kubernetes cluster locally using kind
+
+> Note: If you have a kubernetes cluster already, you can skip this step.
+
+Here we create a kubernetes cluster with 1 control-plane node and 1 worker nodes.
+
+```shell
+$ cat <<EOF | kind create cluster --config=-
+kind: Cluster
+apiVersion: kind.x-k8s.io/v1alpha4
+nodes:
+- role: control-plane
+  image: kindest/node:v1.21.10
+- role: worker
+  image: kindest/node:v1.21.10
+EOF
+```
+
+<details>
+  <summary>Expected output</summary>
+
+```shell
+Creating cluster "kind" ...
+ βœ“ Ensuring node image (kindest/node:v1.21.10) πŸ–Ό
+ βœ“ Preparing nodes πŸ“¦ πŸ“¦
+ βœ“ Writing configuration πŸ“œ
+ βœ“ Starting control-plane πŸ•ΉοΈ
+ βœ“ Installing CNI πŸ”Œ
+ βœ“ Installing StorageClass πŸ’Ύ
+ βœ“ Joining worker nodes 🚜
+Set kubectl context to "kind-kind"
+You can now use your cluster with:
+
+kubectl cluster-info --context kind-kind
+
+Not sure what to do next? πŸ˜…  Check out https://kind.sigs.k8s.io/docs/user/quick-start/
+```
+</details>
+
+Check all pods in the cluster.
+
+```shell
+$ kubectl get pods -A
+```
+
+<details>
+  <summary>Expected output</summary>
+
+```shell
+NAMESPACE            NAME                                         READY   STATUS    RESTARTS   AGE
+kube-system          coredns-558bd4d5db-h5gxt                     1/1     Running   0          106s
+kube-system          coredns-558bd4d5db-lhnvz                     1/1     Running   0          106s
+kube-system          etcd-kind-control-plane                      1/1     Running   0          116s
+kube-system          kindnet-fxlkm                                1/1     Running   0          106s
+kube-system          kindnet-vmcvl                                1/1     Running   0          91s
+kube-system          kube-apiserver-kind-control-plane            1/1     Running   0          116s
+kube-system          kube-controller-manager-kind-control-plane   1/1     Running   0          116s
+kube-system          kube-proxy-nr4f4                             1/1     Running   0          91s
+kube-system          kube-proxy-zl4h2                             1/1     Running   0          106s
+kube-system          kube-scheduler-kind-control-plane            1/1     Running   0          116s
+local-path-storage   local-path-provisioner-74567d47b4-kmtjh      1/1     Running   0          106s
+```
+</details>
+
+### Step2: Build the operator image
+
+Check into the root directory of SWCK and build the operator image as follows.
+
+```shell
+$ cd operator
+# Build the operator image
+$ make docker-build
+```
+
+You will get the operator image `controller:latest` as follows.
+
+```shell
+$ docker images         
+REPOSITORY     TAG        IMAGE ID       CREATED          SIZE
+controller     latest     84da7509092a   22 seconds ago   53.6MB
+```
+
+Load the operator image into the kind cluster or push the image to a registry that
+your kubernetes cluster can access.
+
+```shell
+$ kind load docker-image controller
+```
+or
+```shell
+$ docker push $(YOUR_REGISTRY)/controller
+```
+
+### Step3: Deploy operator on the kubernetes cluster
+
+Install the CRDs as follows.
+
+```shell
+$ make install
+```
+
+Check the CRDs are installed successfully.
+
+<details>
+  <summary>Expected output</summary>
+
+```shell
+kubectl get crd | grep skywalking
+banyandbs.operator.skywalking.apache.org                 2023-11-05T03:30:43Z
+fetchers.operator.skywalking.apache.org                  2023-11-05T03:30:43Z
+javaagents.operator.skywalking.apache.org                2023-11-05T03:30:43Z
+oapserverconfigs.operator.skywalking.apache.org          2023-11-05T03:30:43Z
+oapserverdynamicconfigs.operator.skywalking.apache.org   2023-11-05T03:30:43Z
+oapservers.operator.skywalking.apache.org                2023-11-05T03:30:43Z
+satellites.operator.skywalking.apache.org                2023-11-05T03:30:43Z
+storages.operator.skywalking.apache.org                  2023-11-05T03:30:43Z
+swagents.operator.skywalking.apache.org                  2023-11-05T03:30:43Z
+uis.operator.skywalking.apache.org                       2023-11-05T03:30:43Z
+```
+</details>
+
+Deploy the SWCK operator to the cluster.
+
+```shell
+$ make deploy
+```
+
+Or deploy the SWCK operator to the cluster with your own image.
+
+```shell
+$ make deploy OPERATOR_IMG=$(YOUR_REGISTRY)/controller
+```
+
+Get the status of the SWCK operator pod.
+
+```shell
+$ kubectl get pod -n skywalking-swck-system
+NAME                                                 READY   STATUS    RESTARTS   AGE
+skywalking-swck-controller-manager-5f5bbd4fd-9wdw6   2/2     Running   0          34s
+```
+
+### Step4: Deploy skywalking componentes on the kubernetes cluster
+
+Create the `skywalking-system` namespace.
+
+```shell
+$ kubectl create namespace skywalking-system
+```
+
+Deploy the skywalking components to the cluster.
+
+```shell
+$ cat <<EOF | kubectl apply -f -
+apiVersion: operator.skywalking.apache.org/v1alpha1
+kind: OAPServer
+metadata:
+  name: skywalking-system
+  namespace: skywalking-system
+spec:
+  version: 9.5.0
+  instances: 1
+  image: apache/skywalking-oap-server:9.5.0
+  service:
+    template:
+      type: ClusterIP
+---
+apiVersion: operator.skywalking.apache.org/v1alpha1
+kind: UI 
+metadata:
+  name: skywalking-system
+  namespace: skywalking-system
+spec:
+  version: 9.5.0
+  instances: 1
+  image: apache/skywalking-ui:9.5.0
+  OAPServerAddress: http://skywalking-system-oap.skywalking-system:12800
+  service:
+    template:
+      type: ClusterIP
+    ingress:
+      host: demo.ui.skywalking
+EOF
+```
+
+Check the status of the skywalking components.
+
+```shell
+$ kubectl get pod -n skywalking-system      
+NAME                                     READY   STATUS    RESTARTS   AGE
+skywalking-system-oap-68bd877f57-fhzdz   1/1     Running   0          6m23s
+skywalking-system-ui-6db8579b47-rphtl    1/1     Running   0          6m23s
+```
+
+### Step5: Use the java agent injector to inject the java agent into the application pod
+
+Label the namespace where the application pod is located with `swck-injection=enabled`.
+
+```shell
+$ kubectl label namespace skywalking-system swck-injection=enabled
+```
+
+Create the application pod.
+
+> Note: The application pod must be labeled with `swck-java-agent-injected=true` and the `agent.skywalking.apache.org/collector.backend_service` annotation must be set to the address of the OAP server. For more configurations, please refer to the [guide](./java-agent-injector.md#use-annotations-to-overlay-default-agent-configuration). 
+
+```shell
+$ cat <<EOF | kubectl apply -f -
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: demo
+  namespace: skywalking-system
+spec:
+  selector:
+    matchLabels:
+      app: demo
+  template:
+    metadata:
+      labels:
+        # enable the java agent injector
+        swck-java-agent-injected: "true"
+        app: demo
+      annotations:
+        agent.skywalking.apache.org/collector.backend_service: "skywalking-system-oap.skywalking-system:11800"
+    spec:
+      containers:
+      - name: demo1
+        imagePullPolicy: IfNotPresent
+        image: ghcr.io/apache/skywalking-swck-spring-demo:v0.0.1
+        command: ["java"]
+        args: ["-jar","/app.jar"]
+        ports:
+          - containerPort: 8085
+        readinessProbe:
+          httpGet:
+            path: /hello
+            port: 8085
+          initialDelaySeconds: 3
+          periodSeconds: 3
+          failureThreshold: 10
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: demo
+  namespace: skywalking-system
+spec:
+  type: ClusterIP
+  ports:
+  - name: 8085-tcp
+    port: 8085
+    protocol: TCP
+    targetPort: 8085
+  selector:
+    app: demo
+EOF
+```
+
+Check the status of the application pod and make
+sure the java agent is injected into the application pod.
+
+
+```shell
+$ kubectl get pod -n skywalking-system -l app=demo -ojsonpath='{.items[0].spec.initContainers[0]}'

Review Comment:
   How to check the agent's config and logs. Both of them is useful to debug relevant issues.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1793761880

   The screenshot should be submitted to website repo, https://github.com/apache/skywalking-website/tree/master/static/doc-graph
   
   And you could use the https://skywalking.apache.org/doc-graph/ in the source code repository.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "dashanji (via GitHub)" <gi...@apache.org>.
dashanji commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1793940896

   Thanks for the detail,I will submit the image later.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Add a getting started doc for swck [skywalking-swck]

Posted by "dashanji (via GitHub)" <gi...@apache.org>.
dashanji commented on code in PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#discussion_r1398327613


##########
docs/getting-started.md:
##########
@@ -0,0 +1,316 @@
+## Getting Started
+
+This document introduces how to create a kubernetes cluster locally using kind and how to deploy the basic skywalking components to the cluster.
+
+### Prerequisites
+- [docker](https://docs.docker.com/get-docker/)
+- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
+- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
+- [swctl](https://github.com/apache/skywalking-cli?tab=readme-ov-file#install)
+
+### Step1: Create a kubernetes cluster locally using kind
+
+> Note: If you have a kubernetes cluster already, you can skip this step.

Review Comment:
   Updated. It should be more than v1.21.10



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily commented on code in PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#discussion_r1383652863


##########
docs/getting-started.md:
##########
@@ -0,0 +1,316 @@
+## Getting Started
+
+This document introduces how to create a kubernetes cluster locally using kind and how to deploy the basic skywalking components to the cluster.
+
+### Prerequisites
+- [docker](https://docs.docker.com/get-docker/)
+- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
+- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
+- [swctl](https://github.com/apache/skywalking-cli?tab=readme-ov-file#install)
+
+### Step1: Create a kubernetes cluster locally using kind
+
+> Note: If you have a kubernetes cluster already, you can skip this step.

Review Comment:
   What's the required version?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "dashanji (via GitHub)" <gi...@apache.org>.
dashanji commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1987100721

   > Could you upgrade go to 1.21.8+? It seems to have some CVEs for tor the current version.
   
   Okay.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "dashanji (via GitHub)" <gi...@apache.org>.
dashanji commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1987060185

   > @dashanji Please fix CI. And should we release a new version after this?
   
   Yes, That's what I planned.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Add a getting started doc for swck [skywalking-swck]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1819982699

   @hanahmily Could you recheck on this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "dashanji (via GitHub)" <gi...@apache.org>.
dashanji commented on code in PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#discussion_r1384238659


##########
docs/getting-started.md:
##########
@@ -0,0 +1,316 @@
+## Getting Started
+
+This document introduces how to create a kubernetes cluster locally using kind and how to deploy the basic skywalking components to the cluster.
+
+### Prerequisites
+- [docker](https://docs.docker.com/get-docker/)
+- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
+- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
+- [swctl](https://github.com/apache/skywalking-cli?tab=readme-ov-file#install)
+
+### Step1: Create a kubernetes cluster locally using kind
+
+> Note: If you have a kubernetes cluster already, you can skip this step.
+
+Here we create a kubernetes cluster with 1 control-plane node and 1 worker nodes.
+
+```shell
+$ cat <<EOF | kind create cluster --config=-
+kind: Cluster
+apiVersion: kind.x-k8s.io/v1alpha4
+nodes:
+- role: control-plane
+  image: kindest/node:v1.21.10
+- role: worker
+  image: kindest/node:v1.21.10
+EOF
+```
+
+<details>
+  <summary>Expected output</summary>
+
+```shell
+Creating cluster "kind" ...
+ βœ“ Ensuring node image (kindest/node:v1.21.10) πŸ–Ό
+ βœ“ Preparing nodes πŸ“¦ πŸ“¦
+ βœ“ Writing configuration πŸ“œ
+ βœ“ Starting control-plane πŸ•ΉοΈ
+ βœ“ Installing CNI πŸ”Œ
+ βœ“ Installing StorageClass πŸ’Ύ
+ βœ“ Joining worker nodes 🚜
+Set kubectl context to "kind-kind"
+You can now use your cluster with:
+
+kubectl cluster-info --context kind-kind
+
+Not sure what to do next? πŸ˜…  Check out https://kind.sigs.k8s.io/docs/user/quick-start/
+```
+</details>
+
+Check all pods in the cluster.
+
+```shell
+$ kubectl get pods -A
+```
+
+<details>
+  <summary>Expected output</summary>
+
+```shell
+NAMESPACE            NAME                                         READY   STATUS    RESTARTS   AGE
+kube-system          coredns-558bd4d5db-h5gxt                     1/1     Running   0          106s
+kube-system          coredns-558bd4d5db-lhnvz                     1/1     Running   0          106s
+kube-system          etcd-kind-control-plane                      1/1     Running   0          116s
+kube-system          kindnet-fxlkm                                1/1     Running   0          106s
+kube-system          kindnet-vmcvl                                1/1     Running   0          91s
+kube-system          kube-apiserver-kind-control-plane            1/1     Running   0          116s
+kube-system          kube-controller-manager-kind-control-plane   1/1     Running   0          116s
+kube-system          kube-proxy-nr4f4                             1/1     Running   0          91s
+kube-system          kube-proxy-zl4h2                             1/1     Running   0          106s
+kube-system          kube-scheduler-kind-control-plane            1/1     Running   0          116s
+local-path-storage   local-path-provisioner-74567d47b4-kmtjh      1/1     Running   0          106s
+```
+</details>
+
+### Step2: Build the operator image
+
+Check into the root directory of SWCK and build the operator image as follows.
+
+```shell
+$ cd operator
+# Build the operator image
+$ make docker-build
+```
+
+You will get the operator image `controller:latest` as follows.
+
+```shell
+$ docker images         
+REPOSITORY     TAG        IMAGE ID       CREATED          SIZE
+controller     latest     84da7509092a   22 seconds ago   53.6MB
+```
+
+Load the operator image into the kind cluster or push the image to a registry that
+your kubernetes cluster can access.
+
+```shell
+$ kind load docker-image controller
+```
+or
+```shell
+$ docker push $(YOUR_REGISTRY)/controller
+```
+
+### Step3: Deploy operator on the kubernetes cluster
+
+Install the CRDs as follows.
+
+```shell
+$ make install
+```
+
+Check the CRDs are installed successfully.
+
+<details>
+  <summary>Expected output</summary>
+
+```shell
+kubectl get crd | grep skywalking
+banyandbs.operator.skywalking.apache.org                 2023-11-05T03:30:43Z
+fetchers.operator.skywalking.apache.org                  2023-11-05T03:30:43Z
+javaagents.operator.skywalking.apache.org                2023-11-05T03:30:43Z
+oapserverconfigs.operator.skywalking.apache.org          2023-11-05T03:30:43Z
+oapserverdynamicconfigs.operator.skywalking.apache.org   2023-11-05T03:30:43Z
+oapservers.operator.skywalking.apache.org                2023-11-05T03:30:43Z
+satellites.operator.skywalking.apache.org                2023-11-05T03:30:43Z
+storages.operator.skywalking.apache.org                  2023-11-05T03:30:43Z
+swagents.operator.skywalking.apache.org                  2023-11-05T03:30:43Z
+uis.operator.skywalking.apache.org                       2023-11-05T03:30:43Z
+```
+</details>
+
+Deploy the SWCK operator to the cluster.
+
+```shell
+$ make deploy
+```
+
+Or deploy the SWCK operator to the cluster with your own image.
+
+```shell
+$ make deploy OPERATOR_IMG=$(YOUR_REGISTRY)/controller
+```
+
+Get the status of the SWCK operator pod.
+
+```shell
+$ kubectl get pod -n skywalking-swck-system
+NAME                                                 READY   STATUS    RESTARTS   AGE
+skywalking-swck-controller-manager-5f5bbd4fd-9wdw6   2/2     Running   0          34s
+```
+
+### Step4: Deploy skywalking componentes on the kubernetes cluster
+
+Create the `skywalking-system` namespace.
+
+```shell
+$ kubectl create namespace skywalking-system
+```
+
+Deploy the skywalking components to the cluster.
+
+```shell
+$ cat <<EOF | kubectl apply -f -
+apiVersion: operator.skywalking.apache.org/v1alpha1
+kind: OAPServer
+metadata:
+  name: skywalking-system
+  namespace: skywalking-system
+spec:
+  version: 9.5.0
+  instances: 1
+  image: apache/skywalking-oap-server:9.5.0
+  service:
+    template:
+      type: ClusterIP
+---
+apiVersion: operator.skywalking.apache.org/v1alpha1
+kind: UI 
+metadata:
+  name: skywalking-system
+  namespace: skywalking-system
+spec:
+  version: 9.5.0
+  instances: 1
+  image: apache/skywalking-ui:9.5.0
+  OAPServerAddress: http://skywalking-system-oap.skywalking-system:12800
+  service:
+    template:
+      type: ClusterIP
+    ingress:
+      host: demo.ui.skywalking
+EOF
+```
+
+Check the status of the skywalking components.
+
+```shell
+$ kubectl get pod -n skywalking-system      
+NAME                                     READY   STATUS    RESTARTS   AGE
+skywalking-system-oap-68bd877f57-fhzdz   1/1     Running   0          6m23s
+skywalking-system-ui-6db8579b47-rphtl    1/1     Running   0          6m23s
+```
+
+### Step5: Use the java agent injector to inject the java agent into the application pod
+
+Label the namespace where the application pod is located with `swck-injection=enabled`.
+
+```shell
+$ kubectl label namespace skywalking-system swck-injection=enabled
+```
+
+Create the application pod.
+
+> Note: The application pod must be labeled with `swck-java-agent-injected=true` and the `agent.skywalking.apache.org/collector.backend_service` annotation must be set to the address of the OAP server. For more configurations, please refer to the [guide](./java-agent-injector.md#use-annotations-to-overlay-default-agent-configuration). 
+
+```shell
+$ cat <<EOF | kubectl apply -f -
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: demo
+  namespace: skywalking-system
+spec:
+  selector:
+    matchLabels:
+      app: demo
+  template:
+    metadata:
+      labels:
+        # enable the java agent injector
+        swck-java-agent-injected: "true"
+        app: demo
+      annotations:
+        agent.skywalking.apache.org/collector.backend_service: "skywalking-system-oap.skywalking-system:11800"
+    spec:
+      containers:
+      - name: demo1
+        imagePullPolicy: IfNotPresent
+        image: ghcr.io/apache/skywalking-swck-spring-demo:v0.0.1
+        command: ["java"]
+        args: ["-jar","/app.jar"]
+        ports:
+          - containerPort: 8085
+        readinessProbe:
+          httpGet:
+            path: /hello
+            port: 8085
+          initialDelaySeconds: 3
+          periodSeconds: 3
+          failureThreshold: 10
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: demo
+  namespace: skywalking-system
+spec:
+  type: ClusterIP
+  ports:
+  - name: 8085-tcp
+    port: 8085
+    protocol: TCP
+    targetPort: 8085
+  selector:
+    app: demo
+EOF
+```
+
+Check the status of the application pod and make
+sure the java agent is injected into the application pod.
+
+
+```shell
+$ kubectl get pod -n skywalking-system -l app=demo -ojsonpath='{.items[0].spec.initContainers[0]}'

Review Comment:
   Make sense.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Add a getting started doc for swck [skywalking-swck]

Posted by "dashanji (via GitHub)" <gi...@apache.org>.
dashanji commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1817755111

   @hanahmily I have addressed these comments. Could you please take another review?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1793766106

   And that screenshot is 238k, please make sure it has been compressed properly. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add a getting started doc for swck [skywalking-swck]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#issuecomment-1987094114

   Could you upgrade go to 1.21.8+? It seems to have some CVEs for tor the current version.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Add a getting started doc for swck [skywalking-swck]

Posted by "dashanji (via GitHub)" <gi...@apache.org>.
dashanji commented on code in PR #100:
URL: https://github.com/apache/skywalking-swck/pull/100#discussion_r1394205515


##########
docs/getting-started.md:
##########
@@ -0,0 +1,316 @@
+## Getting Started
+
+This document introduces how to create a kubernetes cluster locally using kind and how to deploy the basic skywalking components to the cluster.
+
+### Prerequisites
+- [docker](https://docs.docker.com/get-docker/)
+- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
+- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
+- [swctl](https://github.com/apache/skywalking-cli?tab=readme-ov-file#install)
+
+### Step1: Create a kubernetes cluster locally using kind
+
+> Note: If you have a kubernetes cluster already, you can skip this step.
+
+Here we create a kubernetes cluster with 1 control-plane node and 1 worker nodes.
+
+```shell
+$ cat <<EOF | kind create cluster --config=-
+kind: Cluster
+apiVersion: kind.x-k8s.io/v1alpha4
+nodes:
+- role: control-plane
+  image: kindest/node:v1.21.10
+- role: worker
+  image: kindest/node:v1.21.10
+EOF
+```
+
+<details>
+  <summary>Expected output</summary>
+
+```shell
+Creating cluster "kind" ...
+ βœ“ Ensuring node image (kindest/node:v1.21.10) πŸ–Ό
+ βœ“ Preparing nodes πŸ“¦ πŸ“¦
+ βœ“ Writing configuration πŸ“œ
+ βœ“ Starting control-plane πŸ•ΉοΈ
+ βœ“ Installing CNI πŸ”Œ
+ βœ“ Installing StorageClass πŸ’Ύ
+ βœ“ Joining worker nodes 🚜
+Set kubectl context to "kind-kind"
+You can now use your cluster with:
+
+kubectl cluster-info --context kind-kind
+
+Not sure what to do next? πŸ˜…  Check out https://kind.sigs.k8s.io/docs/user/quick-start/
+```
+</details>
+
+Check all pods in the cluster.
+
+```shell
+$ kubectl get pods -A
+```
+
+<details>
+  <summary>Expected output</summary>
+
+```shell
+NAMESPACE            NAME                                         READY   STATUS    RESTARTS   AGE
+kube-system          coredns-558bd4d5db-h5gxt                     1/1     Running   0          106s
+kube-system          coredns-558bd4d5db-lhnvz                     1/1     Running   0          106s
+kube-system          etcd-kind-control-plane                      1/1     Running   0          116s
+kube-system          kindnet-fxlkm                                1/1     Running   0          106s
+kube-system          kindnet-vmcvl                                1/1     Running   0          91s
+kube-system          kube-apiserver-kind-control-plane            1/1     Running   0          116s
+kube-system          kube-controller-manager-kind-control-plane   1/1     Running   0          116s
+kube-system          kube-proxy-nr4f4                             1/1     Running   0          91s
+kube-system          kube-proxy-zl4h2                             1/1     Running   0          106s
+kube-system          kube-scheduler-kind-control-plane            1/1     Running   0          116s
+local-path-storage   local-path-provisioner-74567d47b4-kmtjh      1/1     Running   0          106s
+```
+</details>
+
+### Step2: Build the operator image
+
+Check into the root directory of SWCK and build the operator image as follows.
+
+```shell
+$ cd operator
+# Build the operator image
+$ make docker-build
+```
+
+You will get the operator image `controller:latest` as follows.
+
+```shell
+$ docker images         
+REPOSITORY     TAG        IMAGE ID       CREATED          SIZE
+controller     latest     84da7509092a   22 seconds ago   53.6MB
+```
+
+Load the operator image into the kind cluster or push the image to a registry that
+your kubernetes cluster can access.
+
+```shell
+$ kind load docker-image controller
+```
+or
+```shell
+$ docker push $(YOUR_REGISTRY)/controller
+```
+
+### Step3: Deploy operator on the kubernetes cluster
+
+Install the CRDs as follows.
+
+```shell
+$ make install
+```
+
+Check the CRDs are installed successfully.
+
+<details>
+  <summary>Expected output</summary>
+
+```shell
+kubectl get crd | grep skywalking
+banyandbs.operator.skywalking.apache.org                 2023-11-05T03:30:43Z
+fetchers.operator.skywalking.apache.org                  2023-11-05T03:30:43Z
+javaagents.operator.skywalking.apache.org                2023-11-05T03:30:43Z
+oapserverconfigs.operator.skywalking.apache.org          2023-11-05T03:30:43Z
+oapserverdynamicconfigs.operator.skywalking.apache.org   2023-11-05T03:30:43Z
+oapservers.operator.skywalking.apache.org                2023-11-05T03:30:43Z
+satellites.operator.skywalking.apache.org                2023-11-05T03:30:43Z
+storages.operator.skywalking.apache.org                  2023-11-05T03:30:43Z
+swagents.operator.skywalking.apache.org                  2023-11-05T03:30:43Z
+uis.operator.skywalking.apache.org                       2023-11-05T03:30:43Z
+```
+</details>
+
+Deploy the SWCK operator to the cluster.
+
+```shell
+$ make deploy
+```
+
+Or deploy the SWCK operator to the cluster with your own image.
+
+```shell
+$ make deploy OPERATOR_IMG=$(YOUR_REGISTRY)/controller
+```
+
+Get the status of the SWCK operator pod.
+
+```shell
+$ kubectl get pod -n skywalking-swck-system
+NAME                                                 READY   STATUS    RESTARTS   AGE
+skywalking-swck-controller-manager-5f5bbd4fd-9wdw6   2/2     Running   0          34s
+```
+
+### Step4: Deploy skywalking componentes on the kubernetes cluster
+
+Create the `skywalking-system` namespace.
+
+```shell
+$ kubectl create namespace skywalking-system
+```
+
+Deploy the skywalking components to the cluster.
+
+```shell
+$ cat <<EOF | kubectl apply -f -
+apiVersion: operator.skywalking.apache.org/v1alpha1
+kind: OAPServer
+metadata:
+  name: skywalking-system
+  namespace: skywalking-system
+spec:
+  version: 9.5.0
+  instances: 1
+  image: apache/skywalking-oap-server:9.5.0
+  service:
+    template:
+      type: ClusterIP
+---
+apiVersion: operator.skywalking.apache.org/v1alpha1
+kind: UI 
+metadata:
+  name: skywalking-system
+  namespace: skywalking-system
+spec:
+  version: 9.5.0
+  instances: 1
+  image: apache/skywalking-ui:9.5.0
+  OAPServerAddress: http://skywalking-system-oap.skywalking-system:12800
+  service:
+    template:
+      type: ClusterIP
+    ingress:
+      host: demo.ui.skywalking
+EOF
+```
+
+Check the status of the skywalking components.
+
+```shell
+$ kubectl get pod -n skywalking-system      
+NAME                                     READY   STATUS    RESTARTS   AGE
+skywalking-system-oap-68bd877f57-fhzdz   1/1     Running   0          6m23s
+skywalking-system-ui-6db8579b47-rphtl    1/1     Running   0          6m23s
+```
+
+### Step5: Use the java agent injector to inject the java agent into the application pod
+
+Label the namespace where the application pod is located with `swck-injection=enabled`.
+
+```shell
+$ kubectl label namespace skywalking-system swck-injection=enabled
+```
+
+Create the application pod.
+
+> Note: The application pod must be labeled with `swck-java-agent-injected=true` and the `agent.skywalking.apache.org/collector.backend_service` annotation must be set to the address of the OAP server. For more configurations, please refer to the [guide](./java-agent-injector.md#use-annotations-to-overlay-default-agent-configuration). 
+
+```shell
+$ cat <<EOF | kubectl apply -f -
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: demo
+  namespace: skywalking-system
+spec:
+  selector:
+    matchLabels:
+      app: demo
+  template:
+    metadata:
+      labels:
+        # enable the java agent injector
+        swck-java-agent-injected: "true"
+        app: demo
+      annotations:
+        agent.skywalking.apache.org/collector.backend_service: "skywalking-system-oap.skywalking-system:11800"
+    spec:
+      containers:
+      - name: demo1
+        imagePullPolicy: IfNotPresent
+        image: ghcr.io/apache/skywalking-swck-spring-demo:v0.0.1
+        command: ["java"]
+        args: ["-jar","/app.jar"]
+        ports:
+          - containerPort: 8085
+        readinessProbe:
+          httpGet:
+            path: /hello
+            port: 8085
+          initialDelaySeconds: 3
+          periodSeconds: 3
+          failureThreshold: 10
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: demo
+  namespace: skywalking-system
+spec:
+  type: ClusterIP
+  ports:
+  - name: 8085-tcp
+    port: 8085
+    protocol: TCP
+    targetPort: 8085
+  selector:
+    app: demo
+EOF
+```
+
+Check the status of the application pod and make
+sure the java agent is injected into the application pod.
+
+
+```shell
+$ kubectl get pod -n skywalking-system -l app=demo -ojsonpath='{.items[0].spec.initContainers[0]}'

Review Comment:
   We could leverage the current CRD `JavaAgent` to get the final agent configurations. But it can't work well, I'd like to improve it these days and then update the doc here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org