Skip to content

Commit ea84b6a

Browse files
feat(deployment): add ExtraVolumes and ExtraVolumeMounts to DeploymentSpec (#118)
* chore: update build submodule * feat(deployment): add Volumes and ExtraVolumes to `PodSpec` * chore: update build submodule * chore: go mod tidy * chore: run `task generate` * fix: default permissions on `ClusterProfile` during Init job * chore: update build submodule
1 parent 73cd36b commit ea84b6a

File tree

7 files changed

+5615
-5
lines changed

7 files changed

+5615
-5
lines changed

api/crds/manifests/openmcp.cloud_clusterproviders.yaml

Lines changed: 1858 additions & 0 deletions
Large diffs are not rendered by default.

api/crds/manifests/openmcp.cloud_platformservices.yaml

Lines changed: 1858 additions & 0 deletions
Large diffs are not rendered by default.

api/crds/manifests/openmcp.cloud_serviceproviders.yaml

Lines changed: 1858 additions & 0 deletions
Large diffs are not rendered by default.

api/provider/v1alpha1/deployment_types.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1alpha1
1818

1919
import (
20+
corev1 "k8s.io/api/core/v1"
2021
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2122
)
2223

@@ -45,6 +46,24 @@ type DeploymentSpec struct {
4546
// +kubebuilder:validation:Enum=DEBUG;INFO;ERROR
4647
// +kubebuilder:default=INFO
4748
Verbosity string `json:"verbosity,omitempty"`
49+
50+
// List of additional volumes that are mounted in the main container.
51+
// More info: https://kubernetes.io/docs/concepts/storage/volumes
52+
// +optional
53+
// +patchMergeKey=name
54+
// +patchStrategy=merge,retainKeys
55+
// +listType=map
56+
// +listMapKey=name
57+
ExtraVolumes []corev1.Volume `json:"extraVolumes,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
58+
59+
// List of additional volume mounts that are mounted in the main container.
60+
// Cannot be updated.
61+
// +optional
62+
// +patchMergeKey=mountPath
63+
// +patchStrategy=merge
64+
// +listType=map
65+
// +listMapKey=mountPath
66+
ExtraVolumeMounts []corev1.VolumeMount `json:"extraVolumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath"`
4867
}
4968

5069
// DeploymentStatus defines the observed state of a provider.

api/provider/v1alpha1/zz_generated.deepcopy.go

Lines changed: 18 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/controllers/provider/install/deployment.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ func (m *deploymentMutator) Mutate(d *appsv1.Deployment) error {
7575
"--verbosity=" + m.values.Verbosity(),
7676
"--provider-name=" + m.values.provider.GetName(),
7777
},
78-
Env: env,
78+
Env: env,
79+
VolumeMounts: m.values.deploymentSpec.ExtraVolumeMounts,
7980
},
8081
},
8182
ImagePullSecrets: m.values.ImagePullSecrets(),
8283
ServiceAccountName: m.values.NamespacedDefaultResourceName(),
84+
Volumes: m.values.deploymentSpec.ExtraVolumes,
8385
},
8486
},
8587
}

internal/controllers/provider/install/rbac_init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func newInitClusterRoleMutator(values *Values) resources.Mutator[*rbac.ClusterRo
5050
},
5151
{
5252
APIGroups: []string{"clusters.openmcp.cloud"},
53-
Resources: []string{"accessrequests", "clusterrequests"},
53+
Resources: []string{"accessrequests", "clusterrequests", "clusterprofiles"},
5454
Verbs: []string{"get", "list", "watch", "create", "update", "patch", "delete"},
5555
},
5656
},

0 commit comments

Comments
 (0)