From c7d27ab412e6ef0c14961aaa059ada97d1b39650 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Fri, 24 May 2019 12:56:27 +0200 Subject: [PATCH 1/5] add volume and mount to template --- deploy/template/tutorial-web-app.yml | 157 +++++++++++++++------------ 1 file changed, 87 insertions(+), 70 deletions(-) diff --git a/deploy/template/tutorial-web-app.yml b/deploy/template/tutorial-web-app.yml index dc441e9..f25f2f9 100644 --- a/deploy/template/tutorial-web-app.yml +++ b/deploy/template/tutorial-web-app.yml @@ -32,74 +32,91 @@ parameters: value: https://github.com/integr8ly/tutorial-web-app-walkthroughs.git#v1.6.4 required: true objects: -- apiVersion: v1 - kind: DeploymentConfig - metadata: - labels: - app: tutorial-web-app - name: tutorial-web-app - spec: - replicas: 1 - revisionHistoryLimit: 2 - selector: - app: tutorial-web-app - strategy: - rollingParams: - timeoutSeconds: 3600 - type: Rolling - template: - metadata: - labels: - app: tutorial-web-app - spec: - containers: - - env: - - name: KUBERNETES_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: OPENSHIFT_OAUTHCLIENT_ID - value: ${OPENSHIFT_OAUTHCLIENT_ID} - - name: OPENSHIFT_HOST - value: ${OPENSHIFT_HOST} - - name: NODE_ENV - value: production - - name: SSO_ROUTE - value: ${SSO_ROUTE} - - name: WALKTHROUGH_LOCATIONS - value: ${WALKTHROUGH_LOCATIONS} - - name: INTEGREATLY_VERSION - value: ${INTEGREATLY_VERSION} - image: quay.io/integreatly/tutorial-web-app:2.10.3 - imagePullPolicy: Always - name: tutorial-web-app - ports: - - containerPort: 5001 - name: http - protocol: TCP - triggers: - - type: ConfigChange -- apiVersion: v1 - kind: Service - metadata: - labels: - app: tutorial-web-app - name: tutorial-web-app - spec: - ports: - - name: http - port: 5001 - selector: - app: tutorial-web-app -- apiVersion: v1 - kind: Route - metadata: - labels: - app: tutorial-web-app - name: tutorial-web-app - spec: - tls: - termination: edge - to: - kind: Service + - apiVersion: v1 + kind: DeploymentConfig + metadata: + labels: + app: tutorial-web-app name: tutorial-web-app + spec: + replicas: 1 + revisionHistoryLimit: 2 + selector: + app: tutorial-web-app + strategy: + rollingParams: + timeoutSeconds: 3600 + type: Rolling + template: + metadata: + labels: + app: tutorial-web-app + spec: + volumes: + - name: user-walkthroughs + persistentVolumeClaim: + claimName: user-walkthroughs + containers: + - env: + - name: KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: OPENSHIFT_OAUTHCLIENT_ID + value: ${OPENSHIFT_OAUTHCLIENT_ID} + - name: OPENSHIFT_HOST + value: ${OPENSHIFT_HOST} + - name: NODE_ENV + value: production + - name: SSO_ROUTE + value: ${SSO_ROUTE} + - name: WALKTHROUGH_LOCATIONS + value: ${WALKTHROUGH_LOCATIONS} + - name: INTEGREATLY_VERSION + value: ${INTEGREATLY_VERSION} + image: quay.io/integreatly/tutorial-web-app:2.10.3 + imagePullPolicy: Always + name: tutorial-web-app + ports: + - containerPort: 5001 + name: http + protocol: TCP + volumeMounts: + - mountPath: /opt/user-walkthroughs + name: user-walkthroughs + triggers: + - type: ConfigChange + - apiVersion: v1 + kind: Service + metadata: + labels: + app: tutorial-web-app + name: tutorial-web-app + spec: + ports: + - name: http + port: 5001 + selector: + app: tutorial-web-app + - apiVersion: v1 + kind: Route + metadata: + labels: + app: tutorial-web-app + name: tutorial-web-app + spec: + tls: + termination: edge + to: + kind: Service + name: tutorial-web-app + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + name: user-walkthroughs + spec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: "100Mi" From 361162e1c0a2524693829aefe6b64ce403b361ec Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Fri, 24 May 2019 12:56:57 +0200 Subject: [PATCH 2/5] bump version --- Makefile | 2 +- deploy/operator.yaml | 2 +- version/version.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8206928..da14086 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL=/bin/bash REG=quay.io ORG=integreatly IMAGE=tutorial-web-app-operator -TAG=0.0.18 +TAG=0.0.19 KUBE_CMD=oc apply -f DEPLOY_DIR=deploy OUT_STATIC_DIR=tmp/_output diff --git a/deploy/operator.yaml b/deploy/operator.yaml index 323f15b..b61319b 100644 --- a/deploy/operator.yaml +++ b/deploy/operator.yaml @@ -15,7 +15,7 @@ spec: serviceAccountName: tutorial-web-app-operator containers: - name: tutorial-web-app-operator - image: quay.io/integreatly/tutorial-web-app-operator:v0.0.18 + image: quay.io/integreatly/tutorial-web-app-operator:v0.0.19 ports: - containerPort: 60000 name: metrics diff --git a/version/version.go b/version/version.go index a6d3cc9..a0c9413 100644 --- a/version/version.go +++ b/version/version.go @@ -1,5 +1,5 @@ package version var ( - Version = "0.0.18" + Version = "0.0.19" ) From 200162ca2c66c694cd33f34808a1fb3377e76202 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Fri, 24 May 2019 13:51:21 +0200 Subject: [PATCH 3/5] make database location a parameter --- deploy/template/tutorial-web-app.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deploy/template/tutorial-web-app.yml b/deploy/template/tutorial-web-app.yml index f25f2f9..bc9b101 100644 --- a/deploy/template/tutorial-web-app.yml +++ b/deploy/template/tutorial-web-app.yml @@ -31,6 +31,10 @@ parameters: description: A comma separated list of git repositories or paths to walkthrough directories value: https://github.com/integr8ly/tutorial-web-app-walkthroughs.git#v1.6.4 required: true + - name: DATABASE_LOCATION + description: The location of the user walkthroughs database in the filesystem + value: /opt/user-walkthroughs + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -74,6 +78,8 @@ objects: value: ${WALKTHROUGH_LOCATIONS} - name: INTEGREATLY_VERSION value: ${INTEGREATLY_VERSION} + - name: DATABASE_LOCATION + value: ${DATABASE_LOCATION} image: quay.io/integreatly/tutorial-web-app:2.10.3 imagePullPolicy: Always name: tutorial-web-app @@ -82,7 +88,7 @@ objects: name: http protocol: TCP volumeMounts: - - mountPath: /opt/user-walkthroughs + - mountPath: ${DATABASE_LOCATION} name: user-walkthroughs triggers: - type: ConfigChange From b2160e837a7cdabcc21d47a95900afb6c3e21090 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Tue, 4 Jun 2019 10:36:14 +0200 Subject: [PATCH 4/5] bump webapp version --- deploy/template/tutorial-web-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/template/tutorial-web-app.yml b/deploy/template/tutorial-web-app.yml index bc9b101..0a233f4 100644 --- a/deploy/template/tutorial-web-app.yml +++ b/deploy/template/tutorial-web-app.yml @@ -80,7 +80,7 @@ objects: value: ${INTEGREATLY_VERSION} - name: DATABASE_LOCATION value: ${DATABASE_LOCATION} - image: quay.io/integreatly/tutorial-web-app:2.10.3 + image: quay.io/integreatly/tutorial-web-app:2.10.4 imagePullPolicy: Always name: tutorial-web-app ports: From d7018a5144e13f120704ad1bb41207bfb19c3bf7 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Tue, 4 Jun 2019 10:43:06 +0200 Subject: [PATCH 5/5] update gopkg --- Gopkg.lock | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gopkg.lock b/Gopkg.lock index 78b1fad..d0241d3 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -772,8 +772,10 @@ "github.com/openshift/api/template/v1", "github.com/openshift/client-go/apps/clientset/versioned/fake", "github.com/openshift/client-go/apps/clientset/versioned/typed/apps/v1", + "github.com/openshift/client-go/apps/clientset/versioned/typed/apps/v1/fake", "github.com/openshift/client-go/route/clientset/versioned/fake", "github.com/openshift/client-go/route/clientset/versioned/typed/route/v1", + "github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake", "github.com/operator-framework/operator-sdk/pkg/k8sclient", "github.com/operator-framework/operator-sdk/pkg/sdk", "github.com/operator-framework/operator-sdk/pkg/util/k8sutil",