Skip to content

Commit f8b6b25

Browse files
authored
feat: add multicluster support (#56)
Signed-off-by: Chris Butler <chris.butler@redhat.com>
1 parent e993d3c commit f8b6b25

39 files changed

+1146
-117
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ install-config.yaml
1616
azure-env.sh
1717
.openshift*
1818
.DS_Store
19-
openshift-install
19+
openshift-install*
2020
node_modules
2121
.envrc
22-
.ansible/
22+
.ansible/
23+
__pycache__/

ansible/initdata-default.toml.tpl

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,44 @@ kbs_cert = """
2525
{{ trustee_cert }}
2626
"""
2727
'''
28+
29+
"policy.rego" = '''
30+
package agent_policy
31+
32+
default AddARPNeighborsRequest := true
33+
default AddSwapRequest := true
34+
default CloseStdinRequest := true
35+
default CopyFileRequest := true
36+
default CreateContainerRequest := true
37+
default CreateSandboxRequest := true
38+
default DestroySandboxRequest := true
39+
default ExecProcessRequest := false
40+
default GetMetricsRequest := true
41+
default GetOOMEventRequest := true
42+
default GuestDetailsRequest := true
43+
default ListInterfacesRequest := true
44+
default ListRoutesRequest := true
45+
default MemHotplugByProbeRequest := true
46+
default OnlineCPUMemRequest := true
47+
default PauseContainerRequest := true
48+
default PullImageRequest := true
49+
default ReadStreamRequest := false
50+
default RemoveContainerRequest := true
51+
default RemoveStaleVirtiofsShareMountsRequest := true
52+
default ReseedRandomDevRequest := true
53+
default ResumeContainerRequest := true
54+
default SetGuestDateTimeRequest := true
55+
default SetPolicyRequest := true
56+
default SignalProcessRequest := true
57+
default StartContainerRequest := true
58+
default StartTracingRequest := true
59+
default StatsContainerRequest := true
60+
default StopTracingRequest := true
61+
default TtyWinResizeRequest := true
62+
default UpdateContainerRequest := true
63+
default UpdateEphemeralMountsRequest := true
64+
default UpdateInterfaceRequest := true
65+
default UpdateRoutesRequest := true
66+
default WaitProcessRequest := true
67+
default WriteStreamRequest := true
68+
'''

charts/all/letsencrypt/values.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
global:
44
## -- String containing the domain including the apps. prefix. Gets set by the Validated Pattern framework
55
localClusterDomain: "apps.example.com"
6+
## -- String defining the cluster platform: "Azure" or "AWS" (overridden by values-global.yaml)
7+
clusterPlatform: ""
68

79

810
# -- This section contains all the parameters for the letsencrypt chart in
@@ -55,7 +57,7 @@ letsencrypt:
5557
azure:
5658
secretStoreKey: 'secret/data/global/azure'
5759

58-
60+
# Secret store configuration (overridden by values-global.yaml)
5961
secretStore:
60-
name: vault-backend
61-
kind: ClusterSecretStore
62+
name: ""
63+
kind: ""
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "hello-openshift.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "hello-openshift.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "hello-openshift.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "hello-openshift.labels" -}}
37+
helm.sh/chart: {{ include "hello-openshift.chart" . }}
38+
{{ include "hello-openshift.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "hello-openshift.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "hello-openshift.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Determine runtime class name based on cluster platform
55+
Returns "kata-remote" for Azure/AWS, "kata-cc" for other platforms
56+
*/}}
57+
{{- define "hello-openshift.runtimeClassName" -}}
58+
{{- if or (eq .Values.global.clusterPlatform "Azure") (eq .Values.global.clusterPlatform "AWS") -}}
59+
kata-remote
60+
{{- else -}}
61+
kata-cc
62+
{{- end -}}
63+
{{- end }}

charts/coco-supported/hello-openshift/templates/insecure-policy-pod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
annotations:
88
io.katacontainers.config.agent.policy: '{{ tpl ( .Files.Get "insecure-policy.rego") . | b64enc }}'
99
spec:
10-
runtimeClassName: kata-remote
10+
runtimeClassName: {{ include "hello-openshift.runtimeClassName" . }}
1111
containers:
1212
- name: hello-openshift
1313
image: quay.io/openshift/origin-hello-openshift

charts/coco-supported/hello-openshift/templates/secure-pod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
annotations:
88
peerpods: "true"
99
spec:
10-
runtimeClassName: kata-remote
10+
runtimeClassName: {{ include "hello-openshift.runtimeClassName" . }}
1111
containers:
1212
- name: hello-openshift
1313
image: quay.io/openshift/origin-hello-openshift

charts/coco-supported/hello-openshift/templates/standard-pod.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ metadata:
55
labels:
66
app: standard
77
spec:
8-
runtimeClassName: {{ .Values.global.runtimeClass }}
98
containers:
109
- name: hello-openshift
1110
image: quay.io/openshift/origin-hello-openshift
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Chart-specific values
2+
# Common values are inherited from values-global.yaml
3+
4+
# Global values used by this chart (overridden by values-global.yaml)
15
global:
2-
coco:
3-
runtimeClassName: kata-remote
6+
clusterPlatform: "" # Cluster platform: "Azure" or "AWS" - determines runtime class
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Chart-specific values
2+
# Common values are inherited from values-global.yaml
3+
4+
# Global values used by this chart (overridden by values-global.yaml)
15
global:
26
coco:
3-
runtimeClassName: kata-remote
7+
runtimeClassName: "" # Runtime class for confidential containers
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
{{ if .Values.sandbox.deploy }}
21
apiVersion: kataconfiguration.openshift.io/v1
32
kind: KataConfig
43
metadata:
54
annotations:
65
argocd.argoproj.io/sync-wave: "100"
76
name: default-kata-config
87
spec:
9-
enablePeerPods: true
10-
{{ end }}
8+
enablePeerPods: {{ if or (eq .Values.global.clusterPlatform "Azure") (eq .Values.global.clusterPlatform "AWS") }}true{{ else }}false{{ end }}

0 commit comments

Comments
 (0)