kubernetes: fixes for production (#1812)
* util/kubernetes/client: add secrets to deployments * util/kubernetes/client: remove ServiceAccountName override * debugging * runtime/kubernetes: fix error * runtime/kubernetes: remove test secret * util/kubernetes/client: update default image * util/kubernetes/client: remove default command for deployments * runtime/kubernetes: pass source as arg * runtime/kubernetes: remove debugging * util/kubernetes/client: revert default image change
This commit is contained in:
@@ -312,12 +312,11 @@ func NewDeployment(name, version, typ, namespace string) *Deployment {
|
||||
Template: &Template{
|
||||
Metadata: Metadata,
|
||||
PodSpec: &PodSpec{
|
||||
ServiceAccountName: namespace,
|
||||
Containers: []Container{{
|
||||
Name: name,
|
||||
Image: DefaultImage,
|
||||
Env: []EnvVar{env},
|
||||
Command: []string{"go", "run", "."},
|
||||
Command: []string{},
|
||||
Ports: []ContainerPort{{
|
||||
Name: "service-port",
|
||||
ContainerPort: 8080,
|
||||
|
@@ -62,6 +62,19 @@ spec:
|
||||
{{- range . }}
|
||||
- name: "{{ .Name }}"
|
||||
value: "{{ .Value }}"
|
||||
{{- if .ValueFrom }}
|
||||
{{- with .ValueFrom }}
|
||||
valueFrom:
|
||||
{{- if .SecretKeyRef }}
|
||||
{{- with .SecretKeyRef }}
|
||||
secretKeyRef:
|
||||
key: {{ .Key }}
|
||||
name: {{ .Name }}
|
||||
optional: {{ .Optional }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
args:
|
||||
|
@@ -10,8 +10,21 @@ type ContainerPort struct {
|
||||
|
||||
// EnvVar is environment variable
|
||||
type EnvVar struct {
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value,omitempty"`
|
||||
ValueFrom *EnvVarSource `json:"valueFrom,omitempty"`
|
||||
}
|
||||
|
||||
// EnvVarSource represents a source for the value of an EnvVar.
|
||||
type EnvVarSource struct {
|
||||
SecretKeyRef *SecretKeySelector `json:"secretKeyRef,omitempty"`
|
||||
}
|
||||
|
||||
// SecretKeySelector selects a key of a Secret.
|
||||
type SecretKeySelector struct {
|
||||
Key string `json:"key"`
|
||||
Name string `json:"name"`
|
||||
Optional bool `json:"optional,omitempty"`
|
||||
}
|
||||
|
||||
type Condition struct {
|
||||
|
Reference in New Issue
Block a user