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

Kubecon #27

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
434fe07
add demochat chart
verchol Dec 3, 2017
cdb3e5f
update pull policy repository and image name
jennyps Dec 4, 2017
146782c
updated spec-->containers-->image
jennyps Dec 4, 2017
743acec
updated image name
jennyps Dec 4, 2017
54dd23c
updated name and description
jennyps Dec 4, 2017
2fe79a7
Update deployment.yaml
jennyps Dec 4, 2017
01a05c6
added pull secret
jennyps Dec 4, 2017
d375cab
added pull secret and image from cfcr
jennyps Dec 4, 2017
9951006
updated image name
jennyps Dec 4, 2017
17525e7
update login.html
jennyps Dec 4, 2017
2296320
updated image name
jennyps Dec 4, 2017
7962831
removed demoservice2
jennyps Dec 4, 2017
562aace
update login
jennyps Dec 4, 2017
e4c0a9d
udpated pull secret
jennyps Dec 4, 2017
c9f3a9f
Update Chart.yaml
jennyps Dec 4, 2017
7152f11
Update login.html
jennyps Dec 4, 2017
edf27cd
Update login.html
jennyps Dec 4, 2017
298523e
update login message
jennyps Dec 4, 2017
2e383da
update login
jennyps Dec 4, 2017
cb03dfd
remove tag from image name
jennyps Dec 4, 2017
6df5cdb
Update values.yaml
jennyps Dec 4, 2017
45e1213
update login 1
jennyps Dec 4, 2017
510849a
add integration test
verchol Dec 6, 2017
ff5bc33
change config map name
verchol Dec 6, 2017
5c9b5a0
update codefresh.yaml
verchol Dec 6, 2017
b5f98d7
udpate cf yaml
verchol Dec 6, 2017
57ddeeb
add sha and repo
verchol Dec 6, 2017
e8966f9
add lables
verchol Dec 6, 2017
6ecfa88
Update values.yaml
jennyps Dec 7, 2017
142beff
Update values.yaml
jennyps Dec 7, 2017
7002266
Update e2e.spec.yaml
jennyps Dec 7, 2017
d2b8838
Update login.html
jennyps Dec 7, 2017
7ade3dd
Update login.html
jennyps Dec 7, 2017
686629c
Update login.html
jennyps Dec 7, 2017
632bc0d
Update login.html
jennyps Dec 7, 2017
f6a27fc
Update values.yaml
jennyps Dec 7, 2017
45200ad
Merge branch 'kubecon' of https://github.com/containers101/demochat i…
jennyps Dec 7, 2017
ee35dfd
Merge branch 'kubecon' of github.com:jennyps/demochat into kubecon
jennyps Dec 7, 2017
5fde6c5
Update values.yaml
jennyps Dec 7, 2017
efbe613
Update deployment.yaml
jennyps Dec 7, 2017
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
80 changes: 21 additions & 59 deletions codefresh.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,29 @@
version: '1.0'
steps:
build_step:
title: Build
BuildingDockerImage:
title: Building Docker Image
type: build
image_name: verchol/demochat
#working_directory: ./service1/
dockerfile: Dockerfile
image_name: demochat
tag: '${{CF_BRANCH}}'
tag: '${{CF_BRANCH_TAG_NORMALIZED}}'

# unit_tests:
# title: Unit Tests
# image: ${{build_step}}
# fail_fast: false
# working-directory : /usr/src/app
# commands:
# - npm test

unit_test:
type: composition
working_directory: '${{main_clone}}'
composition:
version: '2'
services:
mongo:
image: 'mongo:latest'
ports:
- 27017
composition_candidates:
test:
image: '${{build_step}}'
command: npm test
push_to_registry:
title: Push To Registry
push:
type: push
candidate: ${{build_step}}
tag: ${{CF_BRANCH}}

deploy_to_ecs:
title: Deploy Container to ECS
image: codefresh/cf-deploy-ecs
commands:
- >-
cfecs-update --image-name containers101/demochat --image-tag
${{CF_BRANCH}} eu-west-1 demochat-production demochat-service
environment:
- 'AWS_ACCESS_KEY_ID=${{AWS_ACCESS_KEY_ID}}'
- 'AWS_SECRET_ACCESS_KEY=${{AWS_SECRET_ACCESS_KEY}}'
when:
condition:
all:
deploy_to_ecs: '"${{DEPLOY_ECS}}" == "true"'
title: push
description: Free text description
candidate: ${{BuildingDockerImage}}
image_name: verchol/demochat
tag: v1.0
registry: dockerhub

deploy_to_kubernetes:
image: codefresh/cf-deploy-kubernetes
tag: latest
working_directory: ${{main_clone}}
integration-tests:
title : helm step
image: verchol/helmclient:v2.6.1
commands:
- /cf-deploy-kubernetes deployment.yml
environment:
- KUBERNETES_USER=${{KUBERNETES_USER}}
- KUBERNETES_PASSWORD=${{KUBERNETES_PASSWORD}}
- KUBERNETES_SERVER=${{KUBERNETES_SERVER}}
- DOCKER_IMAGE_TAG=${{CF_BRANCH}}
when:
condition:
all:
deploy_to_kubernetes: '"${{DEPLOY_KUBERNETES}}" == "true"'
- kubectl config use-context gke_kuberentes_us-central1-a_demo-chat
- helm ls
- helm upgrade --install --namespace qa1 --set test.tries=40 --set appversion=14 --set tag=v1.0 --set=commit.sha={{CF_REVISION} --set=commit.branch=${{CF_BRANCH}} integrations${{CF_REVISION}} ./deploy/demochatChart
- sleep 10
- helm test integrations${{CF_REVISION}} || true
- kubectl delete pods/integrations${{CF_REVISION}}-e2e-test -nqa1
21 changes: 21 additions & 0 deletions deploy/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
4 changes: 4 additions & 0 deletions deploy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: demochat
name: demochat
version: 0.0.1
110 changes: 0 additions & 110 deletions deploy/all.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions deploy/charts/demoservice2/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
4 changes: 4 additions & 0 deletions deploy/charts/demoservice2/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: A Helm chart for Kubernetes
name: demoservice2
version: 0.1.1
19 changes: 19 additions & 0 deletions deploy/charts/demoservice2/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
http://{{ . }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.externalPort }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:{{ .Values.service.externalPort }}
{{- end }}
16 changes: 16 additions & 0 deletions deploy/charts/demoservice2/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "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).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
Empty file.
45 changes: 45 additions & 0 deletions deploy/charts/demoservice2/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: {{ template "name" . }}
appversion: "{{.Values.appversion}}"
release: {{ .Release.Name }}
test : "works"
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
env:
- name: appversion
value : "2"
# - name: service

# value : "{{.Values.service.name}}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.service.internalPort }}
livenessProbe:
httpGet:
path: /
port: {{ .Values.service.internalPort }}
readinessProbe:
httpGet:
path: /mongo
port: {{ .Values.service.internalPort }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
32 changes: 32 additions & 0 deletions deploy/charts/demoservice2/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if .Values.ingress.enabled -}}
{{- $serviceName := include "fullname" . -}}
{{- $servicePort := .Values.service.externalPort -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: /
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $servicePort }}
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
19 changes: 19 additions & 0 deletions deploy/charts/demoservice2/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.externalPort }}
targetPort: {{ .Values.service.internalPort }}
protocol: TCP
name: {{ .Values.service.name }}
selector:
app: {{ template "name" . }}
release: {{ .Release.Name }}
Loading