-
Notifications
You must be signed in to change notification settings - Fork 0
/
helm.go
117 lines (100 loc) · 3.45 KB
/
helm.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
Copyright AppsCode Inc. and Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package shared
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
type BootstrapPresets struct {
// +optional
OfflineInstaller bool `json:"offlineInstaller"`
Image ImageRegistrySpec `json:"image"`
Registry RegistryInfo `json:"registry"`
Helm HelmInfo `json:"helm"`
}
type ImageRegistrySpec struct {
//+optional
Proxies RegistryProxies `json:"proxies"`
}
type RegistryProxies struct {
// company/bin:1.23
//+optional
DockerHub string `json:"dockerHub"`
// alpine, nginx etc.
//+optional
DockerLibrary string `json:"dockerLibrary"`
// ghcr.io
//+optional
GHCR string `json:"ghcr"`
// quay.io
//+optional
Quay string `json:"quay"`
// registry.k8s.io
//+optional
Kubernetes string `json:"kubernetes"`
// r.appscode.com
//+optional
AppsCode string `json:"appscode"`
}
type RegistryInfo struct {
//+optional
Credentials map[string]string `json:"credentials"`
//+optional
Certs map[string]string `json:"certs"`
//+optional
ImagePullSecrets []string `json:"imagePullSecrets"`
}
type HelmInfo struct {
CreateNamespace bool `json:"createNamespace"`
Repositories map[string]*HelmRepository `json:"repositories"`
Releases map[string]*HelmRelease `json:"releases"`
}
type HelmRepository struct {
// URL of the Helm repository, a valid URL contains at least a protocol and
// host.
// +required
URL string `json:"url"`
// SecretRef specifies the Secret containing authentication credentials
// for the HelmRepository.
// For HTTP/S basic auth the secret must contain 'username' and 'password'
// fields.
// For TLS the secret must contain a 'certFile' and 'keyFile', and/or
// 'caFile' fields.
// +optional
SecretName string `json:"secretName,omitempty"`
// Interval at which to check the URL for updates.
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
// +optional
Interval *metav1.Duration `json:"interval,omitempty"`
// The timeout of index downloading, defaults to 60s.
// +optional
Timeout *metav1.Duration `json:"timeout,omitempty"`
// Type of the HelmRepository.
// When this field is set to "oci", the URL field value must be prefixed with "oci://".
// +kubebuilder:validation:Enum=default;oci
// +optional
Type string `json:"type,omitempty"`
// Provider used for authentication, can be 'aws', 'azure', 'gcp' or 'generic'.
// This field is optional, and only taken into account if the .spec.type field is set to 'oci'.
// When not specified, defaults to 'generic'.
// +kubebuilder:validation:Enum=generic;aws;azure;gcp
// +kubebuilder:default:=generic
// +optional
Provider string `json:"provider,omitempty"`
}
type HelmRelease struct {
Enabled bool `json:"enabled"`
Version string `json:"version"`
Values *runtime.RawExtension `json:"values,omitempty"`
}