Skip to content

Commit fbb40f6

Browse files
Add config for konflux-workspaces in staging (#4040)
* add config for konflux-workspaces in staging This adds the necessary configuration for konflux-workspaces to be deployed into staging environments. Production environments support will come in a separate PR once this has been verified to be working and stable. Signed-off-by: Andy Sadler <[email protected]> * Changing application name and deleting from production Signed-off-by: David Peraza <[email protected]> --------- Signed-off-by: Andy Sadler <[email protected]> Signed-off-by: David Peraza <[email protected]> Co-authored-by: Andy Sadler <[email protected]>
1 parent 0a22d62 commit fbb40f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1402
-0
lines changed

argo-cd-apps/base/host/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resources:
66
- segment-bridge
77
- ingresscontroller
88
- smee
9+
- workspaces
910
components:
1011
- ../../k-components/deploy-to-host-cluster-merge-generator
1112
- ../../k-components/inject-argocd-namespace
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- workspaces.yaml
5+
components:
6+
- ../../../k-components/inject-infra-deployments-repo-details
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: ApplicationSet
3+
metadata:
4+
name: workspaces
5+
spec:
6+
generators:
7+
- merge:
8+
mergeKeys:
9+
- nameNormalized
10+
generators:
11+
- clusters:
12+
values:
13+
sourceRoot: components/workspaces
14+
environment: staging
15+
clusterDir: ""
16+
- list:
17+
elements: []
18+
template:
19+
metadata:
20+
name: workspaces-{{nameNormalized}}
21+
spec:
22+
project: default
23+
source:
24+
path: '{{values.sourceRoot}}/{{values.environment}}/{{values.clusterDir}}'
25+
repoURL: https://github.com/redhat-appstudio/infra-deployments.git
26+
targetRevision: main
27+
destination:
28+
namespace: konflux-workspaces
29+
server: '{{server}}'
30+
syncPolicy:
31+
automated:
32+
prune: true
33+
selfHeal: true
34+
syncOptions:
35+
- CreateNamespace=true
36+
retry:
37+
limit: -1
38+
backoff:
39+
duration: 10s
40+
factor: 2
41+
maxDuration: 3m

argo-cd-apps/overlays/development/delete-applications.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,9 @@ kind: ApplicationSet
9494
metadata:
9595
name: gitops
9696
$patch: delete
97+
---
98+
apiVersion: argoproj.io/v1alpha1
99+
kind: ApplicationSet
100+
metadata:
101+
name: workspaces
102+
$patch: delete

argo-cd-apps/overlays/konflux-public-production/delete-applications.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ metadata:
55
name: gitops
66
$patch: delete
77
---
8+
apiVersion: argoproj.io/v1alpha1
9+
kind: ApplicationSet
10+
metadata:
11+
name: workspaces
12+
$patch: delete

argo-cd-apps/overlays/production-downstream/delete-applications.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ metadata:
3030
name: quality-dashboard
3131
$patch: delete
3232
---
33+
apiVersion: argoproj.io/v1alpha1
34+
kind: ApplicationSet
35+
metadata:
36+
name: workspaces
37+
$patch: delete

components/ui/base/proxy/nginx.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ http {
5858
proxy_read_timeout 30m;
5959
}
6060

61+
location /apis/workspaces.konflux.io/ {
62+
# Konflux Workspaces
63+
proxy_pass http://workspaces-rest-api-server.workspaces-system.svc.cluster.local/;
64+
}
65+
6166
location /wss/k8s/ {
6267
# Kube-API websockets
6368
proxy_pass http://api.toolchain-host-operator.svc.cluster.local/;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- operator/config/default
5+
- server/config/default
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.14.0
7+
name: internalworkspaces.workspaces.konflux.io
8+
spec:
9+
group: workspaces.konflux.io
10+
names:
11+
kind: InternalWorkspace
12+
listKind: InternalWorkspaceList
13+
plural: internalworkspaces
14+
singular: internalworkspace
15+
scope: Namespaced
16+
versions:
17+
- additionalPrinterColumns:
18+
- jsonPath: .spec.visibility
19+
name: Visibility
20+
type: string
21+
name: v1alpha1
22+
schema:
23+
openAPIV3Schema:
24+
description: InternalWorkspace is the Schema for the workspaces API
25+
properties:
26+
apiVersion:
27+
description: |-
28+
APIVersion defines the versioned schema of this representation of an object.
29+
Servers should convert recognized schemas to the latest internal value, and
30+
may reject unrecognized values.
31+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
32+
type: string
33+
kind:
34+
description: |-
35+
Kind is a string value representing the REST resource this object represents.
36+
Servers may infer this from the endpoint the client submits requests to.
37+
Cannot be updated.
38+
In CamelCase.
39+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
40+
type: string
41+
metadata:
42+
type: object
43+
spec:
44+
description: InternalWorkspaceSpec defines the desired state of Workspace
45+
properties:
46+
displayName:
47+
type: string
48+
owner:
49+
description: UserInfo contains information about a user identity
50+
properties:
51+
jwtInfo:
52+
description: JwtInfo contains information extracted from the user
53+
JWT Token
54+
properties:
55+
email:
56+
type: string
57+
sub:
58+
type: string
59+
userId:
60+
type: string
61+
required:
62+
- email
63+
- sub
64+
- userId
65+
type: object
66+
required:
67+
- jwtInfo
68+
type: object
69+
visibility:
70+
enum:
71+
- community
72+
- private
73+
type: string
74+
required:
75+
- displayName
76+
- owner
77+
- visibility
78+
type: object
79+
status:
80+
description: InternalWorkspaceStatus defines the observed state of Workspace
81+
properties:
82+
conditions:
83+
items:
84+
description: "Condition contains details for one aspect of the current
85+
state of this API Resource.\n---\nThis struct is intended for
86+
direct use as an array at the field path .status.conditions. For
87+
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
88+
observations of a foo's current state.\n\t // Known .status.conditions.type
89+
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
90+
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
91+
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
92+
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
93+
\ // other fields\n\t}"
94+
properties:
95+
lastTransitionTime:
96+
description: |-
97+
lastTransitionTime is the last time the condition transitioned from one status to another.
98+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
99+
format: date-time
100+
type: string
101+
message:
102+
description: |-
103+
message is a human readable message indicating details about the transition.
104+
This may be an empty string.
105+
maxLength: 32768
106+
type: string
107+
observedGeneration:
108+
description: |-
109+
observedGeneration represents the .metadata.generation that the condition was set based upon.
110+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
111+
with respect to the current state of the instance.
112+
format: int64
113+
minimum: 0
114+
type: integer
115+
reason:
116+
description: |-
117+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
118+
Producers of specific condition types may define expected values and meanings for this field,
119+
and whether the values are considered a guaranteed API.
120+
The value should be a CamelCase string.
121+
This field may not be empty.
122+
maxLength: 1024
123+
minLength: 1
124+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
125+
type: string
126+
status:
127+
description: status of the condition, one of True, False, Unknown.
128+
enum:
129+
- "True"
130+
- "False"
131+
- Unknown
132+
type: string
133+
type:
134+
description: |-
135+
type of condition in CamelCase or in foo.example.com/CamelCase.
136+
---
137+
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
138+
useful (see .node.status.conditions), the ability to deconflict is important.
139+
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
140+
maxLength: 316
141+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
142+
type: string
143+
required:
144+
- lastTransitionTime
145+
- message
146+
- reason
147+
- status
148+
- type
149+
type: object
150+
type: array
151+
owner:
152+
description: Owner contains information on the owner
153+
properties:
154+
username:
155+
type: string
156+
type: object
157+
space:
158+
description: Space contains information about the underlying Space
159+
properties:
160+
isHome:
161+
type: boolean
162+
name:
163+
type: string
164+
required:
165+
- isHome
166+
- name
167+
type: object
168+
type: object
169+
type: object
170+
served: true
171+
storage: true
172+
subresources:
173+
status: {}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- bases/workspaces.konflux.io_internalworkspaces.yaml
5+
#+kubebuilder:scaffold:crdkustomizeresource
6+
7+
patches: []
8+
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
9+
# patches here are for enabling the conversion webhook for each CRD
10+
#- patches/webhook_in_workspaces.yaml
11+
#+kubebuilder:scaffold:crdkustomizewebhookpatch
12+
13+
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
14+
# patches here are for enabling the CA injection for each CRD
15+
#- patches/cainjection_in_workspaces.yaml
16+
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
17+
18+
# the following config is for teaching kustomize how to do kustomization for CRDs.
19+
configurations:
20+
- kustomizeconfig.yaml

0 commit comments

Comments
 (0)