|
| 1 | +--- |
| 2 | +apiVersion: apiextensions.k8s.io/v1beta1 |
| 3 | +kind: CustomResourceDefinition |
| 4 | +metadata: |
| 5 | + name: helmrequests.app.alauda.io |
| 6 | +spec: |
| 7 | + group: app.alauda.io |
| 8 | + version: v1alpha1 |
| 9 | + names: |
| 10 | + kind: HelmRequest |
| 11 | + listKind: HelmRequestList |
| 12 | + plural: helmrequests |
| 13 | + singular: helmrequest |
| 14 | + shortNames: |
| 15 | + - hr |
| 16 | + additionalPrinterColumns: |
| 17 | + - name: Chart |
| 18 | + type: string |
| 19 | + description: The chart of this HelmRequest |
| 20 | + JSONPath: .spec.chart |
| 21 | + - name: Version |
| 22 | + type: string |
| 23 | + description: Version of this chart |
| 24 | + JSONPath: .spec.version |
| 25 | + - name: Namespace |
| 26 | + type: string |
| 27 | + description: The namespace which the chart deployed to |
| 28 | + JSONPath: .spec.namespace |
| 29 | + - name: AllCluster |
| 30 | + type: boolean |
| 31 | + description: Is this chart will be installed to all cluster |
| 32 | + JSONPath: .spec.installToAllClusters |
| 33 | + - name: Phase |
| 34 | + type: string |
| 35 | + description: The phase of this HelmRequest |
| 36 | + JSONPath: .status.phase |
| 37 | + - name: Age |
| 38 | + type: date |
| 39 | + JSONPath: .metadata.creationTimestamp |
| 40 | + scope: Namespaced |
| 41 | + subresources: |
| 42 | + status: {} |
| 43 | + validation: |
| 44 | + # openAPIV3Schema is the schema for validating custom objects. |
| 45 | + openAPIV3Schema: |
| 46 | + properties: |
| 47 | + spec: |
| 48 | + required: |
| 49 | + - chart |
| 50 | +--- |
| 51 | +apiVersion: apiextensions.k8s.io/v1beta1 |
| 52 | +kind: CustomResourceDefinition |
| 53 | +metadata: |
| 54 | + name: chartrepos.app.alauda.io |
| 55 | + annotations: |
| 56 | + "helm.sh/hook": crd-install |
| 57 | +spec: |
| 58 | + group: app.alauda.io |
| 59 | + version: v1alpha1 |
| 60 | + names: |
| 61 | + kind: ChartRepo |
| 62 | + listKind: ChartRepoList |
| 63 | + plural: chartrepos |
| 64 | + singular: chartrepo |
| 65 | + shortNames: |
| 66 | + - ctr |
| 67 | + additionalPrinterColumns: |
| 68 | + - name: URL |
| 69 | + type: string |
| 70 | + description: The url of this chart repo |
| 71 | + JSONPath: .spec.url |
| 72 | + - name: Phase |
| 73 | + type: string |
| 74 | + description: The phase of this ChartRepo |
| 75 | + JSONPath: .status.phase |
| 76 | + - name: Age |
| 77 | + type: date |
| 78 | + JSONPath: .metadata.creationTimestamp |
| 79 | + scope: Namespaced |
| 80 | + validation: |
| 81 | + # openAPIV3Schema is the schema for validating custom objects. |
| 82 | + openAPIV3Schema: |
| 83 | + properties: |
| 84 | + spec: |
| 85 | + required: |
| 86 | + - url |
| 87 | +--- |
| 88 | +apiVersion: apiextensions.k8s.io/v1beta1 |
| 89 | +kind: CustomResourceDefinition |
| 90 | +metadata: |
| 91 | + name: charts.app.alauda.io |
| 92 | +spec: |
| 93 | + group: app.alauda.io |
| 94 | + version: v1alpha1 |
| 95 | + names: |
| 96 | + kind: Chart |
| 97 | + listKind: ChartList |
| 98 | + plural: charts |
| 99 | + singular: chart |
| 100 | + additionalPrinterColumns: |
| 101 | + - name: Version |
| 102 | + type: string |
| 103 | + JSONPath: .spec.versions[0].version |
| 104 | + - name: AppVersion |
| 105 | + type: string |
| 106 | + JSONPath: .spec.versions[0].appVersion |
| 107 | + - name: Age |
| 108 | + type: date |
| 109 | + JSONPath: .metadata.creationTimestamp |
| 110 | + scope: Namespaced |
| 111 | +--- |
| 112 | +apiVersion: admissionregistration.k8s.io/v1beta1 |
| 113 | +kind: MutatingWebhookConfiguration |
| 114 | +metadata: |
| 115 | + name: captain-mutating-webhook-configuration |
| 116 | +webhooks: |
| 117 | +- admissionReviewVersions: |
| 118 | + - v1beta1 |
| 119 | + clientConfig: |
| 120 | + caBundle: Cg== |
| 121 | + service: |
| 122 | + name: captain-webhook |
| 123 | + namespace: captain-system |
| 124 | + path: /mutate |
| 125 | + failurePolicy: Fail |
| 126 | + name: mutate-helmrequest.app.alauda.io |
| 127 | + namespaceSelector: {} |
| 128 | + rules: |
| 129 | + - apiGroups: |
| 130 | + - app.alauda.io |
| 131 | + apiVersions: |
| 132 | + - v1alpha1 |
| 133 | + operations: |
| 134 | + - CREATE |
| 135 | + - UPDATE |
| 136 | + resources: |
| 137 | + - helmrequests |
| 138 | + scope: '*' |
| 139 | + sideEffects: Unknown |
| 140 | + timeoutSeconds: 30 |
| 141 | +--- |
| 142 | +apiVersion: admissionregistration.k8s.io/v1beta1 |
| 143 | +kind: ValidatingWebhookConfiguration |
| 144 | +metadata: |
| 145 | + annotations: |
| 146 | + name: captain-validating-webhook-configuration |
| 147 | +webhooks: |
| 148 | +- admissionReviewVersions: |
| 149 | + - v1beta1 |
| 150 | + clientConfig: |
| 151 | + caBundle: Cg== |
| 152 | + service: |
| 153 | + name: captain-webhook |
| 154 | + namespace: captain-system |
| 155 | + path: /validate |
| 156 | + failurePolicy: Fail |
| 157 | + name: validate-helmrequest.app.alauda.io |
| 158 | + namespaceSelector: {} |
| 159 | + rules: |
| 160 | + - apiGroups: |
| 161 | + - app.alauda.io |
| 162 | + apiVersions: |
| 163 | + - v1alpha1 |
| 164 | + operations: |
| 165 | + - CREATE |
| 166 | + - UPDATE |
| 167 | + resources: |
| 168 | + - helmrequests |
| 169 | + scope: '*' |
| 170 | + sideEffects: Unknown |
| 171 | + timeoutSeconds: 30 |
| 172 | +--- |
| 173 | +apiVersion: v1 |
| 174 | +kind: Service |
| 175 | +metadata: |
| 176 | + name: captain-webhook |
| 177 | + labels: |
| 178 | + service_name: captain |
| 179 | +spec: |
| 180 | + ports: |
| 181 | + - port: 443 |
| 182 | + targetPort: 9443 |
| 183 | + name: webhook |
| 184 | + - port: 6060 |
| 185 | + targetPort: 6060 |
| 186 | + name: metrics |
| 187 | + selector: |
| 188 | + app: captain |
| 189 | +--- |
| 190 | +apiVersion: apps/v1 |
| 191 | +kind: Deployment |
| 192 | +metadata: |
| 193 | + labels: |
| 194 | + app: captain |
| 195 | + name: captain-controller-manager |
| 196 | +spec: |
| 197 | + replicas: 1 |
| 198 | + selector: |
| 199 | + matchLabels: |
| 200 | + app: captain |
| 201 | + strategy: |
| 202 | + rollingUpdate: |
| 203 | + maxSurge: 25% |
| 204 | + maxUnavailable: 25% |
| 205 | + type: RollingUpdate |
| 206 | + template: |
| 207 | + metadata: |
| 208 | + labels: |
| 209 | + app: captain |
| 210 | + spec: |
| 211 | + containers: |
| 212 | + - args: |
| 213 | + - --metrics-addr=0.0.0.0:6060 |
| 214 | + - --enable-leader-election |
| 215 | + - --install-stable-repo=false |
| 216 | + - --cluster-namespace=$(KUBERNETES_NAMESPACE) |
| 217 | + - --chartrepo-namespace=$(KUBERNETES_NAMESPACE) |
| 218 | + command: |
| 219 | + - /manager |
| 220 | + env: |
| 221 | + - name: KUBERNETES_NAMESPACE |
| 222 | + valueFrom: |
| 223 | + fieldRef: |
| 224 | + apiVersion: v1 |
| 225 | + fieldPath: metadata.namespace |
| 226 | + image: index.alauda.cn/claas/captain:v0.9.7 |
| 227 | + imagePullPolicy: IfNotPresent |
| 228 | + name: manager |
| 229 | + resources: |
| 230 | + limits: |
| 231 | + cpu: 100m |
| 232 | + memory: 512Mi |
| 233 | + requests: |
| 234 | + cpu: 100m |
| 235 | + memory: 128Mi |
| 236 | + dnsPolicy: ClusterFirst |
| 237 | + initContainers: |
| 238 | + - command: |
| 239 | + - sh |
| 240 | + - /generate_certificate.sh |
| 241 | + - --service |
| 242 | + - captain-webhook |
| 243 | + - --vwebhook |
| 244 | + - captain-validating-webhook-configuration |
| 245 | + - --mwebhook |
| 246 | + - captain-mutating-webhook-configuration |
| 247 | + - --secret |
| 248 | + - captain-webhook-cert |
| 249 | + - --namespace |
| 250 | + - $(KUBERNETES_NAMESPACE) |
| 251 | + env: |
| 252 | + - name: KUBERNETES_NAMESPACE |
| 253 | + valueFrom: |
| 254 | + fieldRef: |
| 255 | + apiVersion: v1 |
| 256 | + fieldPath: metadata.namespace |
| 257 | + image: index.alauda.cn/claas/captain-cert-init |
| 258 | + imagePullPolicy: IfNotPresent |
| 259 | + name: cert-init |
| 260 | +--- |
0 commit comments