You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/11/24 07:08:43 UTC

[GitHub] [skywalking-kubernetes] hanahmily commented on a change in pull request #83: Add skywalking satellite support

hanahmily commented on a change in pull request #83:
URL: https://github.com/apache/skywalking-kubernetes/pull/83#discussion_r755751861



##########
File path: chart/skywalking/templates/satellite-deployment.yaml
##########
@@ -0,0 +1,133 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.satellite.enabled }}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  labels:
+    app: {{ template "skywalking.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
+    component: "{{ .Values.satellite.name }}"
+    heritage: {{ .Release.Service }}
+    release: {{ .Release.Name }}
+  name: {{ template "skywalking.satellite.fullname" . }}
+spec:
+  replicas: {{ .Values.satellite.replicas }}
+  selector:
+    matchLabels:
+      app: {{ template "skywalking.name" . }}
+      component: "{{ .Values.satellite.name }}"
+      release: {{ .Release.Name }}
+  template:
+    metadata:
+      labels:
+        app: {{ template "skywalking.name" . }}
+        component: "{{ .Values.satellite.name }}"
+        release: {{ .Release.Name }}
+        {{- if .Values.satellite.podAnnotations }}
+      annotations:
+{{ toYaml .Values.satellite.podAnnotations | indent 8 }}
+        {{- end }}
+    spec:
+      serviceAccountName: {{ template "skywalking.serviceAccountName.satellite" . }}
+      affinity:
+      {{- if eq .Values.satellite.antiAffinity "hard" }}
+        podAntiAffinity:
+          requiredDuringSchedulingIgnoredDuringExecution:
+            - topologyKey: "kubernetes.io/hostname"
+              labelSelector:
+                matchLabels:
+                  app: "{{ template "skywalking.name" . }}"
+                  release: "{{ .Release.Name }}"
+                  component: "{{ .Values.satellite.name }}"
+      {{- else if eq .Values.satellite.antiAffinity "soft" }}
+        podAntiAffinity:
+          preferredDuringSchedulingIgnoredDuringExecution:
+          - weight: 1
+            podAffinityTerm:
+              topologyKey: kubernetes.io/hostname
+              labelSelector:
+                matchLabels:
+                  app: "{{ template "skywalking.name" . }}"
+                  release: "{{ .Release.Name }}"
+                  component: "{{ .Values.satellite.name }}"
+      {{- end }}
+      {{- with .Values.satellite.nodeAffinity }}
+        nodeAffinity:
+{{ toYaml . | indent 10 }}
+      {{- end }}
+{{- if .Values.satellite.nodeSelector }}
+      nodeSelector:
+{{ toYaml .Values.satellite.nodeSelector | indent 8 }}
+{{- end }}
+{{- if .Values.satellite.tolerations }}
+      tolerations:
+{{ toYaml .Values.satellite.tolerations | indent 8 }}
+{{- end }}
+{{- if .Values.imagePullSecrets }}
+      imagePullSecrets:
+{{ toYaml .Values.imagePullSecrets | indent 8 }}
+{{- end }}
+      containers:
+      - name: {{ .Values.satellite.name }}
+        image: {{ .Values.satellite.image.repository }}:{{ required "satellite.image.tag is required" .Values.satellite.image.tag }}
+        imagePullPolicy: {{ .Values.satellite.image.pullPolicy }}
+        livenessProbe:

Review comment:
       Just a nit. 
   
   Recently, I found we should replace livenessProbe with readinessProbe, the former would cause E2E cases to flaky.

##########
File path: chart/skywalking/templates/satellite-deployment.yaml
##########
@@ -0,0 +1,133 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.satellite.enabled }}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  labels:
+    app: {{ template "skywalking.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
+    component: "{{ .Values.satellite.name }}"
+    heritage: {{ .Release.Service }}
+    release: {{ .Release.Name }}
+  name: {{ template "skywalking.satellite.fullname" . }}
+spec:
+  replicas: {{ .Values.satellite.replicas }}
+  selector:
+    matchLabels:
+      app: {{ template "skywalking.name" . }}
+      component: "{{ .Values.satellite.name }}"
+      release: {{ .Release.Name }}
+  template:
+    metadata:
+      labels:
+        app: {{ template "skywalking.name" . }}
+        component: "{{ .Values.satellite.name }}"
+        release: {{ .Release.Name }}
+        {{- if .Values.satellite.podAnnotations }}
+      annotations:
+{{ toYaml .Values.satellite.podAnnotations | indent 8 }}
+        {{- end }}
+    spec:
+      serviceAccountName: {{ template "skywalking.serviceAccountName.satellite" . }}
+      affinity:
+      {{- if eq .Values.satellite.antiAffinity "hard" }}
+        podAntiAffinity:
+          requiredDuringSchedulingIgnoredDuringExecution:
+            - topologyKey: "kubernetes.io/hostname"
+              labelSelector:
+                matchLabels:
+                  app: "{{ template "skywalking.name" . }}"
+                  release: "{{ .Release.Name }}"
+                  component: "{{ .Values.satellite.name }}"
+      {{- else if eq .Values.satellite.antiAffinity "soft" }}
+        podAntiAffinity:
+          preferredDuringSchedulingIgnoredDuringExecution:
+          - weight: 1
+            podAffinityTerm:
+              topologyKey: kubernetes.io/hostname
+              labelSelector:
+                matchLabels:
+                  app: "{{ template "skywalking.name" . }}"
+                  release: "{{ .Release.Name }}"
+                  component: "{{ .Values.satellite.name }}"
+      {{- end }}
+      {{- with .Values.satellite.nodeAffinity }}
+        nodeAffinity:
+{{ toYaml . | indent 10 }}
+      {{- end }}
+{{- if .Values.satellite.nodeSelector }}
+      nodeSelector:
+{{ toYaml .Values.satellite.nodeSelector | indent 8 }}
+{{- end }}
+{{- if .Values.satellite.tolerations }}
+      tolerations:
+{{ toYaml .Values.satellite.tolerations | indent 8 }}
+{{- end }}
+{{- if .Values.imagePullSecrets }}
+      imagePullSecrets:
+{{ toYaml .Values.imagePullSecrets | indent 8 }}
+{{- end }}
+      containers:
+      - name: {{ .Values.satellite.name }}
+        image: {{ .Values.satellite.image.repository }}:{{ required "satellite.image.tag is required" .Values.satellite.image.tag }}
+        imagePullPolicy: {{ .Values.satellite.image.pullPolicy }}
+        livenessProbe:
+          tcpSocket:
+            port: 11800
+          initialDelaySeconds: 15
+          periodSeconds: 20
+        ports:
+        {{- range $key, $value :=  .Values.satellite.ports }}
+        - containerPort: {{ $value }}
+          name: {{ $key }}
+        {{- end }}
+{{- if .Values.satellite.resources }}
+        resources:
+{{ toYaml .Values.satellite.resources | indent 10 }}
+{{- end }}
+        env:
+        - name: SATELLITE_GRPC_CLIENT_FINDER
+          value: kubernetes
+        - name: SATELLITE_GRPC_CLIENT_KUBERNETES_NAMESPACE
+          value: "{{ .Release.Namespace }}"
+        - name: SATELLITE_GRPC_CLIENT_KUBERNETES_KIND
+          value: pod
+        - name: SATELLITE_GRPC_CLIENT_KUBERNETES_SELECTOR_LABEL
+          value: "app={{ template "skywalking.name" . }},release={{ .Release.Name }},component={{ .Values.oap.name }}"
+        - name: SATELLITE_GRPC_CLIENT_KUBERNETES_EXTRA_PORT_PORT

Review comment:
       `PORT_PORT`, typo?

##########
File path: chart/skywalking/templates/satellite-deployment.yaml
##########
@@ -0,0 +1,133 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.satellite.enabled }}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  labels:
+    app: {{ template "skywalking.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
+    component: "{{ .Values.satellite.name }}"
+    heritage: {{ .Release.Service }}
+    release: {{ .Release.Name }}
+  name: {{ template "skywalking.satellite.fullname" . }}
+spec:
+  replicas: {{ .Values.satellite.replicas }}
+  selector:
+    matchLabels:
+      app: {{ template "skywalking.name" . }}
+      component: "{{ .Values.satellite.name }}"
+      release: {{ .Release.Name }}
+  template:
+    metadata:
+      labels:
+        app: {{ template "skywalking.name" . }}
+        component: "{{ .Values.satellite.name }}"
+        release: {{ .Release.Name }}
+        {{- if .Values.satellite.podAnnotations }}
+      annotations:
+{{ toYaml .Values.satellite.podAnnotations | indent 8 }}
+        {{- end }}
+    spec:
+      serviceAccountName: {{ template "skywalking.serviceAccountName.satellite" . }}
+      affinity:
+      {{- if eq .Values.satellite.antiAffinity "hard" }}
+        podAntiAffinity:
+          requiredDuringSchedulingIgnoredDuringExecution:
+            - topologyKey: "kubernetes.io/hostname"
+              labelSelector:
+                matchLabels:
+                  app: "{{ template "skywalking.name" . }}"
+                  release: "{{ .Release.Name }}"
+                  component: "{{ .Values.satellite.name }}"
+      {{- else if eq .Values.satellite.antiAffinity "soft" }}
+        podAntiAffinity:
+          preferredDuringSchedulingIgnoredDuringExecution:
+          - weight: 1
+            podAffinityTerm:
+              topologyKey: kubernetes.io/hostname
+              labelSelector:
+                matchLabels:
+                  app: "{{ template "skywalking.name" . }}"
+                  release: "{{ .Release.Name }}"
+                  component: "{{ .Values.satellite.name }}"
+      {{- end }}
+      {{- with .Values.satellite.nodeAffinity }}
+        nodeAffinity:
+{{ toYaml . | indent 10 }}
+      {{- end }}
+{{- if .Values.satellite.nodeSelector }}
+      nodeSelector:
+{{ toYaml .Values.satellite.nodeSelector | indent 8 }}
+{{- end }}
+{{- if .Values.satellite.tolerations }}
+      tolerations:
+{{ toYaml .Values.satellite.tolerations | indent 8 }}
+{{- end }}
+{{- if .Values.imagePullSecrets }}
+      imagePullSecrets:
+{{ toYaml .Values.imagePullSecrets | indent 8 }}
+{{- end }}
+      containers:
+      - name: {{ .Values.satellite.name }}
+        image: {{ .Values.satellite.image.repository }}:{{ required "satellite.image.tag is required" .Values.satellite.image.tag }}
+        imagePullPolicy: {{ .Values.satellite.image.pullPolicy }}
+        livenessProbe:
+          tcpSocket:
+            port: 11800
+          initialDelaySeconds: 15
+          periodSeconds: 20
+        ports:
+        {{- range $key, $value :=  .Values.satellite.ports }}
+        - containerPort: {{ $value }}
+          name: {{ $key }}
+        {{- end }}
+{{- if .Values.satellite.resources }}
+        resources:
+{{ toYaml .Values.satellite.resources | indent 10 }}
+{{- end }}
+        env:
+        - name: SATELLITE_GRPC_CLIENT_FINDER
+          value: kubernetes
+        - name: SATELLITE_GRPC_CLIENT_KUBERNETES_NAMESPACE
+          value: "{{ .Release.Namespace }}"
+        - name: SATELLITE_GRPC_CLIENT_KUBERNETES_KIND
+          value: pod
+        - name: SATELLITE_GRPC_CLIENT_KUBERNETES_SELECTOR_LABEL
+          value: "app={{ template "skywalking.name" . }},release={{ .Release.Name }},component={{ .Values.oap.name }}"

Review comment:
       Is `component` not `{{ .Values.satellite.name }}`?

##########
File path: chart/skywalking/templates/oap-clusterrolebinding.yaml
##########
@@ -31,4 +31,9 @@ subjects:
 - kind: ServiceAccount
   name: {{ template "skywalking.serviceAccountName.oap" . }}
   namespace: {{ .Release.Namespace }}
+{{- if .Values.satellite.enabled }}

Review comment:
       Why does the satellite need the cluster role? Which resources it has to get?




-- 
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