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

Create workspace devfile #256

Merged
merged 12 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
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
45 changes: 45 additions & 0 deletions .ci/deploy/resources/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# Copyright Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: v1
kind: ConfigMap
metadata:
name: devfile-registry
annotations:
qontract.recycle: "true"
registry.version: "2ca701f108df91385368c620cc23cc65b38aaf77"
data:
registry-config.yml: |
version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
debug:
addr: :5001
prometheus:
enabled: true
path: /metrics
.env.registry-viewer: |
NEXT_PUBLIC_ANALYTICS_WRITE_KEY={{analyticsWriteKey}}
DEVFILE_REGISTRIES=[{"name":"Community","url":"http://localhost:8080","fqdn":"{{hostAlias}}"}]
160 changes: 160 additions & 0 deletions .ci/deploy/resources/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
#
# Copyright Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: devfile-registry
name: devfile-registry
spec:
replicas: {{replicas}}
selector:
matchLabels:
app: devfile-registry
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
app: devfile-registry
spec:
volumes:
- name: devfile-registry-storage
emptyDir: {}
- name: config
configMap:
name: devfile-registry
items:
- key: registry-config.yml
path: config.yml
- name: viewer-env-file
configMap:
name: devfile-registry
items:
- key: .env.registry-viewer
path: .env.production
containers:
- image: "{{indexImageName}}:{{indexImageTag}}"
imagePullPolicy: "{{indexPullPolicy}}"
name: devfile-registry
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /health
port: 8080
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /health
port: 8080
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 3
startupProbe:
httpGet:
path: /viewer
port: 3000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 20
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 250m
memory: "{{indexMemoryLimit}}"
env:
- name: REGISTRY_NAME
value: "{{registryName}}"
- name: TELEMETRY_KEY
value: "{{telemetryKey}}"
- image: "{{viewerImageName}}:{{viewerImageTag}}"
imagePullPolicy: "{{viewerPullPolicy}}"
name: devfile-registry-viewer
livenessProbe:
httpGet:
path: /viewer
port: 3000
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 20
readinessProbe:
httpGet:
path: /viewer
port: 3000
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 20
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 250m
memory: "{{viewerMemoryLimit}}"
env:
- name: NEXT_PUBLIC_ANALYTICS_WRITE_KEY
value: "{{analyticsWriteKey}}"
- name: DEVFILE_REGISTRIES
value: |-
[{"name":"Community","url":"http://localhost:8080","fqdn":"{{hostAlias}}"}]
volumeMounts:
- name: viewer-env-file
mountPath: /app/.env.production
subPath: .env.production
readOnly: true
- image: "{{ociImageName}}:{{ociImageTag}}"
imagePullPolicy: "{{ociPullPolicy}}"
name: oci-registry
livenessProbe:
httpGet:
path: /v2
port: 5000
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /v2
port: 5000
initialDelaySeconds: 3
periodSeconds: 10
timeoutSeconds: 3
resources:
requests:
cpu: 1m
memory: 5Mi
limits:
cpu: 100m
memory: "{{ociMemoryLimit}}"
volumeMounts:
- name: devfile-registry-storage
mountPath: "/var/lib/registry"
- name: config
mountPath: "/etc/docker/registry"
readOnly: true
35 changes: 35 additions & 0 deletions .ci/deploy/resources/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# Copyright Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: devfile-registry
labels:
name: devfile-registry
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: "{{hostName}}"
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: devfile-registry
port:
number: 8080
29 changes: 29 additions & 0 deletions .ci/deploy/resources/route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Copyright Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app: devfile-registry
name: devfile-registry
spec:
host: "{{hostName}}"
to:
kind: Service
name: devfile-registry
weight: 100
port:
targetPort: 8080
37 changes: 37 additions & 0 deletions .ci/deploy/resources/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# Copyright Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: v1
kind: Service
metadata:
name: devfile-registry
labels:
app: devfile-registry
spec:
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 8080
- name: oci-metrics
protocol: TCP
port: 5001
targetPort: 5001
- name: index-metrics
protocol: TCP
port: 7071
targetPort: 7071
selector:
app: devfile-registry
Loading
Loading