Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(backend): integrate source-peoplesoft into helm #597

Merged
merged 9 commits into from
Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .azure/pipelines/Phonebook.preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ jobs:
namespace: $(image_tag)
steps:
- checkout: none
- task: HelmInstaller@1
displayName: 'Install Helm 2.14.2'
inputs:
helmVersionToInstall: 2.14.2
- task: HelmDeploy@0
inputs:
connectionType: 'None'
namespace: '$(namespace)'
command: 'delete'
arguments: 'phonebook-$(namespace)'
- task: Kubernetes@1
displayName: 'Delete Namespace'
inputs:
Expand Down
39 changes: 39 additions & 0 deletions Phonebook/local-values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
host: &host "demo-phonebook.local"
contactUrl: "https://github.com/T-Systems-MMS/phonebook/issues"
roomPlanningToolUrl: null
contactEmail: &contactEmail "[email protected]"
ravenUrl: null
employeePictureEndpoint: null
assetsEndpoint: "https://demo-phonebook.local/assets"
environment: "development"
environmentTag: "dev"
rocketChatUrl: "https://open.rocket.chat"

frontend:
replicaCount: 1

source:
peoplesoft:
replicaCount: 1
environment: Development

traefik:
enabled: true
startupArguments:
- ""
dashboard:
enabled: true
domain: board.demo-phonebook.local
ingress:
annotations:
traefik.frontend.priority: "100"

