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

Test creating clusters on PCA using Cluster API #54

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
2 changes: 2 additions & 0 deletions charts/oci-capi-0.15.0/templates/auth-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ data:
.Values.authConfig.useInstancePrincipal | b64enc | quote }}
user: {{ required "authConfig.user is required" .Values.authConfig.user | b64enc
| quote }}
pcaCerts: {{ required "authConfig.pcaCerts is required" .Values.authConfig.pcaCerts | b64enc |
quote }}
type: Opaque
10 changes: 10 additions & 0 deletions charts/oci-capi-0.15.0/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ spec:
- key: node-role.kubernetes.io/master
operator: Exists
weight: 10
{{- if .Values.initContainers }}
initContainers:
{{ toYaml .Values.initContainers | nindent 8 }}
{{- end }}
containers:
- args: {{- toYaml .Values.controllerManager.manager.args | nindent 8 }}
command:
Expand Down Expand Up @@ -86,6 +90,9 @@ spec:
- mountPath: /etc/oci
name: auth-config-dir
readOnly: true
{{- if .Values.volumeMounts }}
{{ toYaml .Values.volumeMounts | nindent 8 }}
{{- end }}
securityContext:
runAsNonRoot: true
seccompProfile:
Expand All @@ -105,3 +112,6 @@ spec:
- name: auth-config-dir
secret:
secretName: {{ include "oci-capi.fullname" . }}-auth-config
{{- if .Values.volumes }}
{{ toYaml .Values.volumes | nindent 6 }}
{{- end }}
31 changes: 31 additions & 0 deletions charts/oci-capi-0.15.0/templates/scripts-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "oci-capi.fullname" . }}-scripts
namespace: {{ .Release.Namespace }}
labels:
cluster.x-k8s.io/provider: infrastructure-oci
clusterctl.cluster.x-k8s.io: ""
{{- include "oci-capi.labels" . | nindent 4 }}
data:
update-ca-trust-store.sh: |
#! /bin/bash
#
# Copyright (c) 2024, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

CERT_FILE=${1}
BASE_OUTPUT_PATH=${2}

# Copy the additional certs to update area
cp ${CERT_FILE} /usr/share/pki/ca-trust-source/anchors/certs.pem

# Update the CA trust store
update-ca-trust

# Copy the updated certs to the emptyDir shared between the containers
mkdir -p ${BASE_OUTPUT_PATH}/etc/pki/ca-trust/extracted/openssl
cp /etc/pki/ca-trust/extracted/openssl/* ${BASE_OUTPUT_PATH}/etc/pki/ca-trust/extracted/openssl

mkdir -p ${BASE_OUTPUT_PATH}/etc/pki/ca-trust/extracted/pem
cp /etc/pki/ca-trust/extracted/pem/* ${BASE_OUTPUT_PATH}/etc/pki/ca-trust/extracted/pem
10 changes: 10 additions & 0 deletions charts/oci-capi-0.15.0/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ authConfig:
tenancy: ""
useInstancePrincipal: ""
user: ""
pcaCerts: ""
controllerManager:
manager:
args:
Expand Down Expand Up @@ -62,3 +63,12 @@ proxy:
httpsProxy:
httpProxy:
noProxy:

# initContainers configuration for deployment
initContainers: []

# Additional volumes to mount for the container
volumeMounts: []

# Additional volumes to mount for the pod
volumes: []