--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: helmrequests.app.alauda.io spec: group: app.alauda.io conversion: strategy: None names: kind: HelmRequest listKind: HelmRequestList plural: helmrequests singular: helmrequest shortNames: - hr - hrs scope: Namespaced versions: - name: v1 additionalPrinterColumns: - name: Chart type: string description: The chart of this HelmRequest jsonPath: .spec.chart - name: Version type: string description: Version of this chart jsonPath: .spec.version - name: Namespace type: string description: The namespace which the chart deployed to jsonPath: .spec.namespace - name: AllCluster type: boolean description: Is this chart will be installed to all cluster jsonPath: .spec.installToAllClusters - name: Phase type: string description: The phase of this HelmRequest jsonPath: .status.phase - name: Age type: date jsonPath: .metadata.creationTimestamp schema: openAPIV3Schema: properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: properties: chart: type: string clusterName: description: ClusterName is the cluster where the chart will be installed. If InstallToAllClusters=true, this field will be ignored type: string dependencies: description: Dependencies is the dependencies of this HelmRequest, it's a list of there names THe dependencies must lives in the same namespace, and each of them must be in Synced status before we sync this HelmRequest items: type: string type: array installToAllClusters: description: InstallToAllClusters will install this chart to all available clusters, even the cluster was created after this chart. If this field is true, ClusterName will be ignored(useless) type: boolean namespace: description: Namespace is the namespace where the Release object will be lived in. Notes this should be used with the values defined in the chart, otherwise the install will failed type: string releaseName: description: ReleaseName is the Release name to be generated, default to HelmRequest.Name. If we want to manually install this chart to multi clusters, we may have different HelmRequest name(with cluster prefix or suffix) and same release name type: string source: description: Source defines the source of chart, If this field is set, Chart and Version field will be ignored(useless) properties: http: properties: secretRef: description: SecretRef A Secret reference, the secret should contain accessKeyId (user name) base64 encoded, and secretKey (password) also base64 encoded type: string url: description: URL is the URL of the http(s) endpoint type: string required: - url type: object oci: properties: repo: description: Repo is the repo of the oci artifact type: string secretRef: description: SecretRef A Secret reference, the secret should contain accessKeyId (user name) base64 encoded, and secretKey (password) also base64 encoded type: string required: - repo type: object type: object values: description: Values represents a collection of chart values. type: object nullable: true x-kubernetes-preserve-unknown-fields: true valuesFrom: description: ValuesFrom represents values from ConfigMap/Secret... items: description: ValuesFromSource represents a source of values, only one of it's fields may be set properties: configMapKeyRef: description: ConfigMapKeyRef selects a key of a ConfigMap properties: key: description: The key to select. type: string name: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' type: string optional: description: Specify whether the ConfigMap or its key must be defined type: boolean required: - key type: object secretKeyRef: description: SecretKeyRef selects a key of a Secret properties: key: description: The key of the secret to select from. Must be a valid secret key. type: string name: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' type: string optional: description: Specify whether the Secret or its key must be defined type: boolean required: - key type: object type: object type: array version: type: string type: object status: properties: conditions: items: properties: lastProbeTime: description: Last time we probed the condition. format: date-time type: string nullable: true lastTransitionTime: description: Last time the condition transitioned from one status to another. format: date-time type: string nullable: true message: description: Human-readable message indicating details about last transition. type: string reason: description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: 'Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions' type: string type: description: 'Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions' type: string type: object type: array lastSpecHash: description: LastSpecHash store the has value of the synced spec, if this value not equal to the current one, means we need to do a update for the chart type: string notes: description: Notes is the contents from helm (after helm install successfully it will be printed to the console type: string phase: description: HelmRequestPhase is a label for the condition of a HelmRequest at the current time. type: string reason: description: Reason will store the reason why the HelmRequest deploy failed type: string syncedClusters: description: SyncedClusters will store the synced clusters if InstallToAllClusters is true items: type: string type: array version: description: Verions is the real version that installed type: string type: object required: - spec type: object served: true storage: true subresources: status: {} - name: v1alpha1 additionalPrinterColumns: - name: Chart type: string description: The chart of this HelmRequest jsonPath: .spec.chart - name: Version type: string description: Version of this chart jsonPath: .spec.version - name: Namespace type: string description: The namespace which the chart deployed to jsonPath: .spec.namespace - name: AllCluster type: boolean description: Is this chart will be installed to all cluster jsonPath: .spec.installToAllClusters - name: Phase type: string description: The phase of this HelmRequest jsonPath: .status.phase - name: Age type: date jsonPath: .metadata.creationTimestamp schema: openAPIV3Schema: properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: properties: chart: type: string clusterName: description: ClusterName is the cluster where the chart will be installed. If InstallToAllClusters=true, this field will be ignored type: string dependencies: description: Dependencies is the dependencies of this HelmRequest, it's a list of there names THe dependencies must lives in the same namespace, and each of them must be in Synced status before we sync this HelmRequest items: type: string type: array installToAllClusters: description: InstallToAllClusters will install this chart to all available clusters, even the cluster was created after this chart. If this field is true, ClusterName will be ignored(useless) type: boolean namespace: description: Namespace is the namespace where the Release object will be lived in. Notes this should be used with the values defined in the chart, otherwise the install will failed type: string releaseName: description: ReleaseName is the Release name to be generated, default to HelmRequest.Name. If we want to manually install this chart to multi clusters, we may have different HelmRequest name(with cluster prefix or suffix) and same release name type: string values: description: Values represents a collection of chart values. type: object nullable: true x-kubernetes-preserve-unknown-fields: true valuesFrom: description: ValuesFrom represents values from ConfigMap/Secret... items: description: ValuesFromSource represents a source of values, only one of it's fields may be set properties: configMapKeyRef: description: ConfigMapKeyRef selects a key of a ConfigMap properties: key: description: The key to select. type: string name: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' type: string optional: description: Specify whether the ConfigMap or its key must be defined type: boolean required: - key type: object secretKeyRef: description: SecretKeyRef selects a key of a Secret properties: key: description: The key of the secret to select from. Must be a valid secret key. type: string name: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' type: string optional: description: Specify whether the Secret or its key must be defined type: boolean required: - key type: object type: object type: array version: type: string type: object status: properties: conditions: items: properties: lastProbeTime: description: Last time we probed the condition. format: date-time type: string nullable: true lastTransitionTime: description: Last time the condition transitioned from one status to another. format: date-time type: string nullable: true message: description: Human-readable message indicating details about last transition. type: string reason: description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: 'Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions' type: string type: description: 'Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions' type: string type: object type: array lastSpecHash: description: LastSpecHash store the has value of the synced spec, if this value not equal to the current one, means we need to do a update for the chart type: string notes: description: Notes is the contents from helm (after helm install successfully it will be printed to the console type: string phase: description: HelmRequestPhase is a label for the condition of a HelmRequest at the current time. type: string reason: description: Reason will store the reason why the HelmRequest deploy failed type: string syncedClusters: description: SyncedClusters will store the synced clusters if InstallToAllClusters is true items: type: string type: array version: description: Verions is the real version that installed type: string type: object required: - spec type: object served: true storage: false subresources: status: {} --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: chartrepos.app.alauda.io spec: conversion: strategy: None group: app.alauda.io names: kind: ChartRepo listKind: ChartRepoList plural: chartrepos shortNames: - ctr singular: chartrepo scope: Namespaced versions: - additionalPrinterColumns: - description: The url of this chart repo jsonPath: .spec.url name: URL type: string - description: The phase of this ChartRepo jsonPath: .status.phase name: Phase type: string - jsonPath: .metadata.creationTimestamp name: Age type: date name: v1alpha1 schema: openAPIV3Schema: properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: properties: secret: description: Secret contains information about how to auth to this repo properties: name: description: Name is unique within a namespace to reference a secret resource. type: string namespace: description: Namespace defines the space within which the secret name must be unique. type: string nullable: true type: object url: description: URL is the repo's url type: string required: - url type: object status: properties: phase: description: Phase ... After create, this phase will be updated to indicate it's sync status If receive update event, and some field in spec changed, sync agagin. type: string reason: description: Reason is the failed reason type: string type: object required: - spec type: object served: true storage: false - additionalPrinterColumns: - description: The url of this chart repo jsonPath: .spec.url name: URL type: string - description: The phase of this ChartRepo jsonPath: .status.phase name: Phase type: string - jsonPath: .metadata.creationTimestamp name: Age type: date name: v1beta1 schema: openAPIV3Schema: properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: properties: secret: description: Secret contains information about how to auth to this repo properties: name: description: Name is unique within a namespace to reference a secret resource. type: string namespace: description: Namespace defines the space within which the secret name must be unique. type: string nullable: true type: object source: description: new in v1beta1.if type is Chart, this is optional and it will provide some compatible with v1alpha1 properties: path: description: may be root, may be a subdir type: string url: description: vcs url type: string required: - url nullable: true type: object type: description: new in v1beta1 type: string url: description: URL is the repo's url type: string required: - type - url type: object status: properties: phase: description: Phase ... After create, this phase will be updated to indicate it's sync status If receive update event, and some field in spec changed, sync agagin. type: string reason: description: Reason is the failed reason type: string type: object required: - spec type: object served: true storage: true --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: charts.app.alauda.io spec: conversion: strategy: None group: app.alauda.io names: kind: Chart listKind: ChartList plural: charts singular: chart scope: Namespaced versions: - additionalPrinterColumns: - jsonPath: .spec.versions[0].version name: Version type: string - jsonPath: .spec.versions[0].appVersion name: AppVersion type: string - jsonPath: .metadata.creationTimestamp name: Age type: date name: v1alpha1 schema: openAPIV3Schema: properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: properties: versions: items: type: object x-kubernetes-preserve-unknown-fields: true type: array type: object required: - spec type: object served: true storage: false - additionalPrinterColumns: - jsonPath: .spec.versions[0].version name: Version type: string - jsonPath: .spec.versions[0].appVersion name: AppVersion type: string - jsonPath: .metadata.creationTimestamp name: Age type: date name: v1beta1 schema: openAPIV3Schema: properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: properties: versions: items: type: object x-kubernetes-preserve-unknown-fields: true type: array type: object required: - spec type: object served: true storage: true --- apiVersion: v1 kind: Service metadata: name: captain-webhook labels: service_name: captain spec: ports: - port: 6060 targetPort: 6060 name: metrics selector: app: captain --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: captain name: captain-controller-manager spec: replicas: 1 selector: matchLabels: app: captain strategy: rollingUpdate: maxSurge: 25% maxUnavailable: 25% type: RollingUpdate template: metadata: labels: app: captain spec: containers: - args: - --metrics-addr=0.0.0.0:6060 - --enable-leader-election - --cluster-namespace=$(KUBERNETES_NAMESPACE) - --chartrepo-namespace=$(KUBERNETES_NAMESPACE) command: - /manager env: - name: KUBERNETES_NAMESPACE valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.namespace image: alaudapublic/captain:v1.5.0 imagePullPolicy: IfNotPresent name: manager resources: limits: cpu: 100m memory: 512Mi requests: cpu: 100m memory: 128Mi dnsPolicy: ClusterFirst --- apiVersion: v1 kind: Service metadata: labels: app: captain-chartmuseum name: captain-chartmuseum spec: ports: - name: http port: 8080 protocol: TCP targetPort: 8080 selector: app: captain-chartmuseum type: ClusterIP --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: captain-chartmuseum name: captain-chartmuseum spec: replicas: 1 selector: matchLabels: app: captain-chartmuseum strategy: rollingUpdate: maxSurge: 25% maxUnavailable: 25% type: RollingUpdate template: metadata: labels: app: captain-chartmuseum spec: containers: - name: chartmuseum args: - --depth=1 - --allow-overwrite env: - name: DEBUG value: "1" - name: STORAGE value: local - name: STORAGE_LOCAL_ROOTDIR value: /charts image: chartmuseum/chartmuseum:latest imagePullPolicy: IfNotPresent volumeMounts: - mountPath: /charts name: chart-volume volumes: - name: chart-volume emptyDir: {}