-
Notifications
You must be signed in to change notification settings - Fork 5
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
add basic sample app that works w/ project admin #34
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: mysql | ||
namespace: mysql-persistent | ||
labels: | ||
app: mysql | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- kind: Namespace | ||
apiVersion: v1 | ||
metadata: | ||
name: mysql-persistent | ||
labels: | ||
app: mysql | ||
- apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: mysql-persistent-sa | ||
namespace: mysql-persistent | ||
labels: | ||
component: mysql-persistent | ||
- kind: SecurityContextConstraints | ||
apiVersion: security.openshift.io/v1 | ||
metadata: | ||
name: mysql-persistent-scc | ||
allowPrivilegeEscalation: false | ||
allowPrivilegedContainer: false | ||
volumes: | ||
- '*' | ||
users: | ||
- system: nacuser | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if created user has different name, it will work? (should this have space between : ?) |
||
- system:serviceaccount:mysql-persistent:mysql-persistent-sa | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
template.openshift.io/expose-uri: mariadb://{.spec.clusterIP}:{.spec.ports[?(.name=="mysql")].port} | ||
name: mysql | ||
namespace: mysql-persistent | ||
labels: | ||
app: mysql | ||
service: mysql | ||
spec: | ||
ports: | ||
- protocol: TCP | ||
name: mysql | ||
port: 3306 | ||
selector: | ||
app: mysql | ||
- apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
template.alpha.openshift.io/wait-for-ready: 'true' | ||
name: mysql | ||
namespace: mysql-persistent | ||
labels: | ||
e2e-app: "true" | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: mysql | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
e2e-app: "true" | ||
app: mysql | ||
curl-tool: "true" | ||
spec: | ||
serviceAccountName: mysql-persistent-sa | ||
containers: | ||
- image: registry.redhat.io/rhel8/mariadb-105:latest | ||
name: mysql | ||
env: | ||
- name: MYSQL_USER | ||
value: changeme | ||
- name: MYSQL_PASSWORD | ||
value: changeme | ||
- name: MYSQL_ROOT_PASSWORD | ||
value: root | ||
- name: MYSQL_DATABASE | ||
value: todolist | ||
ports: | ||
- containerPort: 3306 | ||
name: mysql | ||
resources: | ||
limits: | ||
memory: 512Mi | ||
volumeMounts: | ||
- name: mysql-data | ||
mountPath: /var/lib/mysql | ||
livenessProbe: | ||
tcpSocket: | ||
port: mysql | ||
initialDelaySeconds: 30 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
startupProbe: | ||
exec: | ||
command: | ||
- /usr/bin/timeout | ||
- 1s | ||
- /usr/bin/mysql | ||
- $(MYSQL_DATABASE) | ||
- -h | ||
- 127.0.0.1 | ||
- -u$(MYSQL_USER) | ||
- -p$(MYSQL_PASSWORD) | ||
- -e EXIT | ||
initialDelaySeconds: 5 | ||
periodSeconds: 30 | ||
timeoutSeconds: 2 | ||
successThreshold: 1 | ||
failureThreshold: 40 # 40x30sec before restart pod | ||
restartPolicy: Always | ||
- image: docker.io/curlimages/curl:8.5.0 | ||
name: curl-tool | ||
command: ["/bin/sleep", "infinity"] | ||
volumes: | ||
- name: mysql-data | ||
persistentVolumeClaim: | ||
claimName: mysql | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: todolist | ||
namespace: mysql-persistent | ||
labels: | ||
app: todolist | ||
service: todolist | ||
e2e-app: "true" | ||
spec: | ||
ports: | ||
- name: web | ||
port: 8000 | ||
targetPort: 8000 | ||
selector: | ||
app: todolist | ||
service: todolist | ||
- apiVersion: apps.openshift.io/v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
name: todolist | ||
namespace: mysql-persistent | ||
labels: | ||
app: todolist | ||
service: todolist | ||
e2e-app: "true" | ||
spec: | ||
replicas: 1 | ||
selector: | ||
app: todolist | ||
service: todolist | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: todolist | ||
service: todolist | ||
e2e-app: "true" | ||
spec: | ||
containers: | ||
- name: todolist | ||
image: quay.io/migtools/oadp-ci-todolist-mariadb-go:latest | ||
env: | ||
- name: foo | ||
value: bar | ||
ports: | ||
- containerPort: 8000 | ||
protocol: TCP | ||
initContainers: | ||
- name: init-myservice | ||
image: docker.io/curlimages/curl:8.5.0 | ||
command: ['sh', '-c', 'sleep 10; until /usr/bin/nc -z -w 1 mysql 3306; do echo Trying to connect to mysql DB port; sleep 5; done; echo mysql DB port reachable'] | ||
- apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
metadata: | ||
name: todolist-route | ||
namespace: mysql-persistent | ||
spec: | ||
path: "/" | ||
to: | ||
kind: Service | ||
name: todolist |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be renamed to something that more obviously hints about the contents? I'm not sure what "SC" would stand for in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why 2 separated files?