Add oc-discovery
This commit is contained in:
BIN
cmd/oc-k8s
BIN
cmd/oc-k8s
Binary file not shown.
@@ -6,6 +6,16 @@ hostPort: 9500
|
|||||||
registryHost: oc
|
registryHost: oc
|
||||||
scheme: http
|
scheme: http
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
keys:
|
||||||
|
enabled: true
|
||||||
|
name: libp2p-keys
|
||||||
|
mountPath: ./pem
|
||||||
|
psk:
|
||||||
|
enabled: true
|
||||||
|
name: libp2p-psk
|
||||||
|
mountPath: ./psk
|
||||||
|
|
||||||
mongo-express:
|
mongo-express:
|
||||||
enabled: true
|
enabled: true
|
||||||
mongodbServer: "test-mongodb.test" # TO LOOK AFTER
|
mongodbServer: "test-mongodb.test" # TO LOOK AFTER
|
||||||
@@ -572,6 +582,24 @@ ocDatacenter:
|
|||||||
maxReplicas: 5
|
maxReplicas: 5
|
||||||
targetCPUUtilizationPercentage: 80
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocDiscovery:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: oc/oc-schedulerd:0.0.1
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
ocSchedulerd:
|
ocSchedulerd:
|
||||||
enabled: true
|
enabled: true
|
||||||
enableTraefikProxyIntegration: true
|
enableTraefikProxyIntegration: true
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ var REPOS = []string{
|
|||||||
"oc-schedulerd",
|
"oc-schedulerd",
|
||||||
"oc-workflow",
|
"oc-workflow",
|
||||||
"oc-workspace",
|
"oc-workspace",
|
||||||
|
"oc-discovery",
|
||||||
}
|
}
|
||||||
|
|
||||||
var officialRegistry = "opencloudregistry"
|
var officialRegistry = "opencloudregistry"
|
||||||
|
|||||||
60
utils/assets/templates/oc-discovery/deployment.yaml
Normal file
60
utils/assets/templates/oc-discovery/deployment.yaml
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
{{- if index .Values.ocDiscovery.enabled }}
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: oc-discovery
|
||||||
|
name: {{ .Release.Name }}-oc-discovery
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.ocDiscovery.replicas }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: oc-discovery
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: oc-discovery
|
||||||
|
spec:
|
||||||
|
{{- if or (eq .Values.env "prod") (eq .Values.env "staging") }}
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
{{- if .Values.secrets.psk.enabled }}
|
||||||
|
- name: psk-secret
|
||||||
|
secret:
|
||||||
|
secretName: {{ .Values.secrets.psk.name }}
|
||||||
|
optional: true
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secrets.keys.enabled }}
|
||||||
|
- name: keys-secret
|
||||||
|
secret:
|
||||||
|
secretName: {{ .Values.secrets.keys.name }}
|
||||||
|
optional: true
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- image: "{{ .Values.ocDiscovery.image }}"
|
||||||
|
name: oc-discovery
|
||||||
|
volumeMounts:
|
||||||
|
{{- if .Values.secrets.psk.enabled }}
|
||||||
|
- name: psk-secret
|
||||||
|
mountPath: /etc/psk
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secrets.keys.enabled }}
|
||||||
|
- name: keys-secret
|
||||||
|
mountPath: /etc/keys
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: opencloud-config
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: "{{ .Values.ocDiscovery.resources.limits.cpu }}"
|
||||||
|
memory: "{{ .Values.ocDiscovery.resources.limits.memory }}"
|
||||||
|
requests:
|
||||||
|
cpu: "{{ .Values.ocDiscovery.resources.requests.cpu }}"
|
||||||
|
memory: "{{ .Values.ocDiscovery.resources.requests.memory }}"
|
||||||
|
{{- end }}
|
||||||
40
utils/assets/templates/oc-discovery/service.yaml
Normal file
40
utils/assets/templates/oc-discovery/service.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{{- if index .Values.ocDiscovery.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: oc-discovery-svc
|
||||||
|
labels:
|
||||||
|
app: oc-discovery-svc
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 8080
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 8080
|
||||||
|
selector:
|
||||||
|
app: oc-discovery
|
||||||
|
type: ClusterIP
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if and .Values.ocDiscovery.enabled .Values.ocDiscovery.hpa.enabled }}
|
||||||
|
---
|
||||||
|
# Horizontal Pod Autoscaler
|
||||||
|
apiVersion: autoscaling/v2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-oc-discovery
|
||||||
|
spec:
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: {{ .Release.Name }}-oc-discovery
|
||||||
|
minReplicas: {{ .Values.ocDiscovery.hpa.minReplicas }}
|
||||||
|
maxReplicas: {{ .Values.ocDiscovery.hpa.maxReplicas }}
|
||||||
|
metrics:
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: cpu
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: {{ .Values.ocDiscovery.hpa.targetCPUUtilizationPercentage }}
|
||||||
|
{{- end }}
|
||||||
@@ -6,6 +6,16 @@ hostPort: ${PORT:-80}
|
|||||||
registryHost: ${REGISTRY_HOST:-oc}
|
registryHost: ${REGISTRY_HOST:-oc}
|
||||||
scheme: ${SCHEME:-http}
|
scheme: ${SCHEME:-http}
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
keys:
|
||||||
|
enabled: true
|
||||||
|
name: libp2p-keys
|
||||||
|
mountPath: ${PEM_FOLDER:-./pem}
|
||||||
|
psk:
|
||||||
|
enabled: true
|
||||||
|
name: libp2p-psk
|
||||||
|
mountPath: ${PSK_FOLDER:-./psk}
|
||||||
|
|
||||||
mongo-express:
|
mongo-express:
|
||||||
enabled: ${OC_MONGOEXPRESS_ENABLED:-true}
|
enabled: ${OC_MONGOEXPRESS_ENABLED:-true}
|
||||||
mongodbServer: "${RELEASE:-prod}-mongodb.${RELEASE:-prod}" # TO LOOK AFTER
|
mongodbServer: "${RELEASE:-prod}-mongodb.${RELEASE:-prod}" # TO LOOK AFTER
|
||||||
@@ -572,6 +582,24 @@ ocDatacenter:
|
|||||||
maxReplicas: ${OC_DATACENTER_REPLICAS_MAX:-5}
|
maxReplicas: ${OC_DATACENTER_REPLICAS_MAX:-5}
|
||||||
targetCPUUtilizationPercentage: ${OC_DATACENTER_REPLICAS_USAGE:-80}
|
targetCPUUtilizationPercentage: ${OC_DATACENTER_REPLICAS_USAGE:-80}
|
||||||
|
|
||||||
|
ocDiscovery:
|
||||||
|
enabled: ${OC_DISCOVERY_ENABLED:-true}
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: ${REGISTRY_HOST:-oc}/oc-schedulerd:${OC_DISCOVERY_IMAGE_VERSION:-0.0.1}
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: ${OC_DISCOVERY_LIMITS_CPU:-128m}
|
||||||
|
memory: ${DISCOVERY_LIMITS_MEMORY:-256Mi}
|
||||||
|
requests:
|
||||||
|
cpu: ${OC_DISCOVERY_REQUESTS_CPU:-128m}
|
||||||
|
memory: ${OC_SDISCOVERY_REQUESTS_MEMORY:-256Mi}
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: ${OC_DISCOVERY_REPLICAS_ENABLED:-true}
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: ${OC_DISCOVERY_REPLICAS_MAX:-5}
|
||||||
|
targetCPUUtilizationPercentage: ${OC_DISCOVERY_REPLICAS_USAGE:-80}
|
||||||
|
|
||||||
ocSchedulerd:
|
ocSchedulerd:
|
||||||
enabled: ${OC_SCHEDULERD_ENABLED:-true}
|
enabled: ${OC_SCHEDULERD_ENABLED:-true}
|
||||||
enableTraefikProxyIntegration: true
|
enableTraefikProxyIntegration: true
|
||||||
|
|||||||
Reference in New Issue
Block a user