Skip to content

Commit bbeb442

Browse files
authored
feat!: update to general availability versions of sandboxed containers and trustee (#54)
* feat!: update to general availability versions of sandboxed containers and trustee BREAKING CHANGE: pre GA releases will no longer work due to introduction of compressed initdata Signed-off-by: Chris Butler <chris.butler@redhat.com> * fix: linting fixes Signed-off-by: Chris Butler <chris.butler@redhat.com> * fix: linting errors Signed-off-by: Chris Butler <chris.butler@redhat.com> * fix: python and markdown linting Signed-off-by: Chris Butler <chris.butler@redhat.com> * chore: markdown fixes Signed-off-by: Chris Butler <chris.butler@redhat.com> * fix: remove gzipper and use newly available gzip Signed-off-by: Chris Butler <chris.butler@redhat.com> * fix: remove manual approval until a better solution is made Signed-off-by: Chris Butler <chris.butler@redhat.com> * chore: revert LE to default for cluster Signed-off-by: Chris Butler <chris.butler@redhat.com> * fix: ensure pinning of csvs Signed-off-by: Chris Butler <chris.butler@redhat.com> --------- Signed-off-by: Chris Butler <chris.butler@redhat.com>
1 parent 4b67132 commit bbeb442

File tree

9 files changed

+92
-21
lines changed

9 files changed

+92
-21
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,27 @@ Future work includes:
2929

3030
## Major versions
3131

32+
### `3.*`
33+
34+
Version `3.*` of the pattern is currently constrained to support the general availability releases of coco.
35+
36+
- (OpenShift Sandboxed Containers Operator) `1.10.*` and above
37+
- Trustee `0.4.*`
38+
39+
This limits support to OpenShift 4.16 and higher.
40+
41+
The pattern has been tested on Azure for two installation methods:
42+
43+
1. Installing onto an ARO cluster
44+
2. Self managed OpenShift install using the `openshift-install` CLI.
45+
46+
#### Known limitations
47+
48+
[Additional configuration](https://issues.redhat.com/browse/KATA-4107) is required to pull secrets from authenticated registries.
49+
3250
### `2.*`
3351

34-
This is currently the `main` branch for the repository. Version 2.* of the pattern is currently constrained to support:
52+
Version `2.*` of the pattern is currently constrained to support:
3553

3654
- (OpenShift Sandboxed Containers Operator) `1.9.*`
3755
- Trustee `0.3.*`

ansible/init-data-gzipper.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
- name: Collect AWS facts and set secrurity group policies
2+
become: false
3+
connection: local
4+
hosts: localhost
5+
gather_facts: false
6+
vars:
7+
kubeconfig: "{{ lookup('env', 'KUBECONFIG') }}"
8+
cluster_platform: "{{ global.clusterPlatform | default('none') | lower }}"
9+
hub_domain: "{{ global.hubClusterDomain | default('none') | lower}}"
10+
template_src: "initdata-default.toml.tpl"
11+
tasks:
12+
- name: Create temporary working directory
13+
ansible.builtin.tempfile:
14+
state: directory
15+
suffix: initdata
16+
register: tmpdir
17+
18+
- name: Define temp file paths
19+
ansible.builtin.set_fact:
20+
rendered_path: "{{ tmpdir.path }}/rendered.toml"
21+
gz_path: "{{ tmpdir.path }}/rendered.toml.gz"
22+
23+
- name: Render template to temp file
24+
ansible.builtin.template:
25+
src: "{{ template_src }}"
26+
dest: "{{ rendered_path }}"
27+
mode: "0600"
28+
29+
30+
- name: Gzip the rendered content
31+
ansible.builtin.shell: |
32+
gzip -c "{{ rendered_path }}" > "{{ gz_path }}"
33+
changed_when: true
34+
35+
- name: Read gzip as base64
36+
ansible.builtin.slurp:
37+
path: "{{ gz_path }}"
38+
register: gz_slurped
39+
40+
- name: Create/update ConfigMap with gzipped+base64 content
41+
kubernetes.core.k8s:
42+
kubeconfig: "{{ kubeconfig | default(omit) }}"
43+
state: present
44+
definition:
45+
apiVersion: v1
46+
kind: ConfigMap
47+
metadata:
48+
name: "initdata"
49+
namespace: "imperative"
50+
data:
51+
INITDATA: "{{ gz_slurped.content }}"

charts/coco-supported/sandbox/initdata.toml.tpl renamed to ansible/initdata-default.toml.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ version = "0.1.0"
55
"aa.toml" = '''
66
[token_configs]
77
[token_configs.coco_as]
8-
url = "https://kbs-trustee-operator-system.{{ .Values.global.hubClusterDomain }}"
8+
url = "https://kbs-trustee-operator-system.{{ hub_domain }}"
99

1010
[token_configs.kbs]
11-
url = "https://kbs-trustee-operator-system.{{ .Values.global.hubClusterDomain }}"
11+
url = "https://kbs-trustee-operator-system.{{ hub_domain }}"
1212
'''
1313

1414
"cdh.toml" = '''
@@ -17,5 +17,5 @@ credentials = []
1717

1818
[kbc]
1919
name = "cc_kbc"
20-
url = "https://kbs-trustee-operator-system.{{ .Values.global.hubClusterDomain }}"
20+
url = "https://kbs-trustee-operator-system.{{ hub_domain }}"
2121
'''

ansible/install-deps.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
community.general.ansible_galaxy_install:
99
type: collection
1010
name: azure.azcollection
11+
- name: Ensure community.crypto collection is installed
12+
community.general.ansible_galaxy_install:
13+
type: collection
14+
name: community.crypto
1115
- name: Install a Python package
1216
ansible.builtin.pip:
1317
requirements: "~/.ansible/collections/ansible_collections/azure/azcollection/requirements.txt"

charts/coco-supported/kbs-access/templates/secure-pod.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,11 @@ spec:
2121
name: kbsref
2222
initContainers:
2323
- name: curl
24-
image: registry.redhat.io/ubi9/ubi:latest # Lightweight image with curl installed
24+
image: registry.access.redhat.com/ubi9/ubi:latest # Lightweight image with curl installed
2525
command: ['sh', '-c', 'curl -s http://127.0.0.1:8006/cdh/resource/default/kbsres1/key3 > /output/kbsres1.txt']
2626
volumeMounts:
2727
- name: output-volume
2828
mountPath: /output
29-
# - name: hi
30-
# image: registry.redhat.io/ubi9/ubi:latest # Lightweight image with curl installed
31-
# command: ['sh', '-c', 'echo "hi" > /output/kbsres1.txt']
32-
# volumeMounts:
33-
# - name: output-volume
34-
# mountPath: /output
3529
volumes:
3630
- name: output-volume
3731
emptyDir: {}

charts/coco-supported/sandbox/templates/peer-pods-cm.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ spec:
3737
AZURE_NSG_ID: '/subscriptions/{{ `{{ (fromJson (fromConfigMap "openshift-cloud-controller-manager" "cloud-conf" "cloud.conf" | toLiteral)).subscriptionId }}` }}/resourceGroups/{{ `{{ (fromJson (fromConfigMap "openshift-cloud-controller-manager" "cloud-conf" "cloud.conf" | toLiteral)).resourceGroup }}` }}/providers/Microsoft.Network/networkSecurityGroups/{{ `{{ (fromJson (fromConfigMap "openshift-cloud-controller-manager" "cloud-conf" "cloud.conf" | toLiteral)).securityGroupName }}` }}'
3838
DISABLECVM: "false"
3939
PROXY_TIMEOUT: "5m"
40-
INITDATA: '{{ tpl ( .Files.Get "initdata.toml.tpl") . | b64enc }}'
40+
INITDATA: '{{ `{{if (lookup "v1" "ConfigMap" "imperative" "initdata").metadata.name }}{{ fromConfigMap "imperative" "initdata" "INITDATA" }}{{ else }}{{ end }}` }}'
41+
4142
---
4243
apiVersion: policy.open-cluster-management.io/v1
4344
kind: PlacementBinding

charts/coco-supported/sandbox/values.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
global:
22
cocoUpstream: true
33
cocoConverged: true
4-
azure:
5-
clusterResGroup: ''
6-
clusterSubnet: ''
7-
clusterNSG: ''
8-
clusterRegion: ''
94

105
secretStore:
116
name: vault-backend

values-global.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ global:
44
useCSV: false
55
syncPolicy: Automatic
66
installPlanApproval: Automatic
7+
autoApproveManualInstallPlans: true
78
# This defines whether or not to use upstream resources for CoCo.
89
# Defines whether or not the hub cluster can be used for confidential containers
910
coco:

values-simple.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,23 @@ clusterGroup:
2020
acm:
2121
name: advanced-cluster-management
2222
namespace: open-cluster-management
23-
channel: release-2.12
24-
23+
channel: release-2.13
2524
sandbox:
2625
name: sandboxed-containers-operator
2726
namespace: openshift-sandboxed-containers-operator
27+
source: redhat-operators
2828
channel: stable
29-
version: "1.9.*" # 1.9.* matches with trustee 0.3.*
29+
installPlanApproval: Manual
30+
csv: sandboxed-containers-operator.v1.10.1
3031
trustee:
3132
name: trustee-operator
3233
namespace: trustee-operator-system
3334
source: redhat-operators
3435
channel: stable
35-
version: "0.3.*"
36+
installPlanApproval: Manual
37+
csv: trustee-operator.v0.4.1
3638

39+
3740
cert-manager:
3841
name: openshift-cert-manager-operator
3942
namespace: cert-manager-operator
@@ -128,6 +131,10 @@ clusterGroup:
128131
playbook: ansible/azure-nat-gateway.yaml
129132
verbosity: -vvv
130133
timeout: 3600
134+
- name: init-data-gzipper
135+
playbook: ansible/init-data-gzipper.yaml
136+
verbosity: -vvv
137+
timeout: 3600
131138
managedClusterGroups:
132139
exampleRegion:
133140
name: group-one

0 commit comments

Comments
 (0)