Skip to content

Commit

Permalink
fix: fix audit log enabled clusters (#276)
Browse files Browse the repository at this point in the history
Co-authored-by: okozachenko1203 <[email protected]>
  • Loading branch information
okozachenko1203 and okozachenko1203 authored Dec 15, 2023
1 parent 33c1656 commit ef1a1ff
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
2 changes: 2 additions & 0 deletions hack/run-functional-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ openstack coe cluster create \
--cluster-template k8s-${KUBE_TAG} \
--master-count 1 \
--node-count ${NODE_COUNT} \
--merge-labels \
--label audit_log_enabled=true \
k8s-cluster

# Wait for cluster creation to be queued
Expand Down
46 changes: 28 additions & 18 deletions magnum_cluster_api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,20 @@ def get_object(self) -> objects.ClusterClass:
"variable": "kubeletTLSCipherSuites",
},
},
{
"op": "add",
"path": "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/certSANs", # noqa: E501
"valueFrom": {
"template": textwrap.dedent(
"""\
- {{ .builtin.cluster.name }}
- {{ .builtin.cluster.name }}.{{ .builtin.cluster.namespace }}
- {{ .builtin.cluster.name }}.{{ .builtin.cluster.namespace }}.svc
- {{ .builtin.cluster.name }}.{{ .builtin.cluster.namespace }}.svc.cluster.local # noqa: E501
"""
),
},
},
{
"op": "add",
"path": "/spec/template/spec/kubeadmConfigSpec/files/-",
Expand All @@ -1611,36 +1625,32 @@ def get_object(self) -> objects.ClusterClass:
},
{
"op": "add",
"path": "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/certSANs", # noqa: E501
"path": "/spec/template/spec/kubeadmConfigSpec/files/-",
"valueFrom": {
"template": textwrap.dedent(
"""\
- {{ .builtin.cluster.name }}
- {{ .builtin.cluster.name }}.{{ .builtin.cluster.namespace }}
- {{ .builtin.cluster.name }}.{{ .builtin.cluster.namespace }}.svc
- {{ .builtin.cluster.name }}.{{ .builtin.cluster.namespace }}.svc.cluster.local # noqa: E501
path: "/etc/kubernetes/cloud.conf"
owner: "root:root"
permissions: "0600"
content: "{{ .cloudControllerManagerConfig }}"
encoding: "base64"
"""
),
)
},
},
{
"op": "add",
"path": "/spec/template/spec/kubeadmConfigSpec/files",
"path": "/spec/template/spec/kubeadmConfigSpec/files/-",
"valueFrom": {
"template": textwrap.dedent(
"""\
- path: "/etc/kubernetes/cloud.conf"
owner: "root:root"
permissions: "0600"
content: "{{ .cloudControllerManagerConfig }}"
encoding: "base64"
- path: "/etc/kubernetes/cloud_ca.crt"
owner: "root:root"
permissions: "0600"
content: "{{ .cloudCaCert }}"
encoding: "base64"
path: "/etc/kubernetes/cloud_ca.crt"
owner: "root:root"
permissions: "0600"
content: "{{ .cloudCaCert }}"
encoding: "base64"
"""
),
)
},
},
],
Expand Down

0 comments on commit ef1a1ff

Please sign in to comment.