This commit is contained in:
2020-02-18 18:37:40 +01:00
parent d261b0a667
commit 6e46df2f21
11 changed files with 155 additions and 9 deletions

View File

@@ -29,8 +29,10 @@ https://developer.ibm.com/tutorials/deploy-a-hello-world-application-on-kubernet
https://github.com/tektoncd/pipeline/blob/master/docs/tutorial.md https://github.com/tektoncd/pipeline/blob/master/docs/tutorial.md
https://github.com/tektoncd/pipeline/blob/master/docs/install.md
install tekton install tekton
kubectl apply --filename https://storage.googleapis.com/tekton-releases/latest/release.yaml kubectl apply --filename https://storage.googleapis.com/tekton-releases/latest/release.yaml
docker config is een configmap gemaakt van config.json wa base64 username:pass inhoud heeft erges

21
hello/Chart.yaml Normal file
View File

@@ -0,0 +1,21 @@
apiVersion: v2
name: hello
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 1.16.0

View File

@@ -0,0 +1,14 @@
apiVersion: v1
kind: Pod
metadata:
name: server-a
labels:
server: "http"
expose: "true"
spec:
containers:
- name: front-end
image: IMAGE-A
ports:
- containerPort: 5000

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Pod
metadata:
name: server-b
labels:
server: "http"
spec:
containers:
- name: front-end
image: IMAGE-B
ports:
- containerPort: 5000

View File

@@ -0,0 +1,14 @@
kind: Service
apiVersion: v1
metadata:
name: expose-server
spec:
type: NodePort
selector:
expose: "true"
ports:
- name: http
protocol: TCP
targetPort: 5000
port: 5000
nodePort: 30036

View File

@@ -0,0 +1,11 @@
kind: Service
apiVersion: v1
metadata:
name: server-check
spec:
selector:
server: "http"
ports:
- name: http
protocol: TCP
port: 5000

68
hello/values.yaml Normal file
View File

@@ -0,0 +1,68 @@
# Default values for hello.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: nginx
pullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 80
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
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
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}

View File

@@ -83,4 +83,4 @@ spec:
resources: resources:
inputs: inputs:
- name: git-source - name: git-source
resource: git-source resource: git-source

View File

@@ -16,14 +16,15 @@ spec:
- name: pathToContext - name: pathToContext
value: "." value: "."
- name: imageUrl-a - name: imageUrl-a
value: "beppeserver-a" value: "gs://BUCKETNAME/server-a"
- name: imageTag-a - name: imageTag-a
value: "beppeserver-a-tag" value: "release"
- name: pathToContext-a - name: pathToContext-a
value: "./serverA" value: "./serverA"
- name: imageUrl-b - name: imageUrl-b
value: "beppeserver-b" value: "gs://BUCKETNAME/server-b"
- name: imageTag-b - name: imageTag-b
value: "beppeserver-b-tag" value: "release"
- name: pathToContext-b - name: pathToContext-b
value: "./serverB" value: "./serverB"

View File

@@ -9,4 +9,4 @@ spec:
- name: revision - name: revision
value: master value: master
- name: url - name: url
value: https://github.com/beppevanrolleghem/cicdTest value: git://github.com/beppevanrolleghem/cicdTest

View File

@@ -27,4 +27,7 @@ spec:
args: args:
- "--dockerfile=dockerfile" - "--dockerfile=dockerfile"
- "--destination=$(inputs.params.imageUrl):$(inputs.params.imageTag)" - "--destination=$(inputs.params.imageUrl):$(inputs.params.imageTag)"
- "--context=$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/" - "--context=$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/"
volumeMounts:
- name: docker-config
mountPath: /kaniko/.docker/