Skip to content

Commit

Permalink
Common structs for Helm
Browse files Browse the repository at this point in the history
This PR adds `pkg/inject/template-values.go` which contains the structs
needed to set the helm variables during injection. They can also be
leveraged during installation:

```
package inject

type (
        // Image contains the details to define a container image
        Image struct {
                Name       string
                PullPolicy string
                Version    string
        }

        // Port contains all the port-related setups
        Port struct {
                Admin               int32
                Control             int32
                Inbound             int32
                Outbound            int32
                IgnoreInboundPorts  string
                IgnoreOutboundPorts string
        }

        // Constraints wraps the Limit and Request settings for computational resources
        Constraints struct {
                Limit   string
                Request string
        }

        // Resources represents the computational resources setup for a given container
        Resources struct {
                CPU    Constraints
                Memory Constraints
        }

        // Identity contains the fields to set the identity variables in the proxy
        // sidecar container
        Identity struct {
                TrustDomain  string
                TrustAnchors string
        }

        // Proxy contains the fields to set the proxy sidecar container
        Proxy struct {
                Component             string
                ClusterDomain         string
                DisableIdentity       bool
                EnableExternalProfile bool
                HighAvailability      bool
                Identity              *Identity
                Image                 Image
                LogLevel              string
                ControlPlaneNamespace string
                Port                  Port
                UID                   int64
                ResourceRequirements  *Resources
        }

        // ProxyInit contains the fields to set the proxy-init container
        ProxyInit struct {
                Image                Image
                Port                 Port
                UID                  int64
                ResourceRequirements *Resources
        }
)
```

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
  • Loading branch information
alpeb committed Jul 30, 2019
1 parent 1d22f4d commit 241c4d3
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions pkg/inject/template-values.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package inject

type (
// Image contains the details to define a container image
Image struct {
Name string
PullPolicy string
Version string
}

// Port contains all the port-related setups
Port struct {
Admin int32
Control int32
Inbound int32
Outbound int32
IgnoreInboundPorts string
IgnoreOutboundPorts string
}

// Constraints wraps the Limit and Request settings for computational resources
Constraints struct {
Limit string
Request string
}

// Resources represents the computational resources setup for a given container
Resources struct {
CPU Constraints
Memory Constraints
}

// Identity contains the fields to set the identity variables in the proxy
// sidecar container
Identity struct {
TrustDomain string
TrustAnchors string
}

// Proxy contains the fields to set the proxy sidecar container
Proxy struct {
Component string
ClusterDomain string
DisableIdentity bool
EnableExternalProfile bool
HighAvailability bool
Identity *Identity
Image Image
LogLevel string
ControlPlaneNamespace string
Port Port
UID int64
ResourceRequirements *Resources
}

// ProxyInit contains the fields to set the proxy-init container
ProxyInit struct {
Image Image
Port Port
UID int64
ResourceRequirements *Resources
}
)

0 comments on commit 241c4d3

Please sign in to comment.