Skip to content

Commit

Permalink
CX bundle updated, Dockerfiles and Skaffold file. Multiservice inner-…
Browse files Browse the repository at this point in the history
…loop skaffold file added in deployment repo
  • Loading branch information
emichaf committed Aug 21, 2019
1 parent 4656a7c commit 5e226a9
Show file tree
Hide file tree
Showing 19 changed files with 274 additions and 85 deletions.
6 changes: 5 additions & 1 deletion bundles/Cx/build-source/gerrit-postgres-config/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,15 @@ sed -i -e "s%CX_IMAGE_REGISTRY_SED%${CX_IMAGE_REGISTRY//&/\\&}%g" $SKAFFOLD_FILE
sed -i -e "s%CX_IMAGE_REPOSITORY_SED%${CX_IMAGE_REPOSITORY//&/\\&}%g" $SKAFFOLD_FILE_MS_BACKEND_TO_SED
sed -i -e "s%K8S_DOMAIN_NAME_TO_SED%${K8S_DOMAIN_NAME//&/\\&}%g" $SKAFFOLD_FILE_MS_BACKEND_TO_SED

SKAFFOLD_FILE_MS_FRONTEND_TO_SED=/seed/projects/ms-frontend/skaffold.yaml
SKAFFOLD_FILE_MS_FRONTEND_TO_SED=/seed/projects/deployments/skaffold.yaml
sed -i -e "s%CX_IMAGE_REGISTRY_SED%${CX_IMAGE_REGISTRY//&/\\&}%g" $SKAFFOLD_FILE_MS_FRONTEND_TO_SED
sed -i -e "s%CX_IMAGE_REPOSITORY_SED%${CX_IMAGE_REPOSITORY//&/\\&}%g" $SKAFFOLD_FILE_MS_FRONTEND_TO_SED
sed -i -e "s%K8S_DOMAIN_NAME_TO_SED%${K8S_DOMAIN_NAME//&/\\&}%g" $SKAFFOLD_FILE_MS_FRONTEND_TO_SED

SKAFFOLD_FILE_DEPLOYMENT_TO_SED=/seed/projects/ms-frontend/skaffold.yaml
sed -i -e "s%CX_IMAGE_REGISTRY_SED%${CX_IMAGE_REGISTRY//&/\\&}%g" $SKAFFOLD_FILE_DEPLOYMENT_TO_SED
sed -i -e "s%CX_IMAGE_REPOSITORY_SED%${CX_IMAGE_REPOSITORY//&/\\&}%g" $SKAFFOLD_FILE_DEPLOYMENT_TO_SED
sed -i -e "s%K8S_DOMAIN_NAME_TO_SED%${K8S_DOMAIN_NAME//&/\\&}%g" $SKAFFOLD_FILE_DEPLOYMENT_TO_SED

source ./setup.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ myapplication:
nodePort:

# Volume Mount Path to ConfigMap
ConfigMapvolumeMountPath: /deployments/config # Needed for spring-boot application.properties via ConfigMap
ConfigMapvolumeMountPath: /opt/target/config # OBS must match jar/war file folder location in Dockerfile (-/config)
#DatavolumeMountPath: # /data Leave empty if no volume is needed, OBS needed if persistence.enabled: true!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ myapplication:
nodePort:

# Volume Mount Path to ConfigMap
ConfigMapvolumeMountPath: /deployments/config # Needed for spring-boot application.properties via ConfigMap
ConfigMapvolumeMountPath: /opt/target/config # OBS must match jar/war file folder location in Dockerfile (-/config)
#DatavolumeMountPath: # /data Leave empty if no volume is needed, OBS needed if persistence.enabled: true!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ myapplication:
nodePort:

# Volume Mount Path to ConfigMap
ConfigMapvolumeMountPath: /deployments/config # Needed for spring-boot application.properties via ConfigMap
ConfigMapvolumeMountPath: /opt/target/config # OBS must match jar/war file folder location in Dockerfile (-/config)
#DatavolumeMountPath: # /data Leave empty if no volume is needed, OBS needed if persistence.enabled: true!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ Create chart name and version as used by the chart label.
{{- define "myapplication.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Format secret for pullsecret.
*/}}
{{- define "imagePullSecret" }}
{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.imageCredentials.registry (printf "%s:%s" .Values.imageCredentials.username .Values.imageCredentials.password | b64enc) | b64enc }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,17 @@
## Maintainer: [email protected]
##
##--------------------------------------------------------------------------------------
{{- if .Values.imageCredentials.password }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "myapplication.fullname" . }}
name: {{ .Values.image.pullSecret }}
labels:
app: {{ template "myapplication.name" . }}
chart: {{ template "myapplication.chart" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
type: kubernetes.io/dockerconfigjson
data:
{{ if .Values.myapplication.password }}
myapplication-password: {{ .Values.myapplication.password | b64enc | quote }}
{{ else }}
myapplication-password: {{ randAlphaNum 10 | b64enc | quote }}
{{ end }}

.dockerconfigjson: {{ template "imagePullSecret" . }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ spec:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec:
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end}}
{{- if .Values.image.pullSecret }}
imagePullSecrets:
- name: {{ .Values.image.pullSecret }}
{{- end }}
{{- if .Values.rbacEnabled}}
serviceAccountName: {{ template "myapplication.fullname" . }}
Expand Down Expand Up @@ -121,11 +119,6 @@ spec:
value: "myapplication@$(MY_POD_IP)"
- name: K8S_SERVICE_NAME
value: "{{ template "myapplication.fullname" . }}"
- name: myapplication_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "myapplication.fullname" . }}
key: myapplication-password
envFrom:
- configMapRef:
name: {{ template "myapplication.fullname" . }}-config-env-vars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ image:
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
pullPolicy: Always
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
## Secrets must be manually created in the namespace. can be created with -> imageCredentials.registry/username/password
pullSecret:

## does your cluster have rbac enabled? assume yes by default
rbacEnabled: false

imageCredentials: # Secret (pullsecret), used together with image.pullSecret
registry:
username:
password:

## section of specific values for application
myapplication:
# Serviceport and ingress mapping to service
Expand All @@ -59,13 +60,7 @@ myapplication:
nodePort:

# Volume Mount Path to ConfigMap
volumeMountPath: /deployments/config


# pullsecret

## Disk free limit
diskFreeLimit: '"6GiB"'
volumeMountPath: /opt/target/config # OBS must match jar/war file folder location in Dockerfile (-/config)

## Environment Variable Configuration
configurationEnvironmentVars: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ image:
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
pullPolicy: Always
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
## Secrets must be manually created in the namespace. can be created with -> imageCredentials.registry/username/password
pullSecret:

## does your cluster have rbac enabled? assume yes by default
rbacEnabled: false

imageCredentials: # Secret (pullsecret), used together with image.pullSecret
registry:
username:
password:

## section of specific values for application
myapplication:
# Serviceport and ingress mapping to service
Expand All @@ -59,13 +60,7 @@ myapplication:
nodePort:

# Volume Mount Path to ConfigMap
volumeMountPath: /deployments/config


# pullsecret

## Disk free limit
diskFreeLimit: '"6GiB"'
volumeMountPath: /opt/target/config # OBS must match jar/war file folder location in Dockerfile (-/config)

## Environment Variable Configuration
configurationEnvironmentVars: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ image:
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
pullPolicy: Always
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
## Secrets must be manually created in the namespace. can be created with -> imageCredentials.registry/username/password
pullSecret:

## does your cluster have rbac enabled? assume yes by default
rbacEnabled: false

imageCredentials: # Secret (pullsecret), used together with image.pullSecret
registry:
username:
password:

## section of specific values for application
myapplication:
# Serviceport and ingress mapping to service
Expand All @@ -59,13 +60,7 @@ myapplication:
nodePort:

# Volume Mount Path to ConfigMap
volumeMountPath: /deployments/config


# pullsecret

## Disk free limit
diskFreeLimit: '"6GiB"'
volumeMountPath: /opt/target/config # OBS must match jar/war file folder location in Dockerfile (-/config)

## Environment Variable Configuration
configurationEnvironmentVars: |
Expand Down
Loading

0 comments on commit 5e226a9

Please sign in to comment.