Skip to content

Commit

Permalink
create example server 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadVatandoost committed Nov 8, 2023
1 parent a09bab4 commit 8a0bff9
Show file tree
Hide file tree
Showing 25 changed files with 402 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: xds-grpc-server-example
name: xds-grpc-server-example-1
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
Expand All @@ -11,7 +11,7 @@ spec:
server: "https://kubernetes.default.svc"
project: xds-control-plane
source:
path: example/server/deployments/helm/xds-grpc-server-example
path: example/server1/deployments/helm/xds-grpc-server-example
repoURL: https://github.com/mohammadVatandoost/xds-control-plane
targetRevision: HEAD
helm:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
# Name of the chart, aka service
name: xds-grpc-server-example
description: xds-grpc-server-example service
name: xds-grpc-server-example-1
description: xds-grpc-server-example-1 service
# Version of the chart
version: 0.1.0
# This should be equal to your service image version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ global:
imagePullSecrets: [name: registry-secret, name: mvatandoost]

serverExample:
imageName: "cp-example-server"
imageName: "cp-example-server-1"


nameOverride: ""
Expand Down
File renamed without changes.
19 changes: 19 additions & 0 deletions example/server2/deployments/argocd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: xds-grpc-server-example-2
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: test
server: "https://kubernetes.default.svc"
project: xds-control-plane
source:
path: example/server2/deployments/helm/xds-grpc-server-example
repoURL: https://github.com/mohammadVatandoost/xds-control-plane
targetRevision: HEAD
helm:
valueFiles:
- values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
.charts/
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: s3://helm-charts/divar
version: 0.1.0
digest: sha256:b6175141b45595a2c62f2a1e38f47d9a7bcf37a845f2ba3f9fdc64da92618118
generated: "2022-03-02T09:22:26.132202454+03:30"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v2
# Name of the chart, aka service
name: xds-grpc-server-example-2
description: xds-grpc-server-example-2 service
# Version of the chart
version: 0.1.0
# This should be equal to your service image version.
appVersion: 0.1.0
type: application
# dependencies:
# - name: common
# version: 0.1.0
# repository: https://mohammadVatandoost.github.io/helm-chart/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Successful
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "MY_CHART.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "MY_CHART.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "MY_CHART.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "MY_CHART.labels" -}}
helm.sh/chart: {{ include "MY_CHART.chart" . }}
{{ include "MY_CHART.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "MY_CHART.selectorLabels" -}}
name: {{ .Release.Name }}
app: {{ .Chart.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "MY_CHART.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "MY_CHART.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-config
data:
{{- range $key,$val := .Values.configMap.data }}
{{ $key }}: {{ $val | quote }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
labels:
{{- include "MY_CHART.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "MY_CHART.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
rollme: {{ randAlphaNum 5 | quote }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "MY_CHART.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.global.image.registry }}/{{.Values.serverExample.imageName}}:{{ .Values.global.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.global.image.pullPolicy }}
ports:
{{- range .Values.service.ports }}
- containerPort: {{ .port }}
name: {{ .name }}
protocol: {{ .protocol }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
envFrom:
- configMapRef:
name: {{ .Release.Name }}-config
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-headless
labels:
{{- range $key,$val := .Values.service.labels }}
{{ $key }}: {{ $val | quote }}
{{- end }}
spec:
{{- if eq .Values.service.headless true }}
clusterIP: None
{{- end}}
ports:
{{- range .Values.service.ports }}
- port: {{ .port }}
name: {{ .name }}
targetPort: {{ .targetPort }}
protocol: {{ .protocol }}
{{- end }}
selector:
name: {{ .Release.Name }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Default values for MY_CHART.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 2


global:
image:
# -- Default registry for all control plane Images
registry: "mvatandoost"
# -- The default tag for all images, which itself defaults to .Chart.AppVersion
tag: 886210
pullPolicy: IfNotPresent
# -- Add `imagePullSecrets` to all the service accounts used for components
imagePullSecrets: [name: registry-secret, name: mvatandoost]

serverExample:
imageName: "cp-example-server-2"


nameOverride: ""
fullnameOverride: ""


podAnnotations: {}

service:
labels:
monitoring-app: xds-apps
xds/portName: grpc
type: clusterIP
headless: true
ports:
- name: grpc
port: 8888
targetPort: 8888
protocol: TCP
- name: metrics
port: 9000
targetPort: 9000
protocol: TCP


resources:
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 200m
memory: 100Mi

configMap:
data:
METRIC_LISTENPORT: 9000
REST_LISTENPORT: 8080
LOGGER_LEVEL: "info"
GRPC_LISTENPORT: 8888
GRPC_TIMEOUT: 5
XDS_PORT: 5678
Loading

0 comments on commit 8a0bff9

Please sign in to comment.