diff --git a/template/api/deploy/templates/application.yaml b/template/api/deploy/templates/application.yaml new file mode 100644 index 0000000..ec8cc30 --- /dev/null +++ b/template/api/deploy/templates/application.yaml @@ -0,0 +1,20 @@ +apiVersion: app.k8s.io/v1beta1 +kind: Application +metadata: + name: {{ .Release.Name }} + namespace: {{ .Values.nameSpace }} + labels: + app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + annotations: + servicemesh.kubesphere.io/enabled: 'true' +spec: + selector: + matchLabels: + app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + addOwnerRef: true \ No newline at end of file diff --git a/template/api/deploy/templates/deployment.yaml b/template/api/deploy/templates/deployment.yaml index e990c24..6f357bb 100644 --- a/template/api/deploy/templates/deployment.yaml +++ b/template/api/deploy/templates/deployment.yaml @@ -5,18 +5,32 @@ metadata: namespace: {{ .Values.nameSpace }} labels: app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + app.kubernetes.io/instance: {{ .Release.Name }} annotations: kubesphere.io/alias-name: {{ .Values.aliasName }} kubesphere.io/creator: drone + meta.helm.sh/release-name: {{ .Release.Name }} + meta.helm.sh/release-namespace: {{ .Values.nameSpace }} spec: replicas: 1 selector: matchLabels: app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: labels: app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + app.kubernetes.io/instance: {{ .Release.Name }} spec: volumes: - name: host-time @@ -27,8 +41,8 @@ spec: - name: {{ .Release.Name }} image: {{ .Values.image }}:{{ .Values.imageTag }} ports: - - containerPort: {{ .Values.port }} - protocol: TCP + - containerPort: {{ .Values.port }} + protocol: TCP env: - name: endpoints value: 'etcd:2379' diff --git a/template/api/deploy/templates/ingress.yaml b/template/api/deploy/templates/ingress.yaml index 44bb7ee..cd01aa7 100644 --- a/template/api/deploy/templates/ingress.yaml +++ b/template/api/deploy/templates/ingress.yaml @@ -4,6 +4,12 @@ apiVersion: networking.k8s.io/v1 metadata: name: {{ .Release.Name }} namespace: {{ .Values.nameSpace }} + labels: + app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + app.kubernetes.io/instance: {{ .Release.Name }} annotations: kubesphere.io/creator: drone nginx.ingress.kubernetes.io/enable-cors: 'true' diff --git a/template/api/deploy/templates/service.yaml b/template/api/deploy/templates/service.yaml index 884383e..4cbc43c 100644 --- a/template/api/deploy/templates/service.yaml +++ b/template/api/deploy/templates/service.yaml @@ -7,6 +7,10 @@ metadata: kubesphere.io/creator: drone labels: app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + app.kubernetes.io/instance: {{ .Release.Name }} spec: ports: - name: http-{{ .Release.Name }} diff --git a/template/service/deploy/templates/application.yaml b/template/service/deploy/templates/application.yaml new file mode 100644 index 0000000..ec8cc30 --- /dev/null +++ b/template/service/deploy/templates/application.yaml @@ -0,0 +1,20 @@ +apiVersion: app.k8s.io/v1beta1 +kind: Application +metadata: + name: {{ .Release.Name }} + namespace: {{ .Values.nameSpace }} + labels: + app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + annotations: + servicemesh.kubesphere.io/enabled: 'true' +spec: + selector: + matchLabels: + app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + addOwnerRef: true \ No newline at end of file diff --git a/template/service/deploy/templates/deployment.yaml b/template/service/deploy/templates/deployment.yaml index e990c24..6f357bb 100644 --- a/template/service/deploy/templates/deployment.yaml +++ b/template/service/deploy/templates/deployment.yaml @@ -5,18 +5,32 @@ metadata: namespace: {{ .Values.nameSpace }} labels: app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + app.kubernetes.io/instance: {{ .Release.Name }} annotations: kubesphere.io/alias-name: {{ .Values.aliasName }} kubesphere.io/creator: drone + meta.helm.sh/release-name: {{ .Release.Name }} + meta.helm.sh/release-namespace: {{ .Values.nameSpace }} spec: replicas: 1 selector: matchLabels: app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: labels: app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + app.kubernetes.io/instance: {{ .Release.Name }} spec: volumes: - name: host-time @@ -27,8 +41,8 @@ spec: - name: {{ .Release.Name }} image: {{ .Values.image }}:{{ .Values.imageTag }} ports: - - containerPort: {{ .Values.port }} - protocol: TCP + - containerPort: {{ .Values.port }} + protocol: TCP env: - name: endpoints value: 'etcd:2379' diff --git a/template/service/deploy/templates/service.yaml b/template/service/deploy/templates/service.yaml index fbf4aeb..4cbc43c 100644 --- a/template/service/deploy/templates/service.yaml +++ b/template/service/deploy/templates/service.yaml @@ -7,9 +7,13 @@ metadata: kubesphere.io/creator: drone labels: app: {{ .Release.Name }} + app.kubernetes.io/version: v1 + app.kubernetes.io/name: {{ .Release.Name }} + version: v1 + app.kubernetes.io/instance: {{ .Release.Name }} spec: ports: - - name: grpc-{{ .Release.Name }} + - name: http-{{ .Release.Name }} protocol: TCP port: 80 targetPort: {{ .Values.port }}