Skip to content

Commit

Permalink
parameterize openshift template
Browse files Browse the repository at this point in the history
  • Loading branch information
jharting committed Jan 18, 2018
1 parent 44e9e50 commit bc52186
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions openshift-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ parameters:
- name: SLACK_CHANNEL
description: "Slack channel to post messages to"
value: insights-slackbot
- name: SERVER_TOKEN
- name: SERVER_SECRET
description: "Secret part of the URL that prevents unauthorized actors from posting"
value: ""
generate: expression
from: "[a-zA-Z0-9]{16}"
- name: APP_NAME
value: "insights-slackbot"

objects:
- apiVersion: v1
Expand All @@ -23,7 +26,7 @@ objects:
kind: Secret
metadata:
creationTimestamp: null
name: slack
name: ${APP_NAME}-secret
type: Opaque

- apiVersion: v1
Expand All @@ -50,13 +53,13 @@ objects:
metadata:
creationTimestamp: null
labels:
app: insights-slackbot
name: insights-slackbot
app: ${APP_NAME}
name: ${APP_NAME}
spec:
replicas: 1
selector:
app: insights-slackbot
deploymentconfig: insights-slackbot
app: ${APP_NAME}
deploymentconfig: ${APP_NAME}
strategy:
activeDeadlineSeconds: 21600
resources: {}
Expand All @@ -71,13 +74,13 @@ objects:
metadata:
creationTimestamp: null
labels:
app: insights-slackbot
deploymentconfig: insights-slackbot
app: ${APP_NAME}
deploymentconfig: ${APP_NAME}
spec:
containers:
- image: redhatinsights/insights-slackbot:latest
imagePullPolicy: Always
name: insights-slackbot
name: ${APP_NAME}
ports:
- containerPort: 3006
protocol: TCP
Expand All @@ -88,10 +91,10 @@ objects:
- name: SLACK_TOKEN
valueFrom:
secretKeyRef:
name: slack
name: ${APP_NAME}-secret
key: token
- name: SERVER_SECRET
value: ${SERVER_TOKEN}
value: ${SERVER_SECRET}
- name: SLACK_CHANNEL
value: ${SLACK_CHANNEL}
dnsPolicy: ClusterFirst
Expand All @@ -105,7 +108,7 @@ objects:
- imageChangeParams:
automatic: true
containerNames:
- insights-slackbot
- ${APP_NAME}
from:
kind: ImageStreamTag
name: insights-slackbot:latest
Expand All @@ -116,33 +119,35 @@ objects:
metadata:
creationTimestamp: null
labels:
app: insights-slackbot
name: insights-slackbot
app: ${APP_NAME}
name: ${APP_NAME}
spec:
ports:
- name: 3006-tcp
port: 3006
protocol: TCP
targetPort: 3006
selector:
deploymentconfig: insights-slackbot
deploymentconfig: ${APP_NAME}
sessionAffinity: None
type: ClusterIP

- apiVersion: v1
kind: Route
metadata:
creationTimestamp: null
name: insights-slackbot
labels:
app: ${APP_NAME}
name: ${APP_NAME}
spec:
path: /${SERVER_TOKEN}
path: /${SERVER_SECRET}
port:
targetPort: 3006-tcp
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
to:
kind: Service
name: insights-slackbot
name: ${APP_NAME}
weight: 100
wildcardPolicy: None

0 comments on commit bc52186

Please sign in to comment.