ssl:
enabled: true
enforced: true
rbac:
enabled: true
kubernetes:
namespaces:
- kube-public
- default
10 changes: 5 additions & 5 deletions Phonebook/phonebook/requirements.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: traefik
repository: https://kubernetes-charts.storage.googleapis.com
version: 1.78.4
digest: sha256:c389e7cea35c8eb944d23340716cefac726a8dcf7dc1e76fd4338b619383899f
generated: "2019-10-21T22:00:43.8811404+02:00"
- name: traefik
repository: https://kubernetes-charts.storage.googleapis.com
version: 1.86.2
digest: sha256:6a6097b475625d15d6e156f79ec0950f5a850ae13b3dd7463c75e39526b6bc14
generated: "2020-04-10T21:54:06.4266672+02:00"
6 changes: 4 additions & 2 deletions Phonebook/phonebook/templates/frontend-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "phonebook.fullname" . -}}
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
Expand All @@ -9,8 +9,10 @@ metadata:
helm.sh/chart: {{ include "phonebook.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
kubernetes.io/ingress.class: traefik
traefik.frontend.priority: '10'
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
Expand Down
2 changes: 0 additions & 2 deletions Phonebook/phonebook/templates/frontend-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ metadata:
helm.sh/chart: {{ include "phonebook.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
kubernetes.io/ingress.class: traefik
spec:
type: {{ .Values.frontend.service.type }}
ports:
Expand Down
60 changes: 60 additions & 0 deletions Phonebook/phonebook/templates/source-peoplesoft-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "phonebook.fullname" . }}-peoplesoft
labels:
app.kubernetes.io/name: {{ include "phonebook.name" . }}-peoplesoft
helm.sh/chart: {{ include "phonebook.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: {{ .Values.source.peoplesoft.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "phonebook.name" . }}-peoplesoft
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "phonebook.name" . }}-peoplesoft
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
nodeSelector:
'beta.kubernetes.io/os': linux
containers:
- name: {{ .Chart.Name }}-{{ .Values.source.peoplesoft.name }}-peoplesoft
image: "{{ .Values.source.peoplesoft.image.repository }}/{{ .Values.source.peoplesoft.image.name}}:{{ .Values.source.peoplesoft.image.tag }}"
imagePullPolicy: {{ .Values.source.peoplesoft.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
# TODO: use when issue #594 is resolved
# livenessProbe:
# httpGet:
# path: /health
# port: http
# initialDelaySeconds: 6
# readinessProbe:
# httpGet:
# path: /health
# port: http
# initialDelaySeconds: 6
env:
- name: ASPNETCORE_ENVIRONMENT
value: "{{ .Values.source.peoplesoft.environment }}"
# See more in Doku https://t-systems-mms.github.io/phonebook/pages/development-guides/backend/getting-started
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
27 changes: 27 additions & 0 deletions Phonebook/phonebook/templates/source-peoplesoft-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "phonebook.fullname" . -}}
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}-peoplesoft
labels:
app.kubernetes.io/name: {{ include "phonebook.name" . }}-peoplesoft
helm.sh/chart: {{ include "phonebook.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
kubernetes.io/ingress.class: traefik
traefik.frontend.priority: '50'
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
rules:
- host: {{ .Values.host }}
http:
paths:
- path: /api
backend:
serviceName: {{ $fullName }}-peoplesoft
servicePort: http
{{- end }}
19 changes: 19 additions & 0 deletions Phonebook/phonebook/templates/source-peoplesoft-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "phonebook.fullname" . }}-peoplesoft
labels:
app.kubernetes.io/name: {{ include "phonebook.name" . }}
helm.sh/chart: {{ include "phonebook.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: {{ .Values.source.peoplesoft.service.type }}
ports:
- port: {{ .Values.source.peoplesoft.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "phonebook.name" . }}-peoplesoft
app.kubernetes.io/instance: {{ .Release.Name }}
26 changes: 20 additions & 6 deletions Phonebook/phonebook/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,45 @@

# General Variables
host: &host 'localhost'
environment: 'production'

# Frontend Variables
frontend:
name: frontend
image:
repository: tsystemsmms
name: phonebook-frontend
tag: 1.22.3
tag: 1.41.0
pullPolicy: Always
replicaCount: 3
service:
type: ClusterIP
port: 80

source:
peoplesoft:
name: source-peoplesoft
environment: Live
image:
repository: tsystemsmms
# TODO: Change to new image
name: phonebook-source-peoplesoft
tag: latest
pullPolicy: Always
replicaCount: 3
service:
type: ClusterIP
port: 80

ingress:
enabled: true
annotations:
{}

annotations: {}

# Traefik Configuration
# Traefik Configuration
traefik:
enabled: true
startupArguments:
- ''
- ""
ssl:
enabled: true
enforced: true
Expand Down
34 changes: 20 additions & 14 deletions Phonebook/readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Phonebook Application

The Deployment Guide for the Phonebook.
We use [traefik](https://traefik.io/) under the hood.
We use [traefik](https://traefik.io/) under the hood.

## Deployment

Expand All @@ -11,17 +11,17 @@ We use [traefik](https://traefik.io/) under the hood.

1. Create your `values.yml`. For settings look [here](#Settings).

```yml
# Minimal Working Example
host: &host 'example.com'
contactUrl: '<Your Contact Url, maybe an issue tracker?>'
roomPlanningToolUrl: '<Url to your Room Planning Tool>'
contactEmail: &contactEmail '<Your Contact Email>'
employeePictureEndpoint: '<Url To you User Picture Endpoint>'
assetsEndpoint: '<Url To you User Assets Endpoint>'
```
```yml
# Minimal Working Example
host: &host 'example.com'
contactUrl: '<Your Contact Url, maybe an issue tracker?>'
roomPlanningToolUrl: '<Url to your Room Planning Tool>'
contactEmail: &contactEmail '<Your Contact Email>'
employeePictureEndpoint: '<Url To you User Picture Endpoint>'
assetsEndpoint: '<Url To you User Assets Endpoint>'
```

For a more complete Example have a look at our demo [values.yml](../demo/values.yml).
For a more complete Example have a look at our demo [values.yml](../demo/values.yml).

2. Install your Phonebook application by running `helm install --values ./path/to/your/values.yml https://github.com/T-Systems-MMS/phonebook/releases/download/<latest release>/phonebook.tgz`

Expand All @@ -37,10 +37,10 @@ If you install into a different namespace than `kube-public` please be sure to a
| `environment` | Yes | Determines the Environment the application is running in. Possible values: `development`, `preview`, `production`. Read more [here](..\Phonebook.Frontend\src\environments\EnvironmentInterfaces.ts) | `development` | `production` |
| `environmentTag` | Yes | The tag that will be displayed alongside the title of the page. Can be any string. | Depends on the environment: `development` - `dev`, `preview`- `preview`, `production` - none | `demo-label` |
| `contactUrl` | Yes | The contact Url used for private Feedback throughout the app | none | `https://github.com/T-Systems-MMS/phonebook/issues` |
| `roomPlanningToolUrl` | No | If you are using a Room Planning Tool you can provide a link here. | none | `https://room.tool.com` |
| `roomPlanningToolUrl` | No | If you are using a Room Planning Tool you can provide a link here. | none | `https://room.tool.com` |
| `contactEmail` | Yes | Provide a contact Email for your users. | none | `[email protected]` |
| `ravenUrl` | No | If you want to collect Bug Reports automatically you can setup a [Sentry](https://sentry.io/) Instance provide the link for Raven through this parameter. | none | `https://<key>@sentry.io/<project>` |
| `employeePictureEnpoint` | No | Provide an Endpoint for the pictures of you users. | none | `https://employee.pictures.com` |
| `employeePictureEnpoint` | No | Provide an Endpoint for the pictures of you users. | none | `https://employee.pictures.com` |
| `assetsEndpoint` | Yes | Provide an Endpoint for the assets (roomplans, pictures of Building). | none | `https://assets.company.com` |
| `rocketChatUrl` | No | Add a direct link from the user profile to [RocketChat](https://rocket.chat/). (Linked by `person.Id`) | none | `https://rocketchat.yourcompany.com` |

Expand All @@ -63,4 +63,10 @@ helm delete <deployment-name>

## Development

Execute `helm install --dry-run --debug`
You need `helm2` and a running kubernetes cluster.

1. Add `phonebook-demo.local` to your hosts, pointing to `localhost` (127.0.0.1).
2. cd into the `/Phonebook` Folder
3. `helm install -f ./local-values.yml -n phonebook .\phonebook\`

Debug: `helm install --dry-run --debug -n phonebook .\phonebook\`
2 changes: 1 addition & 1 deletion demo/assets/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ COPY ./nginx/ ./
RUN rm -r /usr/share/nginx/html/*
COPY ./assets /usr/share/nginx/html

CMD ["nginx"]
CMD ["nginx"]
29 changes: 16 additions & 13 deletions demo/values.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
# Default values for phonebook.
# Demo values for phonebook.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# General Variables
host: &host 'demo-phonebook.me'
contactUrl: 'https://github.com/T-Systems-MMS/phonebook/issues'
host: &host "demo-phonebook.me"
contactUrl: "https://github.com/T-Systems-MMS/phonebook/issues"
roomPlanningToolUrl: null
contactEmail: &contactEmail '[email protected]'
contactEmail: &contactEmail "[email protected]"
ravenUrl: null
employeePictureEndpoint: null
assetsEndpoint: 'https://demo-phonebook.me/assets'
environment: 'preview'
environmentTag: 'demo'
rocketChatUrl: 'https://open.rocket.chat'
assetsEndpoint: "https://demo-phonebook.me/assets"
environment: "preview"
environmentTag: "demo"
rocketChatUrl: "https://open.rocket.chat"

frontend:
replicaCount: 1

source:
peoplesoft:
replicaCount: 1
environment: Development

resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand All @@ -39,13 +44,13 @@ affinity: {}
traefik:
enabled: true
startupArguments:
- ''
- ""
dashboard:
enabled: true
domain: board.demo-phonebook.me
ingress:
annotations:
traefik.frontend.priority: '100'
traefik.frontend.priority: "100"
ssl:
enabled: true
enforced: true
Expand All @@ -54,10 +59,8 @@ traefik:
enabled: true
email: *contactEmail
onHostRule: true
challengeType: 'http-01'
challengeType: "http-01"
domains:
enabled: true
rbac:
enabled: true
kubernetes:
namespaces: