Skip to content

Conversation

@phlogistonjohn
Copy link
Collaborator

As documented via PR #66 we need a place for configuration of resources beyond our security config and outside of what SmbShare should specify. This PR adds the SmbCommonConfig as a third, and very very hopefully final, custom resource.

Today, the common config resource only helps decide if the share should be set up with loadbalancer services for clients external to the cluster. However, it may soon grow other parameters for more general configuration common across many service groups.

This custom resource will act as a template for all smb
server/service/etc parameters that fall outside a proper share
definition and is not directly related to security configuration but are
needed to establish new resources in the cluster.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The 'commonConfig' field of the SmbShare CR will be used to associate
a share with an SmbCommonConfig so that the parameters of the common
config can be used as a template for properties of the pods, services,
etc. that the operator may need to create.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Add a convenient method for fetching the common config associated with
an SmbShare.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
As we need to add the SmbCommonConfig to the planner type, the name
"Config" for the generated configuration (json) for the instances is a
bit insufficient. Call it "ConfigState" as its the current configuration
state mapped into the smb containers.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Signed-off-by: John Mulligan <jmulligan@redhat.com>
When constructing a share planner, from which we derive our plans
to create/update supporting resources, we will also need the
common config associated with the smb share.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Use the common config's network publish field to determine what type
of Service we will create - either the default of ClusterIP or
LoadBalancer if this share is to be published externally.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
@phlogistonjohn phlogistonjohn marked this pull request as ready for review June 25, 2021 18:28
Add a test case that sets up a share referencing a common config that
sets network/publish=external. This performs the standard checks
for share (regression) as well as adding a check that the service is
created with a type=LoadBalancer.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
@phlogistonjohn phlogistonjohn enabled auto-merge (rebase) June 25, 2021 19:20
@phlogistonjohn phlogistonjohn merged commit ea0c9fd into samba-in-kubernetes:master Jun 25, 2021
@phlogistonjohn phlogistonjohn deleted the jjm-common-config branch June 29, 2021 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants