You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would want the SpinApp CRD to be able to specify sidecar (Linux) containers that can run in the same pod as the the Spin App.
The main changes are
A new field Containers in the spinapp_types.go that defines a list of sidecar containers to be included in the Deployment.
// Containers defines the list of sidecar containers to be included in the deployment.//// These containers will not include the main Spin App. They share the Spin App's// environment variables and volumes.// +kubebuilder:validation:OptionalContainers []corev1.Container`json:"containers,omitempty"`
in spinapp_controller.go, adds containers to the deployment creation.
varcontainers []corev1.Containeriflen(app.Spec.Containers) >0 {
for_, c:=rangeapp.Spec.Containers {
ifc.Image==app.Spec.Image {
returnnil, errors.New("container in app.Spec.Containers must have a different image than Spin App")
}
ifc.Name=="" {
returnnil, errors.New("container in app.Spec.Containers must have a name")
}
ifc.Name==app.Name {
returnnil, errors.New("container in app.Spec.Containers must have a different name than the Spin App")
}
c.Env=append(c.Env, env...)
c.VolumeMounts=append(c.VolumeMounts, volumeMounts...)
ifc.Resources.Limits==nil&&c.Resources.Requests==nil {
c.Resources=resources
}
ifc.LivenessProbe==nil {
c.LivenessProbe=livenessProbe
}
ifc.ReadinessProbe==nil {
c.ReadinessProbe=readinessProbe
}
containers=append(containers, c)
}
}
I would want the SpinApp CRD to be able to specify sidecar (Linux) containers that can run in the same pod as the the Spin App.
The main changes are
Containers
in thespinapp_types.go
that defines a list of sidecar containers to be included in the Deployment.spinapp_controller.go
, adds containers to the deployment creation.I've done a bit prototype and you may check out the diff: main...Mossaka:spin-operator-msk:sidecars
The text was updated successfully, but these errors were encountered: