From ec3e69c5e78ae2c59ea5adb67804ff308c55788c Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 1 Aug 2022 17:37:29 -0400 Subject: [PATCH 01/21] chore: update cert-manager chart and crds --- pulumi/python/kubernetes/certmgr/__main__.py | 2 +- .../certmgr/manifests/cert-manager.crds.yaml | 285 ++++++++++++++---- 2 files changed, 224 insertions(+), 63 deletions(-) diff --git a/pulumi/python/kubernetes/certmgr/__main__.py b/pulumi/python/kubernetes/certmgr/__main__.py index 6ed1d41f..992b5ece 100644 --- a/pulumi/python/kubernetes/certmgr/__main__.py +++ b/pulumi/python/kubernetes/certmgr/__main__.py @@ -57,7 +57,7 @@ def add_namespace(obj): chart_name = 'cert-manager' chart_version = config.get('chart_version') if not chart_version: - chart_version = 'v1.7.0' + chart_version = 'v1.9.1' helm_repo_name = config.get('certmgr_helm_repo_name') if not helm_repo_name: helm_repo_name = 'jetstack' diff --git a/pulumi/python/kubernetes/certmgr/manifests/cert-manager.crds.yaml b/pulumi/python/kubernetes/certmgr/manifests/cert-manager.crds.yaml index 1df1e068..5b3f0621 100644 --- a/pulumi/python/kubernetes/certmgr/manifests/cert-manager.crds.yaml +++ b/pulumi/python/kubernetes/certmgr/manifests/cert-manager.crds.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The cert-manager Authors. +# Copyright 2021 The cert-manager Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,20 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. ---- -# Source: cert-manager/templates/templates.out +# Source: cert-manager/templates/crd-templates.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: certificaterequests.cert-manager.io - annotations: - cert-manager.io/inject-ca-from-secret: 'cert-manager/cert-manager-webhook-ca' labels: app: 'cert-manager' app.kubernetes.io/name: 'cert-manager' app.kubernetes.io/instance: 'cert-manager' # Generated labels - app.kubernetes.io/version: "v1.7.0" + app.kubernetes.io/version: "v1.9.1" spec: group: cert-manager.io names: @@ -134,7 +131,7 @@ spec: description: Usages is the set of x509 usages that are requested for the certificate. If usages are set they SHOULD be encoded inside the CSR spec Defaults to `digital signature` and `key encipherment` if not specified. type: array items: - description: 'KeyUsage specifies valid usage contexts for keys. See: https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: "signing", "digital signature", "content commitment", "key encipherment", "key agreement", "data encipherment", "cert sign", "crl sign", "encipher only", "decipher only", "any", "server auth", "client auth", "code signing", "email protection", "s/mime", "ipsec end system", "ipsec tunnel", "ipsec user", "timestamping", "ocsp signing", "microsoft sgc", "netscape sgc"' + description: 'KeyUsage specifies valid usage contexts for keys. See: https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: "signing", "digital signature", "content commitment", "key encipherment", "key agreement", "data encipherment", "cert sign", "crl sign", "encipher only", "decipher only", "any", "server auth", "client auth", "code signing", "email protection", "s/mime", "ipsec end system", "ipsec tunnel", "ipsec user", "timestamping", "ocsp signing", "microsoft sgc", "netscape sgc"' type: string enum: - signing @@ -205,6 +202,9 @@ spec: type: description: Type of the condition, known values are (`Ready`, `InvalidRequest`, `Approved`, `Denied`). type: string + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map failureTime: description: FailureTime stores the time that this CertificateRequest failed. This is used to influence garbage collection and back-off. type: string @@ -212,19 +212,17 @@ spec: served: true storage: true --- -# Source: cert-manager/templates/templates.out +# Source: cert-manager/templates/crd-templates.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: certificates.cert-manager.io - annotations: - cert-manager.io/inject-ca-from-secret: 'cert-manager/cert-manager-webhook-ca' labels: app: 'cert-manager' app.kubernetes.io/name: 'cert-manager' app.kubernetes.io/instance: 'cert-manager' # Generated labels - app.kubernetes.io/version: "v1.7.0" + app.kubernetes.io/version: "v1.9.1" spec: group: cert-manager.io names: @@ -284,7 +282,7 @@ spec: - secretName properties: additionalOutputFormats: - description: AdditionalOutputFormats defines extra output formats of the private key and signed certificate chain to be written to this Certificate's target Secret. This is an Alpha Feature and is only enabled with the `--feature-gates=AdditionalCertificateOutputFormats=true` option. + description: AdditionalOutputFormats defines extra output formats of the private key and signed certificate chain to be written to this Certificate's target Secret. This is an Alpha Feature and is only enabled with the `--feature-gates=AdditionalCertificateOutputFormats=true` option on both the controller and webhook components. type: array items: description: CertificateAdditionalOutputFormat defines an additional output format of a Certificate resource. These contain supplementary data formats of the signed certificate chain and paired private key. @@ -388,6 +386,9 @@ spec: name: description: 'Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string + literalSubject: + description: LiteralSubject is an LDAP formatted string that represents the [X.509 Subject field](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6). Use this *instead* of the Subject field if you need to ensure the correct ordering of the RDN sequence, such as when issuing certs for LDAP authentication. See https://github.com/cert-manager/cert-manager/issues/3203, https://github.com/cert-manager/cert-manager/issues/4424. This field is alpha level and is only supported by cert-manager installations where LiteralCertificateSubject feature gate is enabled on both cert-manager controller and webhook. + type: string privateKey: description: Options to control private keys used for the Certificate. type: object @@ -408,6 +409,9 @@ spec: rotationPolicy: description: RotationPolicy controls how private keys should be regenerated when a re-issuance is being processed. If set to Never, a private key will only be generated if one does not already exist in the target `spec.secretName`. If one does exists but it does not have the correct algorithm or size, a warning will be raised to await user intervention. If set to Always, a private key matching the specified requirements will be generated whenever a re-issuance occurs. Default is 'Never' for backward compatibility. type: string + enum: + - Never + - Always size: description: Size is the key bit size of the corresponding private key for this certificate. If `algorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `algorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. If `algorithm` is set to `Ed25519`, Size is ignored. No other values are allowed. type: integer @@ -486,7 +490,7 @@ spec: description: Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified. type: array items: - description: 'KeyUsage specifies valid usage contexts for keys. See: https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: "signing", "digital signature", "content commitment", "key encipherment", "key agreement", "data encipherment", "cert sign", "crl sign", "encipher only", "decipher only", "any", "server auth", "client auth", "code signing", "email protection", "s/mime", "ipsec end system", "ipsec tunnel", "ipsec user", "timestamping", "ocsp signing", "microsoft sgc", "netscape sgc"' + description: 'KeyUsage specifies valid usage contexts for keys. See: https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12 Valid KeyUsage values are as follows: "signing", "digital signature", "content commitment", "key encipherment", "key agreement", "data encipherment", "cert sign", "crl sign", "encipher only", "decipher only", "any", "server auth", "client auth", "code signing", "email protection", "s/mime", "ipsec end system", "ipsec tunnel", "ipsec user", "timestamping", "ocsp signing", "microsoft sgc", "netscape sgc"' type: string enum: - signing @@ -550,6 +554,12 @@ spec: type: description: Type of the condition, known values are (`Ready`, `Issuing`). type: string + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + failedIssuanceAttempts: + description: The number of continuous failed issuance attempts up till now. This field gets removed (if set) on a successful issuance and gets set to 1 if unset and an issuance has failed. If an issuance has failed, the delay till the next issuance will be calculated using formula time.Hour * 2 ^ (failedIssuanceAttempts - 1). + type: integer lastFailureTime: description: LastFailureTime is the time as recorded by the Certificate controller of the most recent failure to complete a CertificateRequest for this Certificate resource. If set, cert-manager will not re-request another Certificate until 1 hour has elapsed from this time. type: string @@ -575,19 +585,17 @@ spec: served: true storage: true --- -# Source: cert-manager/templates/templates.out +# Source: cert-manager/templates/crd-templates.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: challenges.acme.cert-manager.io - annotations: - cert-manager.io/inject-ca-from-secret: 'cert-manager/cert-manager-webhook-ca' labels: app: 'cert-manager' app.kubernetes.io/name: 'cert-manager' app.kubernetes.io/instance: 'cert-manager' # Generated labels - app.kubernetes.io/version: "v1.7.0" + app.kubernetes.io/version: "v1.9.1" spec: group: acme.cert-manager.io names: @@ -908,8 +916,20 @@ spec: - region properties: accessKeyID: - description: 'The AccessKeyID is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' + description: 'The AccessKeyID is used for authentication. Cannot be set when SecretAccessKeyID is set. If neither the Access Key nor Key ID are set, we fall-back to using env vars, shared credentials file or AWS Instance metadata, see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' type: string + accessKeyIDSecretRef: + description: 'The SecretAccessKey is used for authentication. If set, pull the AWS access key ID from a key within a Kubernetes Secret. Cannot be set when AccessKeyID is set. If neither the Access Key nor Key ID are set, we fall-back to using env vars, shared credentials file or AWS Instance metadata, see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' + type: object + required: + - name + properties: + key: + description: The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required. + type: string + name: + description: 'Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string hostedZoneID: description: If set, the provider will manage only this zone in Route53 and will not do an lookup using the route53:ListHostedZonesByName api call. type: string @@ -920,7 +940,7 @@ spec: description: Role is a Role ARN which the Route53 provider will assume using either the explicit credentials AccessKeyID/SecretAccessKey or the inferred credentials from environment variables, shared credentials file or AWS Instance metadata type: string secretAccessKeySecretRef: - description: The SecretAccessKey is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials + description: 'The SecretAccessKey is used for authentication. If neither the Access Key nor Key ID are set, we fall-back to using env vars, shared credentials file or AWS Instance metadata, see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' type: object required: - name @@ -956,10 +976,49 @@ spec: type: object properties: labels: - description: The labels that cert-manager will use when creating the temporary HTTPRoute needed for solving the HTTP-01 challenge. These labels must match the label selector of at least one Gateway. + description: Custom labels that will be applied to HTTPRoutes created by cert-manager while solving HTTP-01 challenges. type: object additionalProperties: type: string + parentRefs: + description: 'When solving an HTTP-01 challenge, cert-manager creates an HTTPRoute. cert-manager needs to know which parentRefs should be used when creating the HTTPRoute. Usually, the parentRef references a Gateway. See: https://gateway-api.sigs.k8s.io/v1alpha2/api-types/httproute/#attaching-to-gateways' + type: array + items: + description: "ParentRef identifies an API object (usually a Gateway) that can be considered a parent of this resource (usually a route). The only kind of parent resource with \"Core\" support is Gateway. This API may be extended in the future to support additional kinds of parent resources, such as HTTPRoute. \n The API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid. \n References to objects with invalid Group and Kind are not valid, and must be rejected by the implementation, with appropriate Conditions set on the containing object." + type: object + required: + - name + properties: + group: + description: "Group is the group of the referent. \n Support: Core" + type: string + default: gateway.networking.k8s.io + maxLength: 253 + pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + kind: + description: "Kind is kind of the referent. \n Support: Core (Gateway) Support: Custom (Other Resources)" + type: string + default: Gateway + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + name: + description: "Name is the name of the referent. \n Support: Core" + type: string + maxLength: 253 + minLength: 1 + namespace: + description: "Namespace is the namespace of the referent. When unspecified (or empty string), this refers to the local namespace of the Route. \n Support: Core" + type: string + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + sectionName: + description: "SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following: \n * Gateway: Listener Name \n Implementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted. \n When unspecified (empty string), this will reference the entire resource. For the purpose of status, an attachment is considered successful if at least one section in the parent resource accepts it. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. \n Support: Core" + type: string + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ serviceType: description: Optional service type for Kubernetes solver service. Supported values are NodePort or ClusterIP. If unset, defaults to NodePort. type: string @@ -1187,7 +1246,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -1217,7 +1276,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -1268,7 +1327,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -1298,7 +1357,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -1356,7 +1415,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -1386,7 +1445,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -1437,7 +1496,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -1467,7 +1526,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -1573,19 +1632,17 @@ spec: subresources: status: {} --- -# Source: cert-manager/templates/templates.out +# Source: cert-manager/templates/crd-templates.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clusterissuers.cert-manager.io - annotations: - cert-manager.io/inject-ca-from-secret: 'cert-manager/cert-manager-webhook-ca' labels: app: 'cert-manager' app.kubernetes.io/name: 'cert-manager' app.kubernetes.io/instance: 'cert-manager' # Generated labels - app.kubernetes.io/version: "v1.7.0" + app.kubernetes.io/version: "v1.9.1" spec: group: cert-manager.io names: @@ -1941,8 +1998,20 @@ spec: - region properties: accessKeyID: - description: 'The AccessKeyID is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' + description: 'The AccessKeyID is used for authentication. Cannot be set when SecretAccessKeyID is set. If neither the Access Key nor Key ID are set, we fall-back to using env vars, shared credentials file or AWS Instance metadata, see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' type: string + accessKeyIDSecretRef: + description: 'The SecretAccessKey is used for authentication. If set, pull the AWS access key ID from a key within a Kubernetes Secret. Cannot be set when AccessKeyID is set. If neither the Access Key nor Key ID are set, we fall-back to using env vars, shared credentials file or AWS Instance metadata, see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' + type: object + required: + - name + properties: + key: + description: The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required. + type: string + name: + description: 'Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string hostedZoneID: description: If set, the provider will manage only this zone in Route53 and will not do an lookup using the route53:ListHostedZonesByName api call. type: string @@ -1953,7 +2022,7 @@ spec: description: Role is a Role ARN which the Route53 provider will assume using either the explicit credentials AccessKeyID/SecretAccessKey or the inferred credentials from environment variables, shared credentials file or AWS Instance metadata type: string secretAccessKeySecretRef: - description: The SecretAccessKey is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials + description: 'The SecretAccessKey is used for authentication. If neither the Access Key nor Key ID are set, we fall-back to using env vars, shared credentials file or AWS Instance metadata, see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' type: object required: - name @@ -1989,10 +2058,49 @@ spec: type: object properties: labels: - description: The labels that cert-manager will use when creating the temporary HTTPRoute needed for solving the HTTP-01 challenge. These labels must match the label selector of at least one Gateway. + description: Custom labels that will be applied to HTTPRoutes created by cert-manager while solving HTTP-01 challenges. type: object additionalProperties: type: string + parentRefs: + description: 'When solving an HTTP-01 challenge, cert-manager creates an HTTPRoute. cert-manager needs to know which parentRefs should be used when creating the HTTPRoute. Usually, the parentRef references a Gateway. See: https://gateway-api.sigs.k8s.io/v1alpha2/api-types/httproute/#attaching-to-gateways' + type: array + items: + description: "ParentRef identifies an API object (usually a Gateway) that can be considered a parent of this resource (usually a route). The only kind of parent resource with \"Core\" support is Gateway. This API may be extended in the future to support additional kinds of parent resources, such as HTTPRoute. \n The API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid. \n References to objects with invalid Group and Kind are not valid, and must be rejected by the implementation, with appropriate Conditions set on the containing object." + type: object + required: + - name + properties: + group: + description: "Group is the group of the referent. \n Support: Core" + type: string + default: gateway.networking.k8s.io + maxLength: 253 + pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + kind: + description: "Kind is kind of the referent. \n Support: Core (Gateway) Support: Custom (Other Resources)" + type: string + default: Gateway + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + name: + description: "Name is the name of the referent. \n Support: Core" + type: string + maxLength: 253 + minLength: 1 + namespace: + description: "Namespace is the namespace of the referent. When unspecified (or empty string), this refers to the local namespace of the Route. \n Support: Core" + type: string + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + sectionName: + description: "SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following: \n * Gateway: Listener Name \n Implementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted. \n When unspecified (empty string), this will reference the entire resource. For the purpose of status, an attachment is considered successful if at least one section in the parent resource accepts it. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. \n Support: Core" + type: string + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ serviceType: description: Optional service type for Kubernetes solver service. Supported values are NodePort or ClusterIP. If unset, defaults to NodePort. type: string @@ -2220,7 +2328,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -2250,7 +2358,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -2301,7 +2409,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -2331,7 +2439,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -2389,7 +2497,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -2419,7 +2527,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -2470,7 +2578,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -2500,7 +2608,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -2780,22 +2888,23 @@ spec: type: description: Type of the condition, known values are (`Ready`). type: string + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map served: true storage: true --- -# Source: cert-manager/templates/templates.out +# Source: cert-manager/templates/crd-templates.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: issuers.cert-manager.io - annotations: - cert-manager.io/inject-ca-from-secret: 'cert-manager/cert-manager-webhook-ca' labels: app: 'cert-manager' app.kubernetes.io/name: 'cert-manager' app.kubernetes.io/instance: 'cert-manager' # Generated labels - app.kubernetes.io/version: "v1.7.0" + app.kubernetes.io/version: "v1.9.1" spec: group: cert-manager.io names: @@ -3151,8 +3260,20 @@ spec: - region properties: accessKeyID: - description: 'The AccessKeyID is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' + description: 'The AccessKeyID is used for authentication. Cannot be set when SecretAccessKeyID is set. If neither the Access Key nor Key ID are set, we fall-back to using env vars, shared credentials file or AWS Instance metadata, see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' type: string + accessKeyIDSecretRef: + description: 'The SecretAccessKey is used for authentication. If set, pull the AWS access key ID from a key within a Kubernetes Secret. Cannot be set when AccessKeyID is set. If neither the Access Key nor Key ID are set, we fall-back to using env vars, shared credentials file or AWS Instance metadata, see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' + type: object + required: + - name + properties: + key: + description: The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required. + type: string + name: + description: 'Name of the resource being referred to. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string hostedZoneID: description: If set, the provider will manage only this zone in Route53 and will not do an lookup using the route53:ListHostedZonesByName api call. type: string @@ -3163,7 +3284,7 @@ spec: description: Role is a Role ARN which the Route53 provider will assume using either the explicit credentials AccessKeyID/SecretAccessKey or the inferred credentials from environment variables, shared credentials file or AWS Instance metadata type: string secretAccessKeySecretRef: - description: The SecretAccessKey is used for authentication. If not set we fall-back to using env vars, shared credentials file or AWS Instance metadata https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials + description: 'The SecretAccessKey is used for authentication. If neither the Access Key nor Key ID are set, we fall-back to using env vars, shared credentials file or AWS Instance metadata, see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials' type: object required: - name @@ -3199,10 +3320,49 @@ spec: type: object properties: labels: - description: The labels that cert-manager will use when creating the temporary HTTPRoute needed for solving the HTTP-01 challenge. These labels must match the label selector of at least one Gateway. + description: Custom labels that will be applied to HTTPRoutes created by cert-manager while solving HTTP-01 challenges. type: object additionalProperties: type: string + parentRefs: + description: 'When solving an HTTP-01 challenge, cert-manager creates an HTTPRoute. cert-manager needs to know which parentRefs should be used when creating the HTTPRoute. Usually, the parentRef references a Gateway. See: https://gateway-api.sigs.k8s.io/v1alpha2/api-types/httproute/#attaching-to-gateways' + type: array + items: + description: "ParentRef identifies an API object (usually a Gateway) that can be considered a parent of this resource (usually a route). The only kind of parent resource with \"Core\" support is Gateway. This API may be extended in the future to support additional kinds of parent resources, such as HTTPRoute. \n The API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid. \n References to objects with invalid Group and Kind are not valid, and must be rejected by the implementation, with appropriate Conditions set on the containing object." + type: object + required: + - name + properties: + group: + description: "Group is the group of the referent. \n Support: Core" + type: string + default: gateway.networking.k8s.io + maxLength: 253 + pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + kind: + description: "Kind is kind of the referent. \n Support: Core (Gateway) Support: Custom (Other Resources)" + type: string + default: Gateway + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + name: + description: "Name is the name of the referent. \n Support: Core" + type: string + maxLength: 253 + minLength: 1 + namespace: + description: "Namespace is the namespace of the referent. When unspecified (or empty string), this refers to the local namespace of the Route. \n Support: Core" + type: string + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + sectionName: + description: "SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following: \n * Gateway: Listener Name \n Implementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted. \n When unspecified (empty string), this will reference the entire resource. For the purpose of status, an attachment is considered successful if at least one section in the parent resource accepts it. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. \n Support: Core" + type: string + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ serviceType: description: Optional service type for Kubernetes solver service. Supported values are NodePort or ClusterIP. If unset, defaults to NodePort. type: string @@ -3430,7 +3590,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -3460,7 +3620,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -3511,7 +3671,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -3541,7 +3701,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -3599,7 +3759,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -3629,7 +3789,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -3680,7 +3840,7 @@ spec: additionalProperties: type: string namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. type: object properties: matchExpressions: @@ -3710,7 +3870,7 @@ spec: additionalProperties: type: string namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". type: array items: type: string @@ -3990,22 +4150,23 @@ spec: type: description: Type of the condition, known values are (`Ready`). type: string + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map served: true storage: true --- -# Source: cert-manager/templates/templates.out +# Source: cert-manager/templates/crd-templates.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: orders.acme.cert-manager.io - annotations: - cert-manager.io/inject-ca-from-secret: 'cert-manager/cert-manager-webhook-ca' labels: app: 'cert-manager' app.kubernetes.io/name: 'cert-manager' app.kubernetes.io/instance: 'cert-manager' # Generated labels - app.kubernetes.io/version: "v1.7.0" + app.kubernetes.io/version: "v1.9.1" spec: group: acme.cert-manager.io names: From 90880d959db304d311e8e14cd1bd959888a0b186 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 1 Aug 2022 17:37:56 -0400 Subject: [PATCH 02/21] chore: update logagent (filebeat) chart version --- pulumi/python/kubernetes/logagent/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulumi/python/kubernetes/logagent/__main__.py b/pulumi/python/kubernetes/logagent/__main__.py index fdd85769..4b022311 100644 --- a/pulumi/python/kubernetes/logagent/__main__.py +++ b/pulumi/python/kubernetes/logagent/__main__.py @@ -13,7 +13,7 @@ chart_name = 'filebeat' chart_version = config.get('chart_version') if not chart_version: - chart_version = '7.16.3' + chart_version = '7.17.3' helm_repo_name = config.get('helm_repo_name') if not helm_repo_name: helm_repo_name = 'elastic' From 0b0a57e1779cdbeae6c2a5a26aee8b2644bce004 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 1 Aug 2022 17:40:35 -0400 Subject: [PATCH 03/21] chore: update nginx IC to latest chart version --- pulumi/python/kubernetes/nginx/ingress-controller/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulumi/python/kubernetes/nginx/ingress-controller/__main__.py b/pulumi/python/kubernetes/nginx/ingress-controller/__main__.py index 03d9608b..0cb4ba95 100644 --- a/pulumi/python/kubernetes/nginx/ingress-controller/__main__.py +++ b/pulumi/python/kubernetes/nginx/ingress-controller/__main__.py @@ -17,7 +17,7 @@ chart_name = 'nginx-ingress' chart_version = config.get('chart_version') if not chart_version: - chart_version = '0.13.2' + chart_version = '0.14.0' helm_repo_name = config.get('helm_repo_name') if not helm_repo_name: helm_repo_name = 'nginx-stable' From 32c80803409ffe14fe94d53812b62915db41c420 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 1 Aug 2022 17:40:58 -0400 Subject: [PATCH 04/21] chore: update prometheus chart to latest version --- pulumi/python/kubernetes/prometheus/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulumi/python/kubernetes/prometheus/__main__.py b/pulumi/python/kubernetes/prometheus/__main__.py index c29d27c0..69969fb7 100644 --- a/pulumi/python/kubernetes/prometheus/__main__.py +++ b/pulumi/python/kubernetes/prometheus/__main__.py @@ -66,7 +66,7 @@ def extract_adminpass_from_k8s_secrets(secrets: Mapping[str, str]) -> str: chart_name = 'kube-prometheus-stack' chart_version = config.get('chart_version') if not chart_version: - chart_version = '30.0.1' + chart_version = '39.2.1' helm_repo_name = config.get('prometheus_helm_repo_name') if not helm_repo_name: helm_repo_name = 'prometheus-community' @@ -207,7 +207,7 @@ def extract_adminpass_from_k8s_secrets(secrets: Mapping[str, str]) -> str: statsd_chart_name = 'prometheus-statsd-exporter' statsd_chart_version = config.get('statsd_chart_version') if not statsd_chart_version: - statsd_chart_version = '0.4.2' + statsd_chart_version = '0.5.0' helm_repo_name = config.get('prometheus_helm_repo_name') if not helm_repo_name: helm_repo_name = 'prometheus-community' From cf5cacd21f699e2d21784f24e788f520987f3deb Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 1 Aug 2022 17:41:20 -0400 Subject: [PATCH 05/21] chore: update logstore (Elasticsearch) to latest chart versoin --- pulumi/python/kubernetes/logstore/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulumi/python/kubernetes/logstore/__main__.py b/pulumi/python/kubernetes/logstore/__main__.py index 874c0b22..a736500a 100644 --- a/pulumi/python/kubernetes/logstore/__main__.py +++ b/pulumi/python/kubernetes/logstore/__main__.py @@ -13,7 +13,7 @@ chart_name = 'elasticsearch' chart_version = config.get('chart_version') if not chart_version: - chart_version = '17.6.2' + chart_version = '19.1.4' helm_repo_name = config.get('helm_repo_name') if not helm_repo_name: helm_repo_name = 'bitnami' @@ -131,7 +131,7 @@ def project_name_from_project_dir(dirname: str): elastic_rname = elastic_release.status.name -elastic_fqdn = Output.concat(elastic_rname, "-coordinating-only.logstore.svc.cluster.local") +elastic_fqdn = Output.concat(elastic_rname, "-elasticsearch.logstore.svc.cluster.local") kibana_fqdn = Output.concat(elastic_rname, "-kibana.logstore.svc.cluster.local") pulumi.export('elastic_hostname', pulumi.Output.unsecret(elastic_fqdn)) From 8c05f3fc2e25b13254f090cbaa591b98761e6182 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 1 Aug 2022 17:42:02 -0400 Subject: [PATCH 06/21] chore: update observability to new yaml and new chart --- .../otel-objects/otel-collector.yaml | 17 +- .../otel-operator/opentelemetry-operator.yaml | 1614 ++++++++++++----- 2 files changed, 1131 insertions(+), 500 deletions(-) diff --git a/pulumi/python/kubernetes/observability/otel-objects/otel-collector.yaml b/pulumi/python/kubernetes/observability/otel-objects/otel-collector.yaml index a7069297..fed12a4f 100644 --- a/pulumi/python/kubernetes/observability/otel-objects/otel-collector.yaml +++ b/pulumi/python/kubernetes/observability/otel-objects/otel-collector.yaml @@ -12,20 +12,17 @@ spec: endpoint: 0.0.0.0:9978 http: endpoint: 0.0.0.0:9979 - # Collect Prometheus Metrics - exporters: - otlp: - endpoint: https://ingest.lightstep.com:443 - headers: {"lightstep-service-name":"my-service","lightstep-access-token":"XXXX"} + processors: batch: + + exporters: + logging: + logLevel: + service: pipelines: traces: receivers: [otlp] processors: [batch] - exporters: [otlp] - metrics: - receivers: [otlp] - processors: [batch] - exporters: [otlp] + exporters: [logging] diff --git a/pulumi/python/kubernetes/observability/otel-operator/opentelemetry-operator.yaml b/pulumi/python/kubernetes/observability/otel-operator/opentelemetry-operator.yaml index b48e156e..7459e064 100644 --- a/pulumi/python/kubernetes/observability/otel-operator/opentelemetry-operator.yaml +++ b/pulumi/python/kubernetes/observability/otel-operator/opentelemetry-operator.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Namespace metadata: labels: + app.kubernetes.io/name: opentelemetry-operator control-plane: controller-manager name: opentelemetry-operator-system --- @@ -9,8 +10,10 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.6.0-beta.0 + controller-gen.kubebuilder.io/version: v0.8.0 creationTimestamp: null + labels: + app.kubernetes.io/name: opentelemetry-operator name: instrumentations.opentelemetry.io spec: group: opentelemetry.io @@ -28,6 +31,15 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date + - jsonPath: .spec.exporter.endpoint + name: Endpoint + type: string + - jsonPath: .spec.sampler.type + name: Sampler + type: string + - jsonPath: .spec.sampler.argument + name: Sampler Arg + type: string name: v1alpha1 schema: openAPIV3Schema: @@ -49,6 +61,115 @@ spec: description: InstrumentationSpec defines the desired state of OpenTelemetry SDK and instrumentation. properties: + env: + description: 'Env defines common env vars. There are four layers for + env vars'' definitions and the precedence order is: `original container + env vars` > `language specific env vars` > `common env vars` > `instrument + spec configs'' vars`. If the former var had been defined, then the + other vars would be ignored.' + items: + description: EnvVar represents an environment variable present in + a Container. + properties: + name: + description: Name of the environment variable. Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded using + the previously defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows for escaping + the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the + string literal "$(VAR_NAME)". Escaped references will never + be expanded, regardless of whether the variable exists or + not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. Cannot + be used if value is not empty. + properties: + configMapKeyRef: + description: 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 + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, + status.podIP, status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath is + written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified + API version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: 'Selects a resource of the container: only + resources limits and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, requests.memory + and requests.ephemeral-storage) are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the exposed + resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + secretKeyRef: + description: Selects a key of a secret in the pod's namespace + 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 + required: + - name + type: object + type: array exporter: description: Exporter defines exporter configuration. properties: @@ -59,6 +180,120 @@ spec: java: description: Java defines configuration for java auto-instrumentation. properties: + env: + description: 'Env defines java specific env vars. There are four + layers for env vars'' definitions and the precedence order is: + `original container env vars` > `language specific env vars` + > `common env vars` > `instrument spec configs'' vars`. If the + former var had been defined, then the other vars would be ignored.' + items: + description: EnvVar represents an environment variable present + in a Container. + properties: + name: + description: Name of the environment variable. Must be a + C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in + the container and any service environment variables. If + a variable cannot be resolved, the reference in the input + string will be unchanged. Double $$ are reduced to a single + $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. + Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: 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 + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the + specified API version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: 'Selects a resource of the container: only + resources limits and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, requests.memory + and requests.ephemeral-storage) are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the + exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + secretKeyRef: + description: Selects a key of a secret in the pod's + namespace + 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 + required: + - name + type: object + type: array image: description: Image is a container image with javaagent auto-instrumentation JAR. @@ -67,6 +302,120 @@ spec: nodejs: description: NodeJS defines configuration for nodejs auto-instrumentation. properties: + env: + description: 'Env defines nodejs specific env vars. There are + four layers for env vars'' definitions and the precedence order + is: `original container env vars` > `language specific env vars` + > `common env vars` > `instrument spec configs'' vars`. If the + former var had been defined, then the other vars would be ignored.' + items: + description: EnvVar represents an environment variable present + in a Container. + properties: + name: + description: Name of the environment variable. Must be a + C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in + the container and any service environment variables. If + a variable cannot be resolved, the reference in the input + string will be unchanged. Double $$ are reduced to a single + $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. + Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: 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 + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the + specified API version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: 'Selects a resource of the container: only + resources limits and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, requests.memory + and requests.ephemeral-storage) are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the + exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + secretKeyRef: + description: Selects a key of a secret in the pod's + namespace + 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 + required: + - name + type: object + type: array image: description: Image is a container image with NodeJS SDK and auto-instrumentation. type: string @@ -90,6 +439,120 @@ spec: python: description: Python defines configuration for python auto-instrumentation. properties: + env: + description: 'Env defines python specific env vars. There are + four layers for env vars'' definitions and the precedence order + is: `original container env vars` > `language specific env vars` + > `common env vars` > `instrument spec configs'' vars`. If the + former var had been defined, then the other vars would be ignored.' + items: + description: EnvVar represents an environment variable present + in a Container. + properties: + name: + description: Name of the environment variable. Must be a + C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in + the container and any service environment variables. If + a variable cannot be resolved, the reference in the input + string will be unchanged. Double $$ are reduced to a single + $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. + Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: 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 + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the + specified API version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: 'Selects a resource of the container: only + resources limits and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, requests.memory + and requests.ephemeral-storage) are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the + exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + secretKeyRef: + description: Selects a key of a secret in the pod's + namespace + 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 + required: + - name + type: object + type: array image: description: Image is a container image with Python SDK and auto-instrumentation. type: string @@ -152,7 +615,9 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: opentelemetry-operator-system/opentelemetry-operator-serving-cert - controller-gen.kubebuilder.io/version: v0.6.0-beta.0 + controller-gen.kubebuilder.io/version: v0.8.0 + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetrycollectors.opentelemetry.io spec: group: opentelemetry.io @@ -364,6 +829,16 @@ spec: description: ImagePullPolicy indicates the pull policy to be used for retrieving the container image (Always, Never, IfNotPresent) type: string + maxReplicas: + description: MaxReplicas sets an upper bound to the autoscaling feature. + If MaxReplicas is set autoscaling is enabled. + format: int32 + type: integer + minReplicas: + description: MinReplicas sets a lower bound to the autoscaling feature. Set + this if your are using autoscaling. It must be at least 1 + format: int32 + type: integer mode: description: Mode represents how the collector should be deployed (deployment, daemonset, statefulset or sidecar) @@ -373,6 +848,13 @@ spec: - sidecar - statefulset type: string + nodeSelector: + additionalProperties: + type: string + description: NodeSelector to schedule OpenTelemetry Collector pods. + This is only relevant to daemonset, statefulset, and deployment + mode + type: object podAnnotations: additionalProperties: type: string @@ -393,7 +875,8 @@ spec: set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- \n If unset, the Kubelet will not modify the ownership and permissions of - any volume." + any volume. Note that this field cannot be set when spec.os.name + is windows." format: int64 type: integer fsGroupChangePolicy: @@ -403,13 +886,15 @@ spec: support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are "OnRootMismatch" and "Always". - If not specified, "Always" is used.' + If not specified, "Always" is used. Note that this field cannot + be set when spec.os.name is windows.' type: string runAsGroup: description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. + Note that this field cannot be set when spec.os.name is windows. format: int64 type: integer runAsNonRoot: @@ -426,7 +911,8 @@ spec: Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext - takes precedence for that container. + takes precedence for that container. Note that this field cannot + be set when spec.os.name is windows. format: int64 type: integer seLinuxOptions: @@ -435,6 +921,7 @@ spec: SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. + Note that this field cannot be set when spec.os.name is windows. properties: level: description: Level is SELinux level label that applies to @@ -455,7 +942,8 @@ spec: type: object seccompProfile: description: The seccomp options to use by the containers in this - pod. + pod. Note that this field cannot be set when spec.os.name is + windows. properties: localhostProfile: description: localhostProfile indicates a profile defined @@ -477,7 +965,8 @@ spec: supplementalGroups: description: A list of groups applied to the first process run in each container, in addition to the container's primary GID. If - unspecified, no groups will be added to any container. + unspecified, no groups will be added to any container. Note + that this field cannot be set when spec.os.name is windows. items: format: int64 type: integer @@ -485,7 +974,8 @@ spec: sysctls: description: Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) - might fail to launch. + might fail to launch. Note that this field cannot be set when + spec.os.name is windows. items: description: Sysctl defines a kernel parameter to be set properties: @@ -504,7 +994,8 @@ spec: description: The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. + the value specified in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name is linux. properties: gmsaCredentialSpec: description: GMSACredentialSpec is where the GMSA admission @@ -549,7 +1040,7 @@ spec: description: The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 - and http://www.iana.org/assignments/service-names). Non-standard + and https://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. type: string name: @@ -600,7 +1091,7 @@ spec: x-kubernetes-list-type: atomic replicas: description: Replicas is the number of pod instances for the underlying - OpenTelemetry Collector + OpenTelemetry Collector. Set this if your are not using autoscaling format: int32 type: integer resources: @@ -638,12 +1129,14 @@ spec: can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when - the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN' + the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN + Note that this field cannot be set when spec.os.name is windows.' type: boolean capabilities: description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container - runtime. + runtime. Note that this field cannot be set when spec.os.name + is windows. properties: add: description: Added capabilities @@ -661,23 +1154,27 @@ spec: privileged: description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults - to false. + to false. Note that this field cannot be set when spec.os.name + is windows. type: boolean procMount: description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. + Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: description: Whether this container has a read-only root filesystem. - Default is false. + Default is false. Note that this field cannot be set when spec.os.name + is windows. type: boolean runAsGroup: description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. + specified in SecurityContext takes precedence. Note that this + field cannot be set when spec.os.name is windows. format: int64 type: integer runAsNonRoot: @@ -694,7 +1191,8 @@ spec: Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext - takes precedence. + takes precedence. Note that this field cannot be set when spec.os.name + is windows. format: int64 type: integer seLinuxOptions: @@ -702,7 +1200,8 @@ spec: If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. + specified in SecurityContext takes precedence. Note that this + field cannot be set when spec.os.name is windows. properties: level: description: Level is SELinux level label that applies to @@ -724,7 +1223,8 @@ spec: seccompProfile: description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, - the container options override the pod options. + the container options override the pod options. Note that this + field cannot be set when spec.os.name is windows. properties: localhostProfile: description: localhostProfile indicates a profile defined @@ -747,7 +1247,8 @@ spec: description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, - the value specified in SecurityContext takes precedence. + the value specified in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name is linux. properties: gmsaCredentialSpec: description: GMSACredentialSpec is where the GMSA admission @@ -795,10 +1296,27 @@ spec: description: Image indicates the container image to use for the OpenTelemetry TargetAllocator. type: string + prometheusCR: + description: PrometheusCR defines the configuration for the retrieval + of PrometheusOperator CRDs ( servicemonitor.monitoring.coreos.com/v1 + and podmonitor.monitoring.coreos.com/v1 ) retrieval. All CR + instances which the ServiceAccount has access to will be retrieved. + This includes other namespaces. + properties: + enabled: + description: Enabled indicates whether to use a PrometheusOperator + custom resources as targets or not. + type: boolean + type: object + serviceAccount: + description: ServiceAccount indicates the name of an existing + service account to use with this instance. + type: string type: object tolerations: description: Toleration to schedule OpenTelemetry Collector pods. - This is only relevant to daemonsets, statefulsets and deployments + This is only relevant to daemonset, statefulset, and deployment + mode items: description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching @@ -884,17 +1402,17 @@ spec: type: string type: object spec: - description: 'Spec defines the desired characteristics of a + description: 'spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: accessModes: - description: 'AccessModes contains the desired access modes + description: 'accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array dataSource: - description: 'This field can be used to specify either: + description: 'dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data @@ -920,26 +1438,27 @@ spec: - name type: object dataSourceRef: - description: 'Specifies the object from which to populate - the volume with data, if a non-empty volume is desired. - This may be any local object from a non-empty API group - (non core object) or a PersistentVolumeClaim object. When - this field is specified, volume binding will only succeed - if the type of the specified object matches some installed - volume populator or dynamic provisioner. This field will - replace the functionality of the DataSource field and - as such if both fields are non-empty, they must have the - same value. For backwards compatibility, both fields (DataSource - and DataSourceRef) will be set to the same value automatically - if one of them is empty and the other is non-empty. There - are two important differences between DataSource and DataSourceRef: - * While DataSource only allows two specific types of objects, - DataSourceRef allows any non-core object, as well as - PersistentVolumeClaim objects. * While DataSource ignores - disallowed values (dropping them), DataSourceRef preserves - all values, and generates an error if a disallowed value - is specified. (Alpha) Using this field requires the - AnyVolumeDataSource feature gate to be enabled.' + description: 'dataSourceRef specifies the object from which + to populate the volume with data, if a non-empty volume + is desired. This may be any local object from a non-empty + API group (non core object) or a PersistentVolumeClaim + object. When this field is specified, volume binding will + only succeed if the type of the specified object matches + some installed volume populator or dynamic provisioner. + This field will replace the functionality of the DataSource + field and as such if both fields are non-empty, they must + have the same value. For backwards compatibility, both + fields (DataSource and DataSourceRef) will be set to the + same value automatically if one of them is empty and the + other is non-empty. There are two important differences + between DataSource and DataSourceRef: * While DataSource + only allows two specific types of objects, DataSourceRef + allows any non-core object, as well as PersistentVolumeClaim + objects. * While DataSource ignores disallowed values + (dropping them), DataSourceRef preserves all values, and + generates an error if a disallowed value is specified. + (Beta) Using this field requires the AnyVolumeDataSource + feature gate to be enabled.' properties: apiGroup: description: APIGroup is the group for the resource @@ -958,8 +1477,12 @@ spec: - name type: object resources: - description: 'Resources represents the minimum resources - the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: 'resources represents the minimum resources + the volume should have. If RecoverVolumeExpansionFailure + feature is enabled users are allowed to specify resource + requirements that are lower than previous value but must + still be higher than capacity recorded in the status field + of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: limits: additionalProperties: @@ -986,8 +1509,8 @@ spec: type: object type: object selector: - description: A label query over volumes to consider for - binding. + description: selector is a label query over volumes to consider + for binding. properties: matchExpressions: description: matchExpressions is a list of label selector @@ -1032,8 +1555,8 @@ spec: type: object type: object storageClassName: - description: 'Name of the StorageClass required by the claim. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: 'storageClassName is the name of the StorageClass + required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' type: string volumeMode: description: volumeMode defines what type of volume is required @@ -1041,20 +1564,40 @@ spec: included in claim spec. type: string volumeName: - description: VolumeName is the binding reference to the + description: volumeName is the binding reference to the PersistentVolume backing this claim. type: string type: object status: - description: 'Status represents the current information/status + description: 'status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: accessModes: - description: 'AccessModes contains the actual access modes + description: 'accessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array + allocatedResources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: allocatedResources is the storage resource + within AllocatedResources tracks the capacity allocated + to a PVC. It may be larger than the actual capacity when + a volume expansion operation is requested. For storage + quota, the larger value from allocatedResources and PVC.spec.resources + is used. If allocatedResources is not set, PVC.spec.resources + alone is used for quota calculation. If a volume expansion + capacity request is lowered, allocatedResources is only + lowered if there are no expansion operations in progress + and if the actual volume capacity is equal or lower than + the requested capacity. This is an alpha field and requires + enabling RecoverVolumeExpansionFailure feature. + type: object capacity: additionalProperties: anyOf: @@ -1062,36 +1605,37 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: Represents the actual resources of the underlying - volume. + description: capacity represents the actual resources of + the underlying volume. type: object conditions: - description: Current Condition of persistent volume claim. - If underlying persistent volume is being resized then - the Condition will be set to 'ResizeStarted'. + description: conditions is the current Condition of persistent + volume claim. If underlying persistent volume is being + resized then the Condition will be set to 'ResizeStarted'. items: description: PersistentVolumeClaimCondition contails details about state of pvc properties: lastProbeTime: - description: Last time we probed the condition. + description: lastProbeTime is the time we probed the + condition. format: date-time type: string lastTransitionTime: - description: Last time the condition transitioned - from one status to another. + description: lastTransitionTime is the time the condition + transitioned from one status to another. format: date-time type: string message: - description: Human-readable message indicating details - about last transition. + description: message is the human-readable message + indicating details about last transition. type: string reason: - description: Unique, this should be a short, machine - understandable string that gives the reason for - condition's last transition. If it reports "ResizeStarted" - that means the underlying persistent volume is being - resized. + description: reason is a unique, this should be a + short, machine understandable string that gives + the reason for condition's last transition. If it + reports "ResizeStarted" that means the underlying + persistent volume is being resized. type: string status: type: string @@ -1105,7 +1649,14 @@ spec: type: object type: array phase: - description: Phase represents the current phase of PersistentVolumeClaim. + description: phase represents the current phase of PersistentVolumeClaim. + type: string + resizeStatus: + description: resizeStatus stores status of resize operation. + ResizeStatus is not set by default but when expansion + is complete resizeStatus is set to empty string by resize + controller or kubelet. This is an alpha field and requires + enabling RecoverVolumeExpansionFailure feature. type: string type: object type: object @@ -1160,117 +1711,121 @@ spec: be accessed by any container in the pod. properties: awsElasticBlockStore: - description: 'AWSElasticBlockStore represents an AWS Disk resource + description: 'awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' properties: fsType: - description: 'Filesystem type of the volume that you want - to mount. Tip: Ensure that the filesystem type is supported - by the host operating system. Examples: "ext4", "xfs", - "ntfs". Implicitly inferred to be "ext4" if unspecified. - More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + description: 'fsType is the filesystem type of the volume + that you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine' type: string partition: - description: 'The partition in the volume that you want - to mount. If omitted, the default is to mount by volume - name. Examples: For volume /dev/sda1, you specify the - partition as "1". Similarly, the volume partition for - /dev/sda is "0" (or you can leave the property empty).' + description: 'partition is the partition in the volume that + you want to mount. If omitted, the default is to mount + by volume name. Examples: For volume /dev/sda1, you specify + the partition as "1". Similarly, the volume partition + for /dev/sda is "0" (or you can leave the property empty).' format: int32 type: integer readOnly: - description: 'Specify "true" to force and set the ReadOnly - property in VolumeMounts to "true". If omitted, the default - is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: 'readOnly value true will force the readOnly + setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: boolean volumeID: - description: 'Unique ID of the persistent disk resource - in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: 'volumeID is unique ID of the persistent disk + resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: string required: - volumeID type: object azureDisk: - description: AzureDisk represents an Azure Data Disk mount on + description: azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. properties: cachingMode: - description: 'Host Caching mode: None, Read Only, Read Write.' + description: 'cachingMode is the Host Caching mode: None, + Read Only, Read Write.' type: string diskName: - description: The Name of the data disk in the blob storage + description: diskName is the Name of the data disk in the + blob storage type: string diskURI: - description: The URI the data disk in the blob storage + description: diskURI is the URI of data disk in the blob + storage type: string fsType: - description: Filesystem type to mount. Must be a filesystem - type supported by the host operating system. Ex. "ext4", - "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: fsType is Filesystem type to mount. Must be + a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. type: string kind: - description: 'Expected values Shared: multiple blob disks - per storage account Dedicated: single blob disk per storage - account Managed: azure managed data disk (only in managed - availability set). defaults to shared' + description: 'kind expected values are Shared: multiple + blob disks per storage account Dedicated: single blob + disk per storage account Managed: azure managed data + disk (only in managed availability set). defaults to shared' type: string readOnly: - description: Defaults to false (read/write). ReadOnly here - will force the ReadOnly setting in VolumeMounts. + description: readOnly Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean required: - diskName - diskURI type: object azureFile: - description: AzureFile represents an Azure File Service mount + description: azureFile represents an Azure File Service mount on the host and bind mount to the pod. properties: readOnly: - description: Defaults to false (read/write). ReadOnly here - will force the ReadOnly setting in VolumeMounts. + description: readOnly defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean secretName: - description: the name of secret that contains Azure Storage - Account Name and Key + description: secretName is the name of secret that contains + Azure Storage Account Name and Key type: string shareName: - description: Share Name + description: shareName is the azure share Name type: string required: - secretName - shareName type: object cephfs: - description: CephFS represents a Ceph FS mount on the host that + description: cephFS represents a Ceph FS mount on the host that shares a pod's lifetime properties: monitors: - description: 'Required: Monitors is a collection of Ceph - monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'monitors is Required: Monitors is a collection + of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' items: type: string type: array path: - description: 'Optional: Used as the mounted root, rather - than the full Ceph tree, default is /' + description: 'path is Optional: Used as the mounted root, + rather than the full Ceph tree, default is /' type: string readOnly: - description: 'Optional: Defaults to false (read/write). + description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: boolean secretFile: - description: 'Optional: SecretFile is the path to key ring - for User, default is /etc/ceph/user.secret More info: - https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'secretFile is Optional: SecretFile is the + path to key ring for User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string secretRef: - description: 'Optional: SecretRef is reference to the authentication - secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'secretRef is Optional: SecretRef is reference + to the authentication secret for User, default is empty. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' properties: name: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names @@ -1278,30 +1833,30 @@ spec: type: string type: object user: - description: 'Optional: User is the rados user name, default - is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'user is optional: User is the rados user name, + default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string required: - monitors type: object cinder: - description: 'Cinder represents a cinder volume attached and + description: 'cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' properties: fsType: - description: 'Filesystem type to mount. Must be a filesystem - type supported by the host operating system. Examples: - "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" - if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: 'fsType is the filesystem type to mount. Must + be a filesystem type supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to + be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: string readOnly: - description: 'Optional: Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting in VolumeMounts. + description: 'readOnly defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: boolean secretRef: - description: 'Optional: points to a secret object containing - parameters used to connect to OpenStack.' + description: 'secretRef is optional: points to a secret + object containing parameters used to connect to OpenStack.' properties: name: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names @@ -1309,31 +1864,31 @@ spec: type: string type: object volumeID: - description: 'volume id used to identify the volume in cinder. + description: 'volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: string required: - volumeID type: object configMap: - description: ConfigMap represents a configMap that should populate + description: configMap represents a configMap that should populate this volume properties: defaultMode: - description: 'Optional: mode bits used to set permissions - on created files by default. Must be an octal value between - 0000 and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires decimal - values for mode bits. Defaults to 0644. Directories within - the path are not affected by this setting. This might - be in conflict with other options that affect the file - mode, like fsGroup, and the result can be other mode bits - set.' + description: 'defaultMode is optional: mode bits used to + set permissions on created files by default. Must be an + octal value between 0000 and 0777 or a decimal value between + 0 and 511. YAML accepts both octal and decimal values, + JSON requires decimal values for mode bits. Defaults to + 0644. Directories within the path are not affected by + this setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' format: int32 type: integer items: - description: If unspecified, each key-value pair in the - Data field of the referenced ConfigMap will be projected + description: items if unspecified, each key-value pair in + the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be @@ -1345,25 +1900,25 @@ spec: description: Maps a string key to a path within a volume. properties: key: - description: The key to project. + description: key is the key to project. type: string mode: - description: 'Optional: mode bits used to set permissions - on this file. Must be an octal value between 0000 - and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires - decimal values for mode bits. If not specified, - the volume defaultMode will be used. This might - be in conflict with other options that affect the - file mode, like fsGroup, and the result can be other - mode bits set.' + description: 'mode is Optional: mode bits used to + set permissions on this file. Must be an octal value + between 0000 and 0777 or a decimal value between + 0 and 511. YAML accepts both octal and decimal values, + JSON requires decimal values for mode bits. If not + specified, the volume defaultMode will be used. + This might be in conflict with other options that + affect the file mode, like fsGroup, and the result + can be other mode bits set.' format: int32 type: integer path: - description: The relative path of the file to map - the key to. May not be an absolute path. May not - contain the path element '..'. May not start with - the string '..'. + description: path is the relative path of the file + to map the key to. May not be an absolute path. + May not contain the path element '..'. May not start + with the string '..'. type: string required: - key @@ -1375,28 +1930,28 @@ spec: TODO: Add other useful fields. apiVersion, kind, uid?' type: string optional: - description: Specify whether the ConfigMap or its keys must - be defined + description: optional specify whether the ConfigMap or its + keys must be defined type: boolean type: object csi: - description: CSI (Container Storage Interface) represents ephemeral + description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). properties: driver: - description: Driver is the name of the CSI driver that handles + description: driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. type: string fsType: - description: Filesystem type to mount. Ex. "ext4", "xfs", - "ntfs". If not provided, the empty value is passed to - the associated CSI driver which will determine the default - filesystem to apply. + description: fsType to mount. Ex. "ext4", "xfs", "ntfs". + If not provided, the empty value is passed to the associated + CSI driver which will determine the default filesystem + to apply. type: string nodePublishSecretRef: - description: NodePublishSecretRef is a reference to the + description: nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, @@ -1410,13 +1965,13 @@ spec: type: string type: object readOnly: - description: Specifies a read-only configuration for the - volume. Defaults to false (read/write). + description: readOnly specifies a read-only configuration + for the volume. Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: VolumeAttributes stores driver-specific properties + description: volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. type: object @@ -1424,7 +1979,7 @@ spec: - driver type: object downwardAPI: - description: DownwardAPI represents downward API about the pod + description: downwardAPI represents downward API about the pod that should populate this volume properties: defaultMode: @@ -1511,50 +2066,47 @@ spec: type: array type: object emptyDir: - description: 'EmptyDir represents a temporary directory that + description: 'emptyDir represents a temporary directory that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' properties: medium: - description: 'What type of storage medium should back this - directory. The default is "" which means to use the node''s - default medium. Must be an empty string (default) or Memory. - More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: 'medium represents what type of storage medium + should back this directory. The default is "" which means + to use the node''s default medium. Must be an empty string + (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' type: string sizeLimit: anyOf: - type: integer - type: string - description: 'Total amount of local storage required for - this EmptyDir volume. The size limit is also applicable - for memory medium. The maximum usage on memory medium - EmptyDir would be the minimum value between the SizeLimit - specified here and the sum of memory limits of all containers - in a pod. The default is nil which means that the limit - is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + description: 'sizeLimit is the total amount of local storage + required for this EmptyDir volume. The size limit is also + applicable for memory medium. The maximum usage on memory + medium EmptyDir would be the minimum value between the + SizeLimit specified here and the sum of memory limits + of all containers in a pod. The default is nil which means + that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "Ephemeral represents a volume that is handled + description: "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed. \n Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity - \ tracking are needed, c) the storage driver is specified - through a storage class, and d) the storage driver supports - dynamic volume provisioning through a PersistentVolumeClaim - (see EphemeralVolumeSource for more information on the - connection between this volume type and PersistentVolumeClaim). - \n Use PersistentVolumeClaim or one of the vendor-specific - APIs for volumes that persist for longer than the lifecycle - of an individual pod. \n Use CSI for light-weight local ephemeral - volumes if the CSI driver is meant to be used that way - see - the documentation of the driver for more information. \n A - pod can use both types of ephemeral volumes and persistent - volumes at the same time. \n This is a beta feature and only - available when the GenericEphemeralVolume feature gate is - enabled." + tracking are needed, c) the storage driver is specified through + a storage class, and d) the storage driver supports dynamic + volume provisioning through a PersistentVolumeClaim (see EphemeralVolumeSource + for more information on the connection between this volume + type and PersistentVolumeClaim). \n Use PersistentVolumeClaim + or one of the vendor-specific APIs for volumes that persist + for longer than the lifecycle of an individual pod. \n Use + CSI for light-weight local ephemeral volumes if the CSI driver + is meant to be used that way - see the documentation of the + driver for more information. \n A pod can use both types of + ephemeral volumes and persistent volumes at the same time." properties: volumeClaimTemplate: description: "Will be used to create a stand-alone PVC to @@ -1606,13 +2158,13 @@ spec: as in a PersistentVolumeClaim are also valid here. properties: accessModes: - description: 'AccessModes contains the desired access + description: 'accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array dataSource: - description: 'This field can be used to specify + description: 'dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support @@ -1642,14 +2194,14 @@ spec: - name type: object dataSourceRef: - description: 'Specifies the object from which to - populate the volume with data, if a non-empty - volume is desired. This may be any local object - from a non-empty API group (non core object) or - a PersistentVolumeClaim object. When this field - is specified, volume binding will only succeed - if the type of the specified object matches some - installed volume populator or dynamic provisioner. + description: 'dataSourceRef specifies the object + from which to populate the volume with data, if + a non-empty volume is desired. This may be any + local object from a non-empty API group (non core + object) or a PersistentVolumeClaim object. When + this field is specified, volume binding will only + succeed if the type of the specified object matches + some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For @@ -1659,13 +2211,13 @@ spec: other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, - DataSourceRef allows any non-core object, as - well as PersistentVolumeClaim objects. * While - DataSource ignores disallowed values (dropping - them), DataSourceRef preserves all values, and - generates an error if a disallowed value is specified. - (Alpha) Using this field requires the AnyVolumeDataSource - feature gate to be enabled.' + DataSourceRef allows any non-core object, as well + as PersistentVolumeClaim objects. * While DataSource + ignores disallowed values (dropping them), DataSourceRef + preserves all values, and generates an error if + a disallowed value is specified. (Beta) Using + this field requires the AnyVolumeDataSource feature + gate to be enabled.' properties: apiGroup: description: APIGroup is the group for the resource @@ -1687,8 +2239,12 @@ spec: - name type: object resources: - description: 'Resources represents the minimum resources - the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: 'resources represents the minimum resources + the volume should have. If RecoverVolumeExpansionFailure + feature is enabled users are allowed to specify + resource requirements that are lower than previous + value but must still be higher than capacity recorded + in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: limits: additionalProperties: @@ -1716,8 +2272,8 @@ spec: type: object type: object selector: - description: A label query over volumes to consider - for binding. + description: selector is a label query over volumes + to consider for binding. properties: matchExpressions: description: matchExpressions is a list of label @@ -1767,8 +2323,9 @@ spec: type: object type: object storageClassName: - description: 'Name of the StorageClass required - by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: 'storageClassName is the name of the + StorageClass required by the claim. More info: + https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' type: string volumeMode: description: volumeMode defines what type of volume @@ -1776,7 +2333,7 @@ spec: is implied when not included in claim spec. type: string volumeName: - description: VolumeName is the binding reference + description: volumeName is the binding reference to the PersistentVolume backing this claim. type: string type: object @@ -1785,32 +2342,33 @@ spec: type: object type: object fc: - description: FC represents a Fibre Channel resource that is + description: fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. properties: fsType: - description: 'Filesystem type to mount. Must be a filesystem - type supported by the host operating system. Ex. "ext4", - "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - TODO: how do we prevent errors in the filesystem from - compromising the machine' + description: 'fsType is the filesystem type to mount. Must + be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. TODO: how do we prevent errors in the + filesystem from compromising the machine' type: string lun: - description: 'Optional: FC target lun number' + description: 'lun is Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'Optional: Defaults to false (read/write). + description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' type: boolean targetWWNs: - description: 'Optional: FC target worldwide names (WWNs)' + description: 'targetWWNs is Optional: FC target worldwide + names (WWNs)' items: type: string type: array wwids: - description: 'Optional: FC volume world wide identifiers + description: 'wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.' items: @@ -1818,34 +2376,36 @@ spec: type: array type: object flexVolume: - description: FlexVolume represents a generic volume resource + description: flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. properties: driver: - description: Driver is the name of the driver to use for + description: driver is the name of the driver to use for this volume. type: string fsType: - description: Filesystem type to mount. Must be a filesystem - type supported by the host operating system. Ex. "ext4", - "xfs", "ntfs". The default filesystem depends on FlexVolume - script. + description: fsType is the filesystem type to mount. Must + be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". The default filesystem depends + on FlexVolume script. type: string options: additionalProperties: type: string - description: 'Optional: Extra command options if any.' + description: 'options is Optional: this field holds extra + command options if any.' type: object readOnly: - description: 'Optional: Defaults to false (read/write). + description: 'readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' type: boolean secretRef: - description: 'Optional: SecretRef is reference to the secret - object containing sensitive information to pass to the - plugin scripts. This may be empty if no secret object - is specified. If the secret object contains more than - one secret, all secrets are passed to the plugin scripts.' + description: 'secretRef is Optional: secretRef is reference + to the secret object containing sensitive information + to pass to the plugin scripts. This may be empty if no + secret object is specified. If the secret object contains + more than one secret, all secrets are passed to the plugin + scripts.' properties: name: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names @@ -1856,90 +2416,92 @@ spec: - driver type: object flocker: - description: Flocker represents a Flocker volume attached to + description: flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running properties: datasetName: - description: Name of the dataset stored as metadata -> name - on the dataset for Flocker should be considered as deprecated + description: datasetName is Name of the dataset stored as + metadata -> name on the dataset for Flocker should be + considered as deprecated type: string datasetUUID: - description: UUID of the dataset. This is unique identifier - of a Flocker dataset + description: datasetUUID is the UUID of the dataset. This + is unique identifier of a Flocker dataset type: string type: object gcePersistentDisk: - description: 'GCEPersistentDisk represents a GCE Disk resource + description: 'gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' properties: fsType: - description: 'Filesystem type of the volume that you want - to mount. Tip: Ensure that the filesystem type is supported - by the host operating system. Examples: "ext4", "xfs", - "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: 'fsType is filesystem type of the volume that + you want to mount. Tip: Ensure that the filesystem type + is supported by the host operating system. Examples: "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk TODO: how do we prevent errors in the filesystem from compromising the machine' type: string partition: - description: 'The partition in the volume that you want - to mount. If omitted, the default is to mount by volume - name. Examples: For volume /dev/sda1, you specify the - partition as "1". Similarly, the volume partition for - /dev/sda is "0" (or you can leave the property empty). + description: 'partition is the partition in the volume that + you want to mount. If omitted, the default is to mount + by volume name. Examples: For volume /dev/sda1, you specify + the partition as "1". Similarly, the volume partition + for /dev/sda is "0" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' format: int32 type: integer pdName: - description: 'Unique name of the PD resource in GCE. Used - to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: 'pdName is unique name of the PD resource in + GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: string readOnly: - description: 'ReadOnly here will force the ReadOnly setting + description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: boolean required: - pdName type: object gitRepo: - description: 'GitRepo represents a git repository at a particular + description: 'gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod''s container.' properties: directory: - description: Target directory name. Must not contain or - start with '..'. If '.' is supplied, the volume directory - will be the git repository. Otherwise, if specified, - the volume will contain the git repository in the subdirectory - with the given name. + description: directory is the target directory name. Must + not contain or start with '..'. If '.' is supplied, the + volume directory will be the git repository. Otherwise, + if specified, the volume will contain the git repository + in the subdirectory with the given name. type: string repository: - description: Repository URL + description: repository is the URL type: string revision: - description: Commit hash for the specified revision. + description: revision is the commit hash for the specified + revision. type: string required: - repository type: object glusterfs: - description: 'Glusterfs represents a Glusterfs mount on the + description: 'glusterfs represents a Glusterfs mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' properties: endpoints: - description: 'EndpointsName is the endpoint name that details + description: 'endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string path: - description: 'Path is the Glusterfs volume path. More info: + description: 'path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string readOnly: - description: 'ReadOnly here will force the Glusterfs volume + description: 'readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: boolean @@ -1948,7 +2510,7 @@ spec: - path type: object hostPath: - description: 'HostPath represents a pre-existing file or directory + description: 'hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers @@ -1957,68 +2519,70 @@ spec: mounts and who can/can not mount host directories as read/write.' properties: path: - description: 'Path of the directory on the host. If the + description: 'path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string type: - description: 'Type for HostPath Volume Defaults to "" More + description: 'type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string required: - path type: object iscsi: - description: 'ISCSI represents an ISCSI Disk resource that is + description: 'iscsi represents an ISCSI Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' properties: chapAuthDiscovery: - description: whether support iSCSI Discovery CHAP authentication + description: chapAuthDiscovery defines whether support iSCSI + Discovery CHAP authentication type: boolean chapAuthSession: - description: whether support iSCSI Session CHAP authentication + description: chapAuthSession defines whether support iSCSI + Session CHAP authentication type: boolean fsType: - description: 'Filesystem type of the volume that you want - to mount. Tip: Ensure that the filesystem type is supported - by the host operating system. Examples: "ext4", "xfs", - "ntfs". Implicitly inferred to be "ext4" if unspecified. - More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi + description: 'fsType is the filesystem type of the volume + that you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine' type: string initiatorName: - description: Custom iSCSI Initiator Name. If initiatorName - is specified with iscsiInterface simultaneously, new iSCSI - interface : will be created - for the connection. + description: initiatorName is the custom iSCSI Initiator + Name. If initiatorName is specified with iscsiInterface + simultaneously, new iSCSI interface : will be created for the connection. type: string iqn: - description: Target iSCSI Qualified Name. + description: iqn is the target iSCSI Qualified Name. type: string iscsiInterface: - description: iSCSI Interface Name that uses an iSCSI transport. - Defaults to 'default' (tcp). + description: iscsiInterface is the interface Name that uses + an iSCSI transport. Defaults to 'default' (tcp). type: string lun: - description: iSCSI Target Lun number. + description: lun represents iSCSI Target Lun number. format: int32 type: integer portals: - description: iSCSI Target Portal List. The portal is either - an IP or ip_addr:port if the port is other than default - (typically TCP ports 860 and 3260). + description: portals is the iSCSI Target Portal List. The + portal is either an IP or ip_addr:port if the port is + other than default (typically TCP ports 860 and 3260). items: type: string type: array readOnly: - description: ReadOnly here will force the ReadOnly setting + description: readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. type: boolean secretRef: - description: CHAP Secret for iSCSI target and initiator - authentication + description: secretRef is the CHAP Secret for iSCSI target + and initiator authentication properties: name: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names @@ -2026,9 +2590,9 @@ spec: type: string type: object targetPortal: - description: iSCSI Target Portal. The Portal is either an - IP or ip_addr:port if the port is other than default (typically - TCP ports 860 and 3260). + description: targetPortal is iSCSI Target Portal. The Portal + is either an IP or ip_addr:port if the port is other than + default (typically TCP ports 860 and 3260). type: string required: - iqn @@ -2036,24 +2600,24 @@ spec: - targetPortal type: object name: - description: 'Volume''s name. Must be a DNS_LABEL and unique + description: 'name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string nfs: - description: 'NFS represents an NFS mount on the host that shares + description: 'nfs represents an NFS mount on the host that shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' properties: path: - description: 'Path that is exported by the NFS server. More + description: 'path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string readOnly: - description: 'ReadOnly here will force the NFS export to + description: 'readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: boolean server: - description: 'Server is the hostname or IP address of the + description: 'server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string required: @@ -2061,86 +2625,87 @@ spec: - server type: object persistentVolumeClaim: - description: 'PersistentVolumeClaimVolumeSource represents a + description: 'persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: claimName: - description: 'ClaimName is the name of a PersistentVolumeClaim + description: 'claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' type: string readOnly: - description: Will force the ReadOnly setting in VolumeMounts. - Default false. + description: readOnly Will force the ReadOnly setting in + VolumeMounts. Default false. type: boolean required: - claimName type: object photonPersistentDisk: - description: PhotonPersistentDisk represents a PhotonController + description: photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine properties: fsType: - description: Filesystem type to mount. Must be a filesystem - type supported by the host operating system. Ex. "ext4", - "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: fsType is the filesystem type to mount. Must + be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. type: string pdID: - description: ID that identifies Photon Controller persistent - disk + description: pdID is the ID that identifies Photon Controller + persistent disk type: string required: - pdID type: object portworxVolume: - description: PortworxVolume represents a portworx volume attached + description: portworxVolume represents a portworx volume attached and mounted on kubelets host machine properties: fsType: - description: FSType represents the filesystem type to mount + description: fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: Defaults to false (read/write). ReadOnly here - will force the ReadOnly setting in VolumeMounts. + description: readOnly defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean volumeID: - description: VolumeID uniquely identifies a Portworx volume + description: volumeID uniquely identifies a Portworx volume type: string required: - volumeID type: object projected: - description: Items for all in one resources secrets, configmaps, - and downward API + description: projected items for all in one resources secrets, + configmaps, and downward API properties: defaultMode: - description: Mode bits used to set permissions on created - files by default. Must be an octal value between 0000 - and 0777 or a decimal value between 0 and 511. YAML accepts - both octal and decimal values, JSON requires decimal values - for mode bits. Directories within the path are not affected - by this setting. This might be in conflict with other - options that affect the file mode, like fsGroup, and the - result can be other mode bits set. + description: defaultMode are the mode bits used to set permissions + on created files by default. Must be an octal value between + 0000 and 0777 or a decimal value between 0 and 511. YAML + accepts both octal and decimal values, JSON requires decimal + values for mode bits. Directories within the path are + not affected by this setting. This might be in conflict + with other options that affect the file mode, like fsGroup, + and the result can be other mode bits set. format: int32 type: integer sources: - description: list of volume projections + description: sources is the list of volume projections items: description: Projection that may be projected along with other supported volume types properties: configMap: - description: information about the configMap data - to project + description: configMap information about the configMap + data to project properties: items: - description: If unspecified, each key-value pair - in the Data field of the referenced ConfigMap + description: items if unspecified, each key-value + pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected @@ -2155,27 +2720,28 @@ spec: a volume. properties: key: - description: The key to project. + description: key is the key to project. type: string mode: - description: 'Optional: mode bits used to - set permissions on this file. Must be - an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML - accepts both octal and decimal values, - JSON requires decimal values for mode - bits. If not specified, the volume defaultMode - will be used. This might be in conflict - with other options that affect the file - mode, like fsGroup, and the result can - be other mode bits set.' + description: 'mode is Optional: mode bits + used to set permissions on this file. + Must be an octal value between 0000 and + 0777 or a decimal value between 0 and + 511. YAML accepts both octal and decimal + values, JSON requires decimal values for + mode bits. If not specified, the volume + defaultMode will be used. This might be + in conflict with other options that affect + the file mode, like fsGroup, and the result + can be other mode bits set.' format: int32 type: integer path: - description: The relative path of the file - to map the key to. May not be an absolute - path. May not contain the path element - '..'. May not start with the string '..'. + description: path is the relative path of + the file to map the key to. May not be + an absolute path. May not contain the + path element '..'. May not start with + the string '..'. type: string required: - key @@ -2189,13 +2755,13 @@ spec: uid?' type: string optional: - description: Specify whether the ConfigMap or - its keys must be defined + description: optional specify whether the ConfigMap + or its keys must be defined type: boolean type: object downwardAPI: - description: information about the downwardAPI data - to project + description: downwardAPI information about the downwardAPI + data to project properties: items: description: Items is a list of DownwardAPIVolume @@ -2276,15 +2842,15 @@ spec: type: array type: object secret: - description: information about the secret data to - project + description: secret information about the secret data + to project properties: items: - description: If unspecified, each key-value pair - in the Data field of the referenced Secret will - be projected into the volume as a file whose - name is the key and content is the value. If - specified, the listed keys will be projected + description: items if unspecified, each key-value + pair in the Data field of the referenced Secret + will be projected into the volume as a file + whose name is the key and content is the value. + If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup @@ -2296,27 +2862,28 @@ spec: a volume. properties: key: - description: The key to project. + description: key is the key to project. type: string mode: - description: 'Optional: mode bits used to - set permissions on this file. Must be - an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML - accepts both octal and decimal values, - JSON requires decimal values for mode - bits. If not specified, the volume defaultMode - will be used. This might be in conflict - with other options that affect the file - mode, like fsGroup, and the result can - be other mode bits set.' + description: 'mode is Optional: mode bits + used to set permissions on this file. + Must be an octal value between 0000 and + 0777 or a decimal value between 0 and + 511. YAML accepts both octal and decimal + values, JSON requires decimal values for + mode bits. If not specified, the volume + defaultMode will be used. This might be + in conflict with other options that affect + the file mode, like fsGroup, and the result + can be other mode bits set.' format: int32 type: integer path: - description: The relative path of the file - to map the key to. May not be an absolute - path. May not contain the path element - '..'. May not start with the string '..'. + description: path is the relative path of + the file to map the key to. May not be + an absolute path. May not contain the + path element '..'. May not start with + the string '..'. type: string required: - key @@ -2330,16 +2897,16 @@ spec: uid?' type: string optional: - description: Specify whether the Secret or its - key must be defined + description: optional field specify whether the + Secret or its key must be defined type: boolean type: object serviceAccountToken: - description: information about the serviceAccountToken - data to project + description: serviceAccountToken is information about + the serviceAccountToken data to project properties: audience: - description: Audience is the intended audience + description: audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the @@ -2347,7 +2914,7 @@ spec: of the apiserver. type: string expirationSeconds: - description: ExpirationSeconds is the requested + description: expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate @@ -2359,7 +2926,7 @@ spec: format: int64 type: integer path: - description: Path is the path relative to the + description: path is the path relative to the mount point of the file to project the token into. type: string @@ -2370,35 +2937,35 @@ spec: type: array type: object quobyte: - description: Quobyte represents a Quobyte mount on the host + description: quobyte represents a Quobyte mount on the host that shares a pod's lifetime properties: group: - description: Group to map volume access to Default is no + description: group to map volume access to Default is no group type: string readOnly: - description: ReadOnly here will force the Quobyte volume + description: readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. type: boolean registry: - description: Registry represents a single or multiple Quobyte + description: registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes type: string tenant: - description: Tenant owning the given Quobyte volume in the + description: tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin type: string user: - description: User to map volume access to Defaults to serivceaccount + description: user to map volume access to Defaults to serivceaccount user type: string volume: - description: Volume is a string that references an already + description: volume is a string that references an already created Quobyte volume by name. type: string required: @@ -2406,41 +2973,42 @@ spec: - volume type: object rbd: - description: 'RBD represents a Rados Block Device mount on the + description: 'rbd represents a Rados Block Device mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' properties: fsType: - description: 'Filesystem type of the volume that you want - to mount. Tip: Ensure that the filesystem type is supported - by the host operating system. Examples: "ext4", "xfs", - "ntfs". Implicitly inferred to be "ext4" if unspecified. - More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd + description: 'fsType is the filesystem type of the volume + that you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine' type: string image: - description: 'The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'image is the rados image name. More info: + https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string keyring: - description: 'Keyring is the path to key ring for RBDUser. + description: 'keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string monitors: - description: 'A collection of Ceph monitors. More info: - https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'monitors is a collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' items: type: string type: array pool: - description: 'The rados pool name. Default is rbd. More - info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'pool is the rados pool name. Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string readOnly: - description: 'ReadOnly here will force the ReadOnly setting + description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: boolean secretRef: - description: 'SecretRef is name of the authentication secret + description: 'secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' properties: @@ -2450,35 +3018,36 @@ spec: type: string type: object user: - description: 'The rados user name. Default is admin. More - info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'user is the rados user name. Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string required: - image - monitors type: object scaleIO: - description: ScaleIO represents a ScaleIO persistent volume + description: scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. properties: fsType: - description: Filesystem type to mount. Must be a filesystem - type supported by the host operating system. Ex. "ext4", - "xfs", "ntfs". Default is "xfs". + description: fsType is the filesystem type to mount. Must + be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Default is "xfs". type: string gateway: - description: The host address of the ScaleIO API Gateway. + description: gateway is the host address of the ScaleIO + API Gateway. type: string protectionDomain: - description: The name of the ScaleIO Protection Domain for - the configured storage. + description: protectionDomain is the name of the ScaleIO + Protection Domain for the configured storage. type: string readOnly: - description: Defaults to false (read/write). ReadOnly here - will force the ReadOnly setting in VolumeMounts. + description: readOnly Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: SecretRef references to the secret for ScaleIO + description: secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. properties: @@ -2488,25 +3057,26 @@ spec: type: string type: object sslEnabled: - description: Flag to enable/disable SSL communication with - Gateway, default false + description: sslEnabled Flag enable/disable SSL communication + with Gateway, default false type: boolean storageMode: - description: Indicates whether the storage for a volume - should be ThickProvisioned or ThinProvisioned. Default - is ThinProvisioned. + description: storageMode indicates whether the storage for + a volume should be ThickProvisioned or ThinProvisioned. + Default is ThinProvisioned. type: string storagePool: - description: The ScaleIO Storage Pool associated with the - protection domain. + description: storagePool is the ScaleIO Storage Pool associated + with the protection domain. type: string system: - description: The name of the storage system as configured - in ScaleIO. + description: system is the name of the storage system as + configured in ScaleIO. type: string volumeName: - description: The name of a volume already created in the - ScaleIO system that is associated with this volume source. + description: volumeName is the name of a volume already + created in the ScaleIO system that is associated with + this volume source. type: string required: - gateway @@ -2514,24 +3084,24 @@ spec: - system type: object secret: - description: 'Secret represents a secret that should populate + description: 'secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' properties: defaultMode: - description: 'Optional: mode bits used to set permissions - on created files by default. Must be an octal value between - 0000 and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires decimal - values for mode bits. Defaults to 0644. Directories within - the path are not affected by this setting. This might - be in conflict with other options that affect the file - mode, like fsGroup, and the result can be other mode bits - set.' + description: 'defaultMode is Optional: mode bits used to + set permissions on created files by default. Must be an + octal value between 0000 and 0777 or a decimal value between + 0 and 511. YAML accepts both octal and decimal values, + JSON requires decimal values for mode bits. Defaults to + 0644. Directories within the path are not affected by + this setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' format: int32 type: integer items: - description: If unspecified, each key-value pair in the - Data field of the referenced Secret will be projected + description: items If unspecified, each key-value pair in + the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be @@ -2543,25 +3113,25 @@ spec: description: Maps a string key to a path within a volume. properties: key: - description: The key to project. + description: key is the key to project. type: string mode: - description: 'Optional: mode bits used to set permissions - on this file. Must be an octal value between 0000 - and 0777 or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON requires - decimal values for mode bits. If not specified, - the volume defaultMode will be used. This might - be in conflict with other options that affect the - file mode, like fsGroup, and the result can be other - mode bits set.' + description: 'mode is Optional: mode bits used to + set permissions on this file. Must be an octal value + between 0000 and 0777 or a decimal value between + 0 and 511. YAML accepts both octal and decimal values, + JSON requires decimal values for mode bits. If not + specified, the volume defaultMode will be used. + This might be in conflict with other options that + affect the file mode, like fsGroup, and the result + can be other mode bits set.' format: int32 type: integer path: - description: The relative path of the file to map - the key to. May not be an absolute path. May not - contain the path element '..'. May not start with - the string '..'. + description: path is the relative path of the file + to map the key to. May not be an absolute path. + May not contain the path element '..'. May not start + with the string '..'. type: string required: - key @@ -2569,29 +3139,30 @@ spec: type: object type: array optional: - description: Specify whether the Secret or its keys must - be defined + description: optional field specify whether the Secret or + its keys must be defined type: boolean secretName: - description: 'Name of the secret in the pod''s namespace - to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: 'secretName is the name of the secret in the + pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' type: string type: object storageos: - description: StorageOS represents a StorageOS volume attached + description: storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. properties: fsType: - description: Filesystem type to mount. Must be a filesystem - type supported by the host operating system. Ex. "ext4", - "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: fsType is the filesystem type to mount. Must + be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. type: string readOnly: - description: Defaults to false (read/write). ReadOnly here - will force the ReadOnly setting in VolumeMounts. + description: readOnly defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: SecretRef specifies the secret to use for obtaining + description: secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. properties: @@ -2601,12 +3172,12 @@ spec: type: string type: object volumeName: - description: VolumeName is the human-readable name of the + description: volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. type: string volumeNamespace: - description: VolumeNamespace specifies the scope of the + description: volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS @@ -2617,24 +3188,26 @@ spec: type: string type: object vsphereVolume: - description: VsphereVolume represents a vSphere volume attached + description: vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine properties: fsType: - description: Filesystem type to mount. Must be a filesystem - type supported by the host operating system. Ex. "ext4", - "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: fsType is filesystem type to mount. Must be + a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. type: string storagePolicyID: - description: Storage Policy Based Management (SPBM) profile - ID associated with the StoragePolicyName. + description: storagePolicyID is the storage Policy Based + Management (SPBM) profile ID associated with the StoragePolicyName. type: string storagePolicyName: - description: Storage Policy Based Management (SPBM) profile - name. + description: storagePolicyName is the storage Policy Based + Management (SPBM) profile name. type: string volumePath: - description: Path that identifies vSphere volume vmdk + description: volumePath is the path that identifies vSphere + volume vmdk type: string required: - volumePath @@ -2650,17 +3223,32 @@ spec: OpenTelemetryCollector. properties: messages: - description: Messages about actions performed by the operator on this - resource. + description: 'Messages about actions performed by the operator on + this resource. Deprecated: use Kubernetes events instead.' items: type: string type: array x-kubernetes-list-type: atomic replicas: - description: Replicas is currently not being set and might be removed - in the next version. + description: 'Replicas is currently not being set and might be removed + in the next version. Deprecated: use "OpenTelemetryCollector.Status.Scale.Replicas" + instead.' format: int32 type: integer + scale: + description: Scale is the OpenTelemetryCollector's scale subresource + status. + properties: + replicas: + description: The total number non-terminated pods targeted by + this OpenTelemetryCollector's deployment or statefulSet. + format: int32 + type: integer + selector: + description: The selector used to match the OpenTelemetryCollector's + deployment or statefulSet pods. + type: string + type: object version: description: Version of the managed OpenTelemetry Collector (operand) type: string @@ -2670,8 +3258,9 @@ spec: storage: true subresources: scale: + labelSelectorPath: .status.scale.selector specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas + statusReplicasPath: .status.scale.replicas status: {} status: acceptedNames: @@ -2683,12 +3272,16 @@ status: apiVersion: v1 kind: ServiceAccount metadata: + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-controller-manager namespace: opentelemetry-operator-system --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-leader-election-role namespace: opentelemetry-operator-system rules: @@ -2724,6 +3317,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: creationTimestamp: null + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-manager-role rules: - apiGroups: @@ -2820,6 +3415,18 @@ rules: - patch - update - watch +- apiGroups: + - autoscaling + resources: + - horizontalpodautoscalers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - coordination.k8s.io resources: @@ -2871,6 +3478,8 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-metrics-reader rules: - nonResourceURLs: @@ -2881,6 +3490,8 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-proxy-role rules: - apiGroups: @@ -2899,6 +3510,8 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-leader-election-rolebinding namespace: opentelemetry-operator-system roleRef: @@ -2913,6 +3526,8 @@ subjects: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-manager-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io @@ -2926,6 +3541,8 @@ subjects: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-proxy-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io @@ -2940,6 +3557,7 @@ apiVersion: v1 kind: Service metadata: labels: + app.kubernetes.io/name: opentelemetry-operator control-plane: controller-manager name: opentelemetry-operator-controller-manager-metrics-service namespace: opentelemetry-operator-system @@ -2950,11 +3568,14 @@ spec: protocol: TCP targetPort: https selector: + app.kubernetes.io/name: opentelemetry-operator control-plane: controller-manager --- apiVersion: v1 kind: Service metadata: + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-webhook-service namespace: opentelemetry-operator-system spec: @@ -2963,12 +3584,14 @@ spec: protocol: TCP targetPort: 9443 selector: + app.kubernetes.io/name: opentelemetry-operator control-plane: controller-manager --- apiVersion: apps/v1 kind: Deployment metadata: labels: + app.kubernetes.io/name: opentelemetry-operator control-plane: controller-manager name: opentelemetry-operator-controller-manager namespace: opentelemetry-operator-system @@ -2976,17 +3599,19 @@ spec: replicas: 1 selector: matchLabels: + app.kubernetes.io/name: opentelemetry-operator control-plane: controller-manager template: metadata: labels: + app.kubernetes.io/name: opentelemetry-operator control-plane: controller-manager spec: containers: - args: - --metrics-addr=127.0.0.1:8080 - --enable-leader-election - image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:v0.42.0 + image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.56.0 livenessProbe: httpGet: path: /healthz @@ -3019,13 +3644,20 @@ spec: - --secure-listen-address=0.0.0.0:8443 - --upstream=http://127.0.0.1:8080/ - --logtostderr=true - - --v=10 - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0 + - --v=0 + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.11.0 name: kube-rbac-proxy ports: - containerPort: 8443 name: https protocol: TCP + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 5m + memory: 64Mi serviceAccountName: opentelemetry-operator-controller-manager terminationGracePeriodSeconds: 10 volumes: @@ -3037,6 +3669,8 @@ spec: apiVersion: cert-manager.io/v1 kind: Certificate metadata: + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-serving-cert namespace: opentelemetry-operator-system spec: @@ -3054,6 +3688,8 @@ spec: apiVersion: cert-manager.io/v1 kind: Issuer metadata: + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-selfsigned-issuer namespace: opentelemetry-operator-system spec: @@ -3064,11 +3700,12 @@ kind: MutatingWebhookConfiguration metadata: annotations: cert-manager.io/inject-ca-from: opentelemetry-operator-system/opentelemetry-operator-serving-cert + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-mutating-webhook-configuration webhooks: - admissionReviewVersions: - v1 - - v1beta1 clientConfig: service: name: opentelemetry-operator-webhook-service @@ -3089,7 +3726,6 @@ webhooks: sideEffects: None - admissionReviewVersions: - v1 - - v1beta1 clientConfig: service: name: opentelemetry-operator-webhook-service @@ -3110,7 +3746,6 @@ webhooks: sideEffects: None - admissionReviewVersions: - v1 - - v1beta1 clientConfig: service: name: opentelemetry-operator-webhook-service @@ -3135,11 +3770,12 @@ kind: ValidatingWebhookConfiguration metadata: annotations: cert-manager.io/inject-ca-from: opentelemetry-operator-system/opentelemetry-operator-serving-cert + labels: + app.kubernetes.io/name: opentelemetry-operator name: opentelemetry-operator-validating-webhook-configuration webhooks: - admissionReviewVersions: - v1 - - v1beta1 clientConfig: service: name: opentelemetry-operator-webhook-service @@ -3160,7 +3796,6 @@ webhooks: sideEffects: None - admissionReviewVersions: - v1 - - v1beta1 clientConfig: service: name: opentelemetry-operator-webhook-service @@ -3180,7 +3815,6 @@ webhooks: sideEffects: None - admissionReviewVersions: - v1 - - v1beta1 clientConfig: service: name: opentelemetry-operator-webhook-service @@ -3201,7 +3835,6 @@ webhooks: sideEffects: None - admissionReviewVersions: - v1 - - v1beta1 clientConfig: service: name: opentelemetry-operator-webhook-service @@ -3219,3 +3852,4 @@ webhooks: resources: - opentelemetrycollectors sideEffects: None + From b03aba99c3d915358e8500ca837c616c1f061bf8 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 1 Aug 2022 17:42:22 -0400 Subject: [PATCH 07/21] chore: update example config with new values --- config/pulumi/Pulumi.stackname.yaml.example | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/config/pulumi/Pulumi.stackname.yaml.example b/config/pulumi/Pulumi.stackname.yaml.example index b4718d34..1276d432 100644 --- a/config/pulumi/Pulumi.stackname.yaml.example +++ b/config/pulumi/Pulumi.stackname.yaml.example @@ -127,7 +127,7 @@ config: # Chart name for the helm chart for kic kic-helm:chart_name: nginx-ingress # Chart version for the helm chart for kic - kic-helm:chart_version: 0.13.2 + kic-helm:chart_version: 0.14.0 # Name of the repo to pull the kic chart from kic-helm:helm_repo_name: nginx-stable # URL of the chart repo to pull kic from @@ -151,12 +151,12 @@ config: # https://docs.nginx.com/nginx-ingress-controller/installation/pulling-ingress-controller-image/ # # The following are all valid image names: - # kic:image_name: private-registry.nginx.com/nginx-ic/nginx-plus-ingress:2.2.2 - # kic:image_name: private-registry.nginx.com/nginx-ic/nginx-plus-ingress:2.2.2-ot - # kic:image_name: docker.io/nginx/nginx-ingress:2.2.2 - # kic:image_name: nginx/nginx-ingress:2.2.2 - # kic:image_name: nginx/nginx-ingress:2.2.2-alpine - kic:image_name: nginx/nginx-ingress:2.2.2 + # kic:image_name: private-registry.nginx.com/nginx-ic/nginx-plus-ingress:2.3.0 + # kic:image_name: private-registry.nginx.com/nginx-ic/nginx-plus-ingress:2.3.0-ot + # kic:image_name: docker.io/nginx/nginx-ingress:2.3.0 + # kic:image_name: nginx/nginx-ingress:2.3.0 + # kic:image_name: nginx/nginx-ingress:2.3.0-alpine + kic:image_name: nginx/nginx-ingress:2.3.0 ############################################################################ @@ -230,7 +230,7 @@ config: # Logagent Configuration logagent:chart_name: filebeat # Chart name for the helm chart for the logagent - logagent:chart_version: 7.16.3 + logagent:chart_version: 7.17.3 # Chart version for the helm chart for the logagent logagent:helm_repo_name: elastic # Name of the repo to pull the logagent from @@ -246,7 +246,7 @@ config: # Logstore Configuration logstore:chart_name: elasticsearch # Chart name for the helm chart for the logstore - logstore:chart_version: 17.6.2 + logstore:chart_version: 19.1.4 # Chart version for the helm chart for the logstore logstore:helm_repo_name: bitnami # Name of the repo to pull the logstore from @@ -277,7 +277,7 @@ config: # Cert Manager Configuration certmgr:chart_name: cert-manager # Chart hame for the helm chart for certmanager - certmgr:chart_version: v1.6.1 + certmgr:chart_version: v1.9.1 # Chart version for the helm chart for certmanager certmgr:certmgr_helm_repo_name: jetstack # Name of the repo to pull the certmanager chart from @@ -293,7 +293,7 @@ config: # Prometheus Configuration prometheus:chart_name: kube-prometheus-stack # Chart name for the helm chart for prometheus - prometheus:chart_version: 30.0.1 + prometheus:chart_version: 39.2.1 # Chart version for the helm chart for prometheus prometheus:helm_repo_name: prometheus-community # Name of the repo to pull the prometheus chart from @@ -301,7 +301,7 @@ config: # URL of the chart repo prometheus:statsd_chart_name: prometheus-statsd-exporter # Name of the statsd chart (uses the same repo as the prom chart) - prometheus.statsd_chart_version: 0.4.2 + prometheus.statsd_chart_version: 0.5.0 # Version of the statsd chart (uses the same repo as the prom chart) prometheus:helm_timeout: 300 # Timeout value for helm operations in seconds @@ -338,7 +338,7 @@ config: # Linode Kubernetes Engine ############################################################################ # This is the Kubernetes version to install using Linode K8s. - linode:k8s_version: 1.22 + linode:k8s_version: 1.23 # This is the default instance type used Linode Kubernetes linode:instance_type: g6-standard-8 # The desired node count of the Linode K8s cluster. From 0ac8f42df2ba02121a8e816b8c4e36d99b35e4d2 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Tue, 2 Aug 2022 09:25:22 -0400 Subject: [PATCH 08/21] fix: remediation of deployment bugs --- pulumi/python/kubernetes/certmgr/__main__.py | 24 ++++---------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/pulumi/python/kubernetes/certmgr/__main__.py b/pulumi/python/kubernetes/certmgr/__main__.py index 992b5ece..49507c84 100644 --- a/pulumi/python/kubernetes/certmgr/__main__.py +++ b/pulumi/python/kubernetes/certmgr/__main__.py @@ -8,12 +8,6 @@ from kic_util import pulumi_config -def crd_deployment_manifest(): - script_dir = os.path.dirname(os.path.abspath(__file__)) - crd_deployment_path = os.path.join(script_dir, 'manifests', 'cert-manager.crds.yaml') - return crd_deployment_path - - def project_name_from_project_dir(dirname: str): script_dir = os.path.dirname(os.path.abspath(__file__)) project_path = os.path.join(script_dir, '..', '..', '..', 'python', 'infrastructure', dirname) @@ -40,17 +34,6 @@ def add_namespace(obj): metadata={'name': 'cert-manager'}, opts=pulumi.ResourceOptions(provider=k8s_provider)) -# Config Manifests -crd_deployment = crd_deployment_manifest() - -crd_dep = ConfigFile( - 'crd-dep', - file=crd_deployment, - transformations=[add_namespace], # Need to review w/ operator - opts=pulumi.ResourceOptions(depends_on=[ns]) -) - - config = pulumi.Config('certmgr') chart_name = config.get('chart_name') if not chart_name: @@ -81,6 +64,9 @@ def add_namespace(obj): ), version=chart_version, namespace=ns.metadata.name, + values={ + "installCRDs": "True" + }, # Configure the timeout value. timeout=helm_timeout, # By default Release resource will wait till all created resources @@ -96,7 +82,7 @@ def add_namespace(obj): # Force update if required force_update=True) -certmgr_release = Release("certmgr", args=certmgr_release_args, opts=pulumi.ResourceOptions(depends_on=crd_dep)) +certmgr_release = Release("certmgr", args=certmgr_release_args, opts=pulumi.ResourceOptions(depends_on=ns)) status = certmgr_release.status -pulumi.export("certmgr_status", status) +pulumi.export("certmgr_status", status) \ No newline at end of file From a66539ef6bb63d61f77150c86c10b8d633f05771 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Wed, 3 Aug 2022 12:10:58 -0400 Subject: [PATCH 09/21] fix: removed JWT-only logic from BoS --- .../applications/sirius/__main__.py | 81 ++++++++++--------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/pulumi/python/kubernetes/applications/sirius/__main__.py b/pulumi/python/kubernetes/applications/sirius/__main__.py index 3d5a3936..fb7c84bb 100644 --- a/pulumi/python/kubernetes/applications/sirius/__main__.py +++ b/pulumi/python/kubernetes/applications/sirius/__main__.py @@ -115,44 +115,49 @@ def add_namespace(obj): # We use the kubernetes namespace for this config = pulumi.Config('kubernetes') infra_type = config.require('infra_type') - -if infra_type == 'AWS': - # Logic to extract the FQDN of the load balancer for Ingress - ingress_project_name = pulumi_ingress_project_name() - ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" - ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) - lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') - sirius_host = lb_ingress_hostname -elif infra_type == 'kubeconfig': - # Logic to extract the FQDN of the load balancer for Ingress - ingress_project_name = pulumi_repo_ingress_project_name() - ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" - ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) - lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') - # Set back to kubernetes - config = pulumi.Config('kubernetes') - lb_ingress_ip = ingress_stack_ref.get_output('lb_ingress_ip') - sirius_host = lb_ingress_hostname -elif infra_type == 'DO': - # Logic to extract the FQDN of the load balancer for Ingress - ingress_project_name = pulumi_repo_ingress_project_name() - ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" - ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) - lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') - # Set back to kubernetes - config = pulumi.Config('kubernetes') - lb_ingress_ip = ingress_stack_ref.get_output('lb_ingress_ip') - sirius_host = lb_ingress_hostname -elif infra_type == 'LKE': - # Logic to extract the FQDN of the load balancer for Ingress - ingress_project_name = pulumi_repo_ingress_project_name() - ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" - ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) - lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') - # Set back to kubernetes - config = pulumi.Config('kubernetes') - lb_ingress_ip = ingress_stack_ref.get_output('lb_ingress_ip') - sirius_host = lb_ingress_hostname +ingress_project_name = pulumi_ingress_project_name() +ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" +ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) +lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') +sirius_host = lb_ingress_hostname + +# if infra_type == 'AWS': +# # Logic to extract the FQDN of the load balancer for Ingress +# ingress_project_name = pulumi_ingress_project_name() +# ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" +# ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) +# lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') +# sirius_host = lb_ingress_hostname +# elif infra_type == 'kubeconfig': +# # Logic to extract the FQDN of the load balancer for Ingress +# ingress_project_name = pulumi_repo_ingress_project_name() +# ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" +# ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) +# lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') +# # Set back to kubernetes +# config = pulumi.Config('kubernetes') +# lb_ingress_ip = ingress_stack_ref.get_output('lb_ingress_ip') +# sirius_host = lb_ingress_hostname +# elif infra_type == 'DO': +# # Logic to extract the FQDN of the load balancer for Ingress +# ingress_project_name = pulumi_repo_ingress_project_name() +# ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" +# ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) +# lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') +# # Set back to kubernetes +# config = pulumi.Config('kubernetes') +# lb_ingress_ip = ingress_stack_ref.get_output('lb_ingress_ip') +# sirius_host = lb_ingress_hostname +# elif infra_type == 'LKE': +# # Logic to extract the FQDN of the load balancer for Ingress +# ingress_project_name = pulumi_repo_ingress_project_name() +# ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" +# ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) +# lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') +# # Set back to kubernetes +# config = pulumi.Config('kubernetes') +# lb_ingress_ip = ingress_stack_ref.get_output('lb_ingress_ip') +# sirius_host = lb_ingress_hostname # Create the namespace for Bank of Sirius From be5ad7ebf0fc82739a97bdced87044b74d0f0ff4 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Wed, 3 Aug 2022 13:06:35 -0400 Subject: [PATCH 10/21] fix: remove logic for sirius_host from deprecated jwt deploys --- .../applications/sirius/__main__.py | 64 +++---------------- 1 file changed, 8 insertions(+), 56 deletions(-) diff --git a/pulumi/python/kubernetes/applications/sirius/__main__.py b/pulumi/python/kubernetes/applications/sirius/__main__.py index fb7c84bb..608a0275 100644 --- a/pulumi/python/kubernetes/applications/sirius/__main__.py +++ b/pulumi/python/kubernetes/applications/sirius/__main__.py @@ -102,64 +102,16 @@ def add_namespace(obj): k8s_provider = k8s.Provider(resource_name=f'ingress-controller', kubeconfig=kubeconfig) -# TODO: Streamline the logic for FQDN/IP into something a bit more sane and scalable #82 # -# Currently, if we are doing an AWS deployment we use the AWS IC deployment, which uses the ELB hostname -# as part of the certificate (self-signed). +# We use the hostanme to set the value for our FQDN, which drives the cert +# process as well. # -# If we are using a kubeconfig file (ie, not type AWS) we expect we are going to get an IP address and not -# a hostname in return. So we use the hostname variable to create the certificate we need, and then we use -# the IP address in output to the user to tell them to setup DNS or a hostfile. -# - -# We use the kubernetes namespace for this -config = pulumi.Config('kubernetes') -infra_type = config.require('infra_type') ingress_project_name = pulumi_ingress_project_name() ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') sirius_host = lb_ingress_hostname -# if infra_type == 'AWS': -# # Logic to extract the FQDN of the load balancer for Ingress -# ingress_project_name = pulumi_ingress_project_name() -# ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" -# ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) -# lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') -# sirius_host = lb_ingress_hostname -# elif infra_type == 'kubeconfig': -# # Logic to extract the FQDN of the load balancer for Ingress -# ingress_project_name = pulumi_repo_ingress_project_name() -# ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" -# ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) -# lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') -# # Set back to kubernetes -# config = pulumi.Config('kubernetes') -# lb_ingress_ip = ingress_stack_ref.get_output('lb_ingress_ip') -# sirius_host = lb_ingress_hostname -# elif infra_type == 'DO': -# # Logic to extract the FQDN of the load balancer for Ingress -# ingress_project_name = pulumi_repo_ingress_project_name() -# ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" -# ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) -# lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') -# # Set back to kubernetes -# config = pulumi.Config('kubernetes') -# lb_ingress_ip = ingress_stack_ref.get_output('lb_ingress_ip') -# sirius_host = lb_ingress_hostname -# elif infra_type == 'LKE': -# # Logic to extract the FQDN of the load balancer for Ingress -# ingress_project_name = pulumi_repo_ingress_project_name() -# ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" -# ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) -# lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') -# # Set back to kubernetes -# config = pulumi.Config('kubernetes') -# lb_ingress_ip = ingress_stack_ref.get_output('lb_ingress_ip') -# sirius_host = lb_ingress_hostname - - # Create the namespace for Bank of Sirius ns = k8s.core.v1.Namespace(resource_name='bos', metadata={'name': 'bos'}, @@ -426,12 +378,12 @@ def add_namespace(obj): elif infra_type == 'kubeconfig': pulumi.export('hostname', lb_ingress_hostname) pulumi.export('ipaddress', lb_ingress_ip) - #pulumi.export('application_url', f'https://{lb_ingress_hostname}') + # pulumi.export('application_url', f'https://{lb_ingress_hostname}') application_url = sirius_host.apply(lambda host: f'https://{host}') elif infra_type == 'DO': pulumi.export('hostname', lb_ingress_hostname) pulumi.export('ipaddress', lb_ingress_ip) - #pulumi.export('application_url', f'https://{lb_ingress_hostname}') + # pulumi.export('application_url', f'https://{lb_ingress_hostname}') application_url = sirius_host.apply(lambda host: f'https://{host}') # @@ -462,11 +414,11 @@ def add_namespace(obj): namespace=ns, # Values from Chart's parameters specified hierarchically, - values = { + values={ "serviceMonitor": { "enabled": True, "namespace": "prometheus" - }, + }, "config": { "datasource": { "host": "accounts-db", @@ -509,11 +461,11 @@ def add_namespace(obj): namespace=ns, # Values from Chart's parameters specified hierarchically, - values = { + values={ "serviceMonitor": { "enabled": True, "namespace": "prometheus" - }, + }, "config": { "datasource": { "host": "ledger-db", From b74831b2e65a573f573a61b9efa220f301dd3f09 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Wed, 3 Aug 2022 13:09:22 -0400 Subject: [PATCH 11/21] fix: remove deprecated ingress-repo-only project --- .../applications/sirius/__main__.py | 6 - .../ingress-controller-repo-only/Pulumi.yaml | 7 - .../ingress-controller-repo-only/__main__.py | 189 ------------------ .../manifests/.gitkeep | 0 4 files changed, 202 deletions(-) delete mode 100644 pulumi/python/kubernetes/nginx/ingress-controller-repo-only/Pulumi.yaml delete mode 100644 pulumi/python/kubernetes/nginx/ingress-controller-repo-only/__main__.py delete mode 100644 pulumi/python/kubernetes/nginx/ingress-controller-repo-only/manifests/.gitkeep diff --git a/pulumi/python/kubernetes/applications/sirius/__main__.py b/pulumi/python/kubernetes/applications/sirius/__main__.py index 608a0275..ce98d65a 100644 --- a/pulumi/python/kubernetes/applications/sirius/__main__.py +++ b/pulumi/python/kubernetes/applications/sirius/__main__.py @@ -37,12 +37,6 @@ def pulumi_ingress_project_name(): return pulumi_config.get_pulumi_project_name(ingress_project_path) -def pulumi_repo_ingress_project_name(): - script_dir = os.path.dirname(os.path.abspath(__file__)) - ingress_project_path = os.path.join(script_dir, '..', '..', 'nginx', 'ingress-controller-repo-only') - return pulumi_config.get_pulumi_project_name(ingress_project_path) - - def sirius_manifests_location(): script_dir = os.path.dirname(os.path.abspath(__file__)) sirius_manifests_path = os.path.join(script_dir, 'src', 'kubernetes-manifests', '*.yaml') diff --git a/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/Pulumi.yaml b/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/Pulumi.yaml deleted file mode 100644 index 6895e0c4..00000000 --- a/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/Pulumi.yaml +++ /dev/null @@ -1,7 +0,0 @@ -name: ingress-controller -runtime: - name: python - options: - virtualenv: ../../../venv -config: ../../../../../config/pulumi -description: Sets up NGINX Kubernetes Ingress Controller using Helm \ No newline at end of file diff --git a/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/__main__.py b/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/__main__.py deleted file mode 100644 index af2e3db8..00000000 --- a/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/__main__.py +++ /dev/null @@ -1,189 +0,0 @@ -import os - -import pulumi -from pulumi import Output -import pulumi_kubernetes as k8s -from pulumi_kubernetes.core.v1 import Service -from pulumi_kubernetes.helm.v3 import Release, ReleaseArgs, RepositoryOptsArgs -from pulumi_kubernetes.yaml import ConfigFile - -from kic_util import pulumi_config - -# -# We default to the OSS IC; if the user wants Plus they need to enable it in the config file -# along with the Plus flag, and the addition of a JWT. -# -config = pulumi.Config('kic-helm') -chart_name = config.get('chart_name') -if not chart_name: - chart_name = 'nginx-ingress' -chart_version = config.get('chart_version') -if not chart_version: - chart_version = '0.13.0' -helm_repo_name = config.get('helm_repo_name') -if not helm_repo_name: - helm_repo_name = 'nginx-stable' -helm_repo_url = config.get('helm_repo_url') -if not helm_repo_url: - helm_repo_url = 'https://helm.nginx.com/stable' -nginx_repository = config.get('nginx_repository') -if not nginx_repository: - nginx_repository = "nginx/nginx-ingress" -nginx_tag = config.get('nginx_tag') -if not nginx_tag: - nginx_tag = "2.2.0" -nginx_plus_flag = config.get_bool('nginx_plus_flag') -if not nginx_plus_flag: - nginx_plus_flag = False - -# -# Allow the user to set timeout per helm chart; otherwise -# we default to 5 minutes. -# -helm_timeout = config.get_int('helm_timeout') -if not helm_timeout: - helm_timeout = 300 - -# Get the FQDN -fqdn = config.get('fqdn') - - -def project_name_from_project_dir(dirname: str): - script_dir = os.path.dirname(os.path.abspath(__file__)) - project_path = os.path.join(script_dir, '..', '..', '..', 'infrastructure', dirname) - return pulumi_config.get_pulumi_project_name(project_path) - - -def k8_manifest_location(): - script_dir = os.path.dirname(os.path.abspath(__file__)) - k8_manifest_path = os.path.join(script_dir, 'manifests', 'regcred.yaml') - return k8_manifest_path - - -k8_manifest = k8_manifest_location() - -registrycred = ConfigFile( - "regcred", - file=k8_manifest) - -chart_values = { - 'controller': { - 'nginxplus': nginx_plus_flag, - 'healthStatus': True, - 'appprotect': { - 'enable': False - }, - "image": { - "repository": nginx_repository, - "tag": nginx_tag, - "pullPolicy": "Always" - }, - "serviceAccount": { - "imagePullSecretName": "regcred" - }, - 'config': { - 'name': 'nginx-config', - 'entries': { - 'log-format': '$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent ' - '\"$http_referer\" \"$http_user_agent\" $upstream_response_time $upstream_status ' - '\"$uri\" $request_length $request_time [$proxy_host] [] $upstream_addr ' - '$upstream_bytes_sent $upstream_response_time $upstream_status $request_id ' - } - }, - 'service': { - 'annotations': { - 'co.elastic.logs/module': 'nginx' - }, - "extraLabels": { - "app": "kic-nginx-ingress" - }, - "customPorts": [ - { - "name": "dashboard", - "targetPort": 8080, - "protocol": "TCP", - "port": 8080 - }, - { - "name": "prometheus", - "targetPort": 9113, - "protocol": "TCP", - "port": 9113 - } - ] - }, - 'pod': { - 'annotations': { - 'co.elastic.logs/module': 'nginx' - } - } - }, - 'prometheus': { - 'create': True, - 'port': 9113 - } -} - -stack_name = pulumi.get_stack() -project_name = pulumi.get_project() -pulumi_user = pulumi_config.get_pulumi_user() - -kube_project_name = project_name_from_project_dir('kubeconfig') -kube_stack_ref_id = f"{pulumi_user}/{kube_project_name}/{stack_name}" -kube_stack_ref = pulumi.StackReference(kube_stack_ref_id) -kubeconfig = kube_stack_ref.require_output('kubeconfig').apply(lambda c: str(c)) - -k8s_provider = k8s.Provider(resource_name=f'ingress-controller-repo-only', - kubeconfig=kubeconfig) - -# This is required for the service monitor from the Prometheus namespace -ns = k8s.core.v1.Namespace(resource_name='nginx-ingress', - metadata={'name': 'nginx-ingress', - 'labels': { - 'prometheus': 'scrape'} - }, - opts=pulumi.ResourceOptions(provider=k8s_provider)) - -kic_release_args = ReleaseArgs( - chart=chart_name, - repository_opts=RepositoryOptsArgs( - repo=helm_repo_url - ), - version=chart_version, - namespace=ns.metadata.name, - - # Values from Chart's parameters specified hierarchically, - values=chart_values, - # User configurable timeout - timeout=helm_timeout, - # By default Release resource will wait till all created resources - # are available. Set this to true to skip waiting on resources being - # available. - skip_await=False, - # If we fail, clean up - cleanup_on_fail=True, - # Provide a name for our release - name="kic", - # Lint the chart before installing - lint=True, - # Force update if required - force_update=True) - -kic_chart = Release("kic", args=kic_release_args, opts=pulumi.ResourceOptions(depends_on=[ns])) - -pstatus = kic_chart.status - -srv = Service.get("nginx-ingress", - Output.concat("nginx-ingress", "/", pstatus.name, "-nginx-ingress")) - -ingress_service = srv.status - -# -# Some LB's give us a hostname (which is cool) and some just an IP. We need to capture -# both, and then make a determination on what the user needs to do based on what they have -# been given. -# -pulumi.export('lb_ingress_hostname', fqdn) -pulumi.export('lb_ingress_ip', pulumi.Output.unsecret(ingress_service.load_balancer.ingress[0].ip)) -# Print out our status -pulumi.export("kic_status", pstatus) diff --git a/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/manifests/.gitkeep b/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/manifests/.gitkeep deleted file mode 100644 index e69de29b..00000000 From 58020d4f1177266d15e1333bb16414f235f3e253 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Wed, 3 Aug 2022 14:08:19 -0400 Subject: [PATCH 12/21] fix: adjust min kubectl version deployed --- bin/setup_venv.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/setup_venv.sh b/bin/setup_venv.sh index 845f70dc..e1ab75eb 100755 --- a/bin/setup_venv.sh +++ b/bin/setup_venv.sh @@ -258,7 +258,7 @@ fi # downloading the kubectl if it did not exist; this could result in versions not being updated if the # MARA project was run in the same environment w/o a refresh. # -# The two fixes here are to hardcode (For now) to a known good version (1.23.6) and force the script to +# The two fixes here are to hardcode (For now) to a known good version (1.24.3) and force the script to # always download this version. # # TODO: Figure out a way to not hardcode the kubectl version @@ -275,7 +275,7 @@ if [ ! -x "${VIRTUAL_ENV}/bin/kubectl" ]; then else echo "kubectl is already installed, but will overwrite to ensure correct version" echo "Downloading kubectl into virtual environment" - KUBECTL_VERSION="v1.23.6" + KUBECTL_VERSION="v1.24.3" ${download_cmd} "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/${OS}/${ARCH}/kubectl" >"${VIRTUAL_ENV}/bin/kubectl" KUBECTL_CHECKSUM="$(${download_cmd} "https://dl.k8s.io/${KUBECTL_VERSION}/bin/${OS}/${ARCH}/kubectl.sha256")" echo "${KUBECTL_CHECKSUM} ${VIRTUAL_ENV}/bin/kubectl" | ${sha256sum_cmd} @@ -316,4 +316,4 @@ if [ ! -x "${VIRTUAL_ENV}/bin/doctl" ]; then tar --extract --gunzip --directory "${VIRTUAL_ENV}/bin" --file "${DOCTL_TARBALL_DEST}" [ $? -eq 0 ] && echo "Digital Ocean CLI installed successfully" || echo "Failed to install Digital Ocean CLI" rm "${DOCTL_TARBALL_DEST}" -fi \ No newline at end of file +fi From 83ecfea90c9c8e2ef9e5e65ff766e873e9633ec6 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Thu, 4 Aug 2022 17:57:40 -0400 Subject: [PATCH 13/21] fix: refactor digitalocean to docean for variables --- config/pulumi/Pulumi.stackname.yaml.example | 8 ++-- pulumi/python/automation/providers/do.py | 38 +++++++++---------- .../container-registry/__main__.py | 2 +- .../digitalocean/dns-record/__main__.py | 9 ++++- .../digitalocean/domk8s/__main__.py | 8 ++-- .../applications/sirius/__main__.py | 21 +++------- 6 files changed, 40 insertions(+), 46 deletions(-) diff --git a/config/pulumi/Pulumi.stackname.yaml.example b/config/pulumi/Pulumi.stackname.yaml.example index 1276d432..d261d750 100644 --- a/config/pulumi/Pulumi.stackname.yaml.example +++ b/config/pulumi/Pulumi.stackname.yaml.example @@ -324,13 +324,13 @@ config: # Digital Ocean Managed Kubernetes and Container Registry ############################################################################ # This is the Kubernetes version to install using Digital Ocean K8s. - digitalocean:k8s_version: 1.22.8-do.1 + docean:k8s_version: 1.22.12-do.0 # This is the default instance type used by Digital Ocean K8s. - digitalocean:instance_size: s-2vcpu-4gb + docean:instance_size: s-4vcpu-8gb # The desired node count of the Digital Ocean K8s cluster. - digitalocean:node_count: 3 + docean:node_count: 3 # The region to deploy the cluster - digitalocean:region: sfo3 + docean:region: sfo3 # Subscription tier for container registry digitalocean:container_registry_subscription_tier: starter diff --git a/pulumi/python/automation/providers/do.py b/pulumi/python/automation/providers/do.py index f77441ec..0de22746 100644 --- a/pulumi/python/automation/providers/do.py +++ b/pulumi/python/automation/providers/do.py @@ -113,7 +113,7 @@ def new_stack_config(self, env_config, defaults: Union[Dict[Hashable, Any], list config = super().new_stack_config(env_config, defaults) if 'DIGITALOCEAN_TOKEN' not in env_config: - config['digitalocean:token'] = input("Digital Ocean API token (this is stored in plain-text - " + config['docean:token'] = input("Digital Ocean API token (this is stored in plain-text - " "alternatively this can be specified as the environment variable " "DIGITALOCEAN_TOKEN): ") @@ -131,42 +131,42 @@ def new_stack_config(self, env_config, defaults: Union[Dict[Hashable, Any], list print('Supported Kubernetes versions:') for slug in k8s_version_slugs: print(f' {slug}') - default_version = defaults['digitalocean:k8s_version'] or k8s_version_slugs[0] - config['digitalocean:k8s_version'] = input(f'Kubernetes version [{default_version}]: ').strip() or default_version - print(f"Kubernetes version: {config['digitalocean:k8s_version']}") + default_version = defaults['docean:k8s_version'] or k8s_version_slugs[0] + config['docean:k8s_version'] = input(f'Kubernetes version [{default_version}]: ').strip() or default_version + print(f"Kubernetes version: {config['docean:k8s_version']}") # Kubernetes regions k8s_regions_json_str, _ = external_process.run(do_cli.get_kubernetes_regions_json()) k8s_regions_json = json.loads(k8s_regions_json_str) - default_region = defaults['digitalocean:region'] or k8s_regions_json[-1]['slug'] + default_region = defaults['docean:region'] or k8s_regions_json[-1]['slug'] print('Supported Regions:') for item in k8s_regions_json: print(f" {item['name']}: {item['slug']}") - config['digitalocean:region'] = input(f'Region [{default_region}]: ').strip() or default_region - print(f"Region: {config['digitalocean:region']}") + config['docean:region'] = input(f'Region [{default_region}]: ').strip() or default_region + print(f"Region: {config['docean:region']}") # Kubernetes instance size k8s_sizes_json_str, _ = external_process.run(do_cli.get_kubernetes_instance_sizes_json()) k8s_sizes_json = json.loads(k8s_sizes_json_str) k8s_sizes_slugs = [size['slug'] for size in k8s_sizes_json] - default_size = defaults['digitalocean:instance_size'] or 's-2vcpu-4gb' + default_size = defaults['docean:instance_size'] or 's-2vcpu-4gb' print('Supported Instance Sizes:') for slug in k8s_sizes_slugs: print(f' {slug}') - config['digitalocean:instance_size'] = input(f'Instance size [{default_size}]: ').strip() or default_size - print(f"Instance size: {config['digitalocean:instance_size']}") + config['docean:instance_size'] = input(f'Instance size [{default_size}]: ').strip() or default_size + print(f"Instance size: {config['docean:instance_size']}") # Kubernetes instance count - default_node_count = defaults['digitalocean:node_count'] or 3 - while 'digitalocean:node_count' not in config: + default_node_count = defaults['docean:node_count'] or 3 + while 'docean:node_count' not in config: node_count = input('Node count for Kubernetes cluster ' f'[{default_node_count}]: ').strip() or default_node_count if type(node_count) == int or node_count.isdigit(): - config['digitalocean:node_count'] = int(node_count) - print(f"Node count: {config['digitalocean:node_count']}") + config['docean:node_count'] = int(node_count) + print(f"Node count: {config['docean:node_count']}") return config @@ -217,16 +217,16 @@ def token(stack_config: Union[Mapping[str, Any], MutableMapping[str, auto._confi return env_config['DIGITALOCEAN_TOKEN'] # We were given a reference to a StackConfigParser object - if 'config' in stack_config and 'digitalocean:token' in stack_config['config']: - return stack_config['config']['digitalocean:token'] + if 'config' in stack_config and 'docean:token' in stack_config['config']: + return stack_config['config']['docean:token'] # We were given a reference to a Pulumi Stack configuration - if 'digitalocean:token' in stack_config: - return stack_config['digitalocean:token'].value + if 'docean:token' in stack_config: + return stack_config['docean:token'].value # Otherwise msg = 'When using the Digital Ocean provider, an API token must be specified - ' \ - 'this token can be specified with the Pulumi config parameter digitalocean:token ' \ + 'this token can be specified with the Pulumi config parameter docean:token ' \ 'or the environment variable DIGITALOCEAN_TOKEN' raise InvalidConfigurationException(msg) diff --git a/pulumi/python/infrastructure/digitalocean/container-registry/__main__.py b/pulumi/python/infrastructure/digitalocean/container-registry/__main__.py index 20cb64bb..f326c632 100644 --- a/pulumi/python/infrastructure/digitalocean/container-registry/__main__.py +++ b/pulumi/python/infrastructure/digitalocean/container-registry/__main__.py @@ -5,7 +5,7 @@ from kic_util import external_process -config = pulumi.Config('digitalocean') +config = pulumi.Config('docean') # valid values: starter, basic, professional subscription_tier = config.get('container_registry_subscription_tier') if not subscription_tier: diff --git a/pulumi/python/infrastructure/digitalocean/dns-record/__main__.py b/pulumi/python/infrastructure/digitalocean/dns-record/__main__.py index 3b428e14..9c826190 100644 --- a/pulumi/python/infrastructure/digitalocean/dns-record/__main__.py +++ b/pulumi/python/infrastructure/digitalocean/dns-record/__main__.py @@ -28,9 +28,14 @@ def extract_ip_address(lb_ingress): config = pulumi.Config('kic-helm') fqdn = config.require('fqdn') -ingress_domain = docean.Domain.get(resource_name='ingress-domain', id=fqdn, name=fqdn) +# +# Split our hostname off the domain name to build the DNS records +# +hostname, domainname = fqdn.split('.',1) + +ingress_domain = docean.Domain.get(resource_name='ingress-domain', id=domainname, name=domainname) ingress_a_record = docean.DnsRecord(resource_name='ingress-a-record', - name='@', + name=hostname, domain=ingress_domain.id, type="A", ttl=1800, diff --git a/pulumi/python/infrastructure/digitalocean/domk8s/__main__.py b/pulumi/python/infrastructure/digitalocean/domk8s/__main__.py index f94a37f3..c82a734d 100644 --- a/pulumi/python/infrastructure/digitalocean/domk8s/__main__.py +++ b/pulumi/python/infrastructure/digitalocean/domk8s/__main__.py @@ -5,14 +5,14 @@ from kic_util import pulumi_config # Configuration details for the K8 cluster -config = pulumi.Config('digitalocean') +config = pulumi.Config('docean') instance_size = config.get('instance_size') if not instance_size: - instance_size = 's-2vcpu-4gb' + instance_size = 's-4vcpu-8gb' region = config.get('region') if not region: region = 'sfo3' -node_count = config.get('node_count') +node_count = config.get_int('node_count') if not node_count: node_count = 3 k8s_version = config.get('k8s_version') @@ -41,7 +41,7 @@ def container_registry_project_name(): node_pool=KubernetesClusterNodePoolArgs( name=pool_name, size=instance_size, - node_count=node_count, + node_count=node_count )) kubeconfig = cluster.kube_configs[0].raw_config diff --git a/pulumi/python/kubernetes/applications/sirius/__main__.py b/pulumi/python/kubernetes/applications/sirius/__main__.py index ce98d65a..88aa12e9 100644 --- a/pulumi/python/kubernetes/applications/sirius/__main__.py +++ b/pulumi/python/kubernetes/applications/sirius/__main__.py @@ -363,22 +363,11 @@ def add_namespace(obj): )], )) -# We use the kubernetes namespace for this -config = pulumi.Config('kubernetes') -infra_type = config.require('infra_type') -if infra_type == 'AWS': - application_url = sirius_host.apply(lambda host: f'https://{host}') - pulumi.export('application_url', application_url) -elif infra_type == 'kubeconfig': - pulumi.export('hostname', lb_ingress_hostname) - pulumi.export('ipaddress', lb_ingress_ip) - # pulumi.export('application_url', f'https://{lb_ingress_hostname}') - application_url = sirius_host.apply(lambda host: f'https://{host}') -elif infra_type == 'DO': - pulumi.export('hostname', lb_ingress_hostname) - pulumi.export('ipaddress', lb_ingress_ip) - # pulumi.export('application_url', f'https://{lb_ingress_hostname}') - application_url = sirius_host.apply(lambda host: f'https://{host}') +# +# Get the hostname for our connect URL +# +application_url = sirius_host.apply(lambda host: f'https://{host}') +pulumi.export('application_url', application_url) # # Get the chart values for both monitoring charts, switch back to the Sirius From f3fb05be0f2df6c4bb75f145141fd8127cc48a80 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 8 Aug 2022 12:17:30 -0400 Subject: [PATCH 14/21] fix: add repo-only IC deploy to support kubeconfig deploys --- .../ingress-controller-repo-only/Pulumi.yaml | 7 + .../ingress-controller-repo-only/__main__.py | 189 ++++++++++++++++++ 2 files changed, 196 insertions(+) create mode 100644 pulumi/python/kubernetes/nginx/ingress-controller-repo-only/Pulumi.yaml create mode 100644 pulumi/python/kubernetes/nginx/ingress-controller-repo-only/__main__.py diff --git a/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/Pulumi.yaml b/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/Pulumi.yaml new file mode 100644 index 00000000..6895e0c4 --- /dev/null +++ b/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/Pulumi.yaml @@ -0,0 +1,7 @@ +name: ingress-controller +runtime: + name: python + options: + virtualenv: ../../../venv +config: ../../../../../config/pulumi +description: Sets up NGINX Kubernetes Ingress Controller using Helm \ No newline at end of file diff --git a/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/__main__.py b/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/__main__.py new file mode 100644 index 00000000..af2e3db8 --- /dev/null +++ b/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/__main__.py @@ -0,0 +1,189 @@ +import os + +import pulumi +from pulumi import Output +import pulumi_kubernetes as k8s +from pulumi_kubernetes.core.v1 import Service +from pulumi_kubernetes.helm.v3 import Release, ReleaseArgs, RepositoryOptsArgs +from pulumi_kubernetes.yaml import ConfigFile + +from kic_util import pulumi_config + +# +# We default to the OSS IC; if the user wants Plus they need to enable it in the config file +# along with the Plus flag, and the addition of a JWT. +# +config = pulumi.Config('kic-helm') +chart_name = config.get('chart_name') +if not chart_name: + chart_name = 'nginx-ingress' +chart_version = config.get('chart_version') +if not chart_version: + chart_version = '0.13.0' +helm_repo_name = config.get('helm_repo_name') +if not helm_repo_name: + helm_repo_name = 'nginx-stable' +helm_repo_url = config.get('helm_repo_url') +if not helm_repo_url: + helm_repo_url = 'https://helm.nginx.com/stable' +nginx_repository = config.get('nginx_repository') +if not nginx_repository: + nginx_repository = "nginx/nginx-ingress" +nginx_tag = config.get('nginx_tag') +if not nginx_tag: + nginx_tag = "2.2.0" +nginx_plus_flag = config.get_bool('nginx_plus_flag') +if not nginx_plus_flag: + nginx_plus_flag = False + +# +# Allow the user to set timeout per helm chart; otherwise +# we default to 5 minutes. +# +helm_timeout = config.get_int('helm_timeout') +if not helm_timeout: + helm_timeout = 300 + +# Get the FQDN +fqdn = config.get('fqdn') + + +def project_name_from_project_dir(dirname: str): + script_dir = os.path.dirname(os.path.abspath(__file__)) + project_path = os.path.join(script_dir, '..', '..', '..', 'infrastructure', dirname) + return pulumi_config.get_pulumi_project_name(project_path) + + +def k8_manifest_location(): + script_dir = os.path.dirname(os.path.abspath(__file__)) + k8_manifest_path = os.path.join(script_dir, 'manifests', 'regcred.yaml') + return k8_manifest_path + + +k8_manifest = k8_manifest_location() + +registrycred = ConfigFile( + "regcred", + file=k8_manifest) + +chart_values = { + 'controller': { + 'nginxplus': nginx_plus_flag, + 'healthStatus': True, + 'appprotect': { + 'enable': False + }, + "image": { + "repository": nginx_repository, + "tag": nginx_tag, + "pullPolicy": "Always" + }, + "serviceAccount": { + "imagePullSecretName": "regcred" + }, + 'config': { + 'name': 'nginx-config', + 'entries': { + 'log-format': '$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent ' + '\"$http_referer\" \"$http_user_agent\" $upstream_response_time $upstream_status ' + '\"$uri\" $request_length $request_time [$proxy_host] [] $upstream_addr ' + '$upstream_bytes_sent $upstream_response_time $upstream_status $request_id ' + } + }, + 'service': { + 'annotations': { + 'co.elastic.logs/module': 'nginx' + }, + "extraLabels": { + "app": "kic-nginx-ingress" + }, + "customPorts": [ + { + "name": "dashboard", + "targetPort": 8080, + "protocol": "TCP", + "port": 8080 + }, + { + "name": "prometheus", + "targetPort": 9113, + "protocol": "TCP", + "port": 9113 + } + ] + }, + 'pod': { + 'annotations': { + 'co.elastic.logs/module': 'nginx' + } + } + }, + 'prometheus': { + 'create': True, + 'port': 9113 + } +} + +stack_name = pulumi.get_stack() +project_name = pulumi.get_project() +pulumi_user = pulumi_config.get_pulumi_user() + +kube_project_name = project_name_from_project_dir('kubeconfig') +kube_stack_ref_id = f"{pulumi_user}/{kube_project_name}/{stack_name}" +kube_stack_ref = pulumi.StackReference(kube_stack_ref_id) +kubeconfig = kube_stack_ref.require_output('kubeconfig').apply(lambda c: str(c)) + +k8s_provider = k8s.Provider(resource_name=f'ingress-controller-repo-only', + kubeconfig=kubeconfig) + +# This is required for the service monitor from the Prometheus namespace +ns = k8s.core.v1.Namespace(resource_name='nginx-ingress', + metadata={'name': 'nginx-ingress', + 'labels': { + 'prometheus': 'scrape'} + }, + opts=pulumi.ResourceOptions(provider=k8s_provider)) + +kic_release_args = ReleaseArgs( + chart=chart_name, + repository_opts=RepositoryOptsArgs( + repo=helm_repo_url + ), + version=chart_version, + namespace=ns.metadata.name, + + # Values from Chart's parameters specified hierarchically, + values=chart_values, + # User configurable timeout + timeout=helm_timeout, + # By default Release resource will wait till all created resources + # are available. Set this to true to skip waiting on resources being + # available. + skip_await=False, + # If we fail, clean up + cleanup_on_fail=True, + # Provide a name for our release + name="kic", + # Lint the chart before installing + lint=True, + # Force update if required + force_update=True) + +kic_chart = Release("kic", args=kic_release_args, opts=pulumi.ResourceOptions(depends_on=[ns])) + +pstatus = kic_chart.status + +srv = Service.get("nginx-ingress", + Output.concat("nginx-ingress", "/", pstatus.name, "-nginx-ingress")) + +ingress_service = srv.status + +# +# Some LB's give us a hostname (which is cool) and some just an IP. We need to capture +# both, and then make a determination on what the user needs to do based on what they have +# been given. +# +pulumi.export('lb_ingress_hostname', fqdn) +pulumi.export('lb_ingress_ip', pulumi.Output.unsecret(ingress_service.load_balancer.ingress[0].ip)) +# Print out our status +pulumi.export("kic_status", pstatus) From 16581f1257bc0aff6290c60bc582d48b939ee671 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 8 Aug 2022 12:18:04 -0400 Subject: [PATCH 15/21] fix: modifications to handle kubeconfig deploys for now --- .../applications/sirius/__main__.py | 65 ++++++++++++++++--- 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/pulumi/python/kubernetes/applications/sirius/__main__.py b/pulumi/python/kubernetes/applications/sirius/__main__.py index 88aa12e9..6aa69195 100644 --- a/pulumi/python/kubernetes/applications/sirius/__main__.py +++ b/pulumi/python/kubernetes/applications/sirius/__main__.py @@ -30,6 +30,15 @@ def project_name_from_kubernetes_dir(dirname: str): project_path = os.path.join(script_dir, '..', '..', dirname) return pulumi_config.get_pulumi_project_name(project_path) +# +# This is just used for the kubernetes config deploy.... +# +# TODO: Update as part of the conversion of kubeconfig to AutomationAPI #178 +# +def pulumi_repo_ingress_project_name(): + script_dir = os.path.dirname(os.path.abspath(__file__)) + ingress_project_path = os.path.join(script_dir, '..', '..', 'nginx', 'ingress-controller-repo-only') + return pulumi_config.get_pulumi_project_name(ingress_project_path) def pulumi_ingress_project_name(): script_dir = os.path.dirname(os.path.abspath(__file__)) @@ -97,14 +106,37 @@ def add_namespace(obj): k8s_provider = k8s.Provider(resource_name=f'ingress-controller', kubeconfig=kubeconfig) # -# We use the hostanme to set the value for our FQDN, which drives the cert -# process as well. +# This logic is used to manage the kubeconfig deployments, since that uses a slightly +# different logic path than the mainline. This will be removed once the kubeconfig deploys +# are moved to the Pulumi Automation API. # -ingress_project_name = pulumi_ingress_project_name() -ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" -ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) -lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') -sirius_host = lb_ingress_hostname +# TODO: Update as part of the conversion of kubeconfig to AutomationAPI #178 +# + +config = pulumi.Config('kubernetes') +infra_type = config.require('infra_type') + +if infra_type == 'kubeconfig': + # Logic to extract the FQDN of the load balancer for Ingress + ingress_project_name = pulumi_repo_ingress_project_name() + ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" + ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) + lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') + # Set back to kubernetes + config = pulumi.Config('kubernetes') + lb_ingress_ip = ingress_stack_ref.get_output('lb_ingress_ip') + sirius_host = lb_ingress_hostname +else: + # + # We use the hostname to set the value for our FQDN, which drives the cert + # process as well. + # + ingress_project_name = pulumi_ingress_project_name() + ingress_stack_ref_id = f"{pulumi_user}/{ingress_project_name}/{stack_name}" + ingress_stack_ref = pulumi.StackReference(ingress_stack_ref_id) + lb_ingress_hostname = ingress_stack_ref.get_output('lb_ingress_hostname') + sirius_host = lb_ingress_hostname + # Create the namespace for Bank of Sirius ns = k8s.core.v1.Namespace(resource_name='bos', @@ -364,10 +396,23 @@ def add_namespace(obj): )) # -# Get the hostname for our connect URL +# Get the hostname for our connect URL; this logic will be collapsed once the kubeconfig +# deployments are moved over to the automation api. Until then, we have to use a different +# process. # -application_url = sirius_host.apply(lambda host: f'https://{host}') -pulumi.export('application_url', application_url) +# TODO: Update as part of the conversion of kubeconfig to AutomationAPI #178 +# + +config = pulumi.Config('kubernetes') +infra_type = config.require('infra_type') +if infra_type == 'kubeconfig': + pulumi.export('hostname', lb_ingress_hostname) + pulumi.export('ipaddress', lb_ingress_ip) + #pulumi.export('application_url', f'https://{lb_ingress_hostname}') + application_url = sirius_host.apply(lambda host: f'https://{host}') +else: + application_url = sirius_host.apply(lambda host: f'https://{host}') + pulumi.export('application_url', application_url) # # Get the chart values for both monitoring charts, switch back to the Sirius From 0ea0a2b2630dee907a06f07949cce87f4aec4a3c Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 8 Aug 2022 12:18:33 -0400 Subject: [PATCH 16/21] fix: recommission bash scripts to support kubeconfig deploys for now --- bin/destroy.sh | 100 ++++++++++++ bin/destroy_kube.sh | 131 ++++++++++++++++ bin/start.sh | 142 +++++++++++++++++ bin/start_kube.sh | 373 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 746 insertions(+) create mode 100755 bin/destroy.sh create mode 100755 bin/destroy_kube.sh create mode 100755 bin/start.sh create mode 100755 bin/start_kube.sh diff --git a/bin/destroy.sh b/bin/destroy.sh new file mode 100755 index 00000000..06ab8447 --- /dev/null +++ b/bin/destroy.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash + +set -o errexit # abort on nonzero exit status +set -o nounset # abort on unbound variable +set -o pipefail # don't hide errors within pipes + +# Don't pollute console output with upgrade notifications +export PULUMI_SKIP_UPDATE_CHECK=true +# Run Pulumi non-interactively +export PULUMI_SKIP_CONFIRMATIONS=true +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" + +# Check to see if the venv has been installed, since this is only going to be used to start pulumi/python based +# projects. +# +if ! command -v "${script_dir}/../pulumi/python/venv/bin/python" > /dev/null ; then + echo "NOTICE! Unable to find the venv directory. This is required for the pulumi/python deployment process." + echo "Please run ./setup_venv.sh from this directory to install the required virtual environment." + echo " " + exit 1 +else + echo "Adding to [${script_dir}/venv/bin] to PATH" + export PATH="${script_dir}/../pulumi/python/venv/bin:$PATH" +fi + +if ! command -v pulumi >/dev/null; then + if [ -x "${script_dir}/../pulumi/python/venv/bin/pulumi" ]; then + echo "Adding to [${script_dir}/venv/bin] to PATH" + export PATH="${script_dir}/../pulumi/python/venv/bin:$PATH" + + if ! command -v pulumi >/dev/null; then + echo >&2 "Pulumi must be installed to continue" + exit 1 + fi + else + echo >&2 "Pulumi must be installed to continue" + exit 1 + fi +fi + +if ! command -v python3 >/dev/null; then + echo >&2 "Python 3 must be installed to continue" + exit 1 +fi + +# Check to see if the user is logged into Pulumi +if ! pulumi whoami --non-interactive >/dev/null 2>&1; then + pulumi login + + if ! pulumi whoami --non-interactive >/dev/null 2>&1; then + echo >&2 "Unable to login to Pulumi - exiting" + exit 2 + fi +fi + +echo " " +echo "Notice! This shell script will only destroy kubeconfig based deployments; if you have deployed to AWS, " +echo "DigitalOcean, or Linode you will need to use the ./pulumi/python/runner script instead." +echo " " + +# Sleep so we are seen... +sleep 5 + +source "${script_dir}/../config/pulumi/environment" +echo "Configuring all Pulumi projects to use the stack: ${PULUMI_STACK}" + +# +# Determine what destroy script we need to run +# +if pulumi config get kubernetes:infra_type -C ${script_dir}/../pulumi/python/config>/dev/null 2>&1; then + INFRA="$(pulumi config get kubernetes:infra_type -C ${script_dir}/../pulumi/python/config)" + if [ $INFRA == 'AWS' ]; then + echo "This script no longer works with AWS deployments; please use ./pulumi/python/runner instead" + exec ${script_dir}/../pulumi/python/runner + exit 0 + elif [ $INFRA == 'kubeconfig' ]; then + echo "Destroying a kubeconfig based stack; if this is not right please type ctrl-c to abort this script." + sleep 5 + ${script_dir}/destroy_kube.sh + exit 0 + elif [ $INFRA == 'DO' ]; then + echo "This script no longer works with DigitalOcean deployments; please use ./pulumi/python/runner instead" + exec ${script_dir}/../pulumi/python/runner + sleep 5 + ${script_dir}/destroy_do.sh + exit 0 + elif [ $INFRA == 'LKE' ]; then + echo "This script no longer works with Linode deployments; please use ./pulumi/python/runner instead" + exec ${script_dir}/../pulumi/python/runner + sleep 5 + ${script_dir}/destroy_lke.sh + exit 0 + else + print "No infrastructure set in config file; aborting!" + exit 1 + fi +else + print "No infrastructure set in config file; aborting!" + exit 2 +fi diff --git a/bin/destroy_kube.sh b/bin/destroy_kube.sh new file mode 100755 index 00000000..8bb4013d --- /dev/null +++ b/bin/destroy_kube.sh @@ -0,0 +1,131 @@ +#!/usr/bin/env bash + +set -o errexit # abort on nonzero exit status +set -o nounset # abort on unbound variable +set -o pipefail # don't hide errors within pipes + +# Don't pollute console output with upgrade notifications +export PULUMI_SKIP_UPDATE_CHECK=true +# Run Pulumi non-interactively +export PULUMI_SKIP_CONFIRMATIONS=true + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)" + +if ! command -v pulumi > /dev/null; then + if [ -x "${script_dir}/venv/bin/pulumi" ]; then + echo "Adding to [${script_dir}/venv/bin] to PATH" + export PATH="${script_dir}/venv/bin:$PATH" + + if ! command -v pulumi > /dev/null; then + echo >&2 "Pulumi must be installed to continue" + exit 1 + fi + else + echo >&2 "Pulumi must be installed to continue" + exit 1 + fi +fi + +if ! command -v python3 > /dev/null; then + echo >&2 "Python 3 must be installed to continue" + exit 1 +fi + +if ! command -v node > /dev/null; then + if [ -x "${script_dir}/venv/bin/pulumi" ]; then + echo "Adding to [${script_dir}/venv/bin] to PATH" + export PATH="${script_dir}/venv/bin:$PATH" + + if ! command -v node > /dev/null; then + echo >&2 "NodeJS must be installed to continue" + exit 1 + fi + else + echo >&2 "NodeJS must be installed to continue" + exit 1 + fi +fi + +# Check to see if the user is logged into Pulumi +if ! pulumi whoami --non-interactive > /dev/null 2>&1; then + pulumi login + + if ! pulumi whoami --non-interactive > /dev/null 2>&1; then + echo >&2 "Unable to login to Pulumi - exiting" + exit 2 + fi +fi + +source "${script_dir}/../config/pulumi/environment" +echo "Configuring all Pulumi projects to use the stack: ${PULUMI_STACK}" + + +APPLICATIONS=(sirius) +KUBERNETES=(secrets observability logagent logstore certmgr prometheus) +NGINX=(kubernetes/nginx/ingress-controller-repo-only) +INFRA=(kubeconfig digitalocean/domk8s) + +# +# This is a temporary process until we complete the directory reorg and move the start/stop +# process into more solid code. +# + +# Destroy the application(s) +for project_dir in "${APPLICATIONS[@]}" ; do + echo "$project_dir" + if [ -f "${script_dir}/../pulumi/python/kubernetes/applications/${project_dir}/Pulumi.yaml" ]; then + pulumi_args="--cwd ${script_dir}/../pulumi/python/kubernetes/applications/${project_dir} --emoji --stack ${PULUMI_STACK}" + pulumi ${pulumi_args} destroy + else + >&2 echo "Not destroying - Pulumi.yaml not found in directory: ${script_dir}/../pulumi/python/kubernetes/applications/${project_dir}" + fi +done + +# Destroy other K8 resources +for project_dir in "${KUBERNETES[@]}" ; do + echo "$project_dir" + if [ -f "${script_dir}/../pulumi/python/kubernetes/${project_dir}/Pulumi.yaml" ]; then + pulumi_args="--cwd ${script_dir}/../pulumi/python/kubernetes/${project_dir} --emoji --stack ${PULUMI_STACK}" + pulumi ${pulumi_args} destroy + else + >&2 echo "Not destroying - Pulumi.yaml not found in directory: ${script_dir}/../pulumi/python/kubernetes/${project_dir}" + fi +done + +# TODO: figure out a more elegant way to do the CRD removal for prometheus #83 +# This is a hack for now to remove the CRD's for prometheus-kube-stack +# See https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/README.md#uninstall-chart +kubectl delete crd alertmanagerconfigs.monitoring.coreos.com > /dev/null 2>&1 +kubectl delete crd alertmanagers.monitoring.coreos.com > /dev/null 2>&1 +kubectl delete crd podmonitors.monitoring.coreos.com > /dev/null 2>&1 +kubectl delete crd probes.monitoring.coreos.com > /dev/null 2>&1 +kubectl delete crd prometheuses.monitoring.coreos.com > /dev/null 2>&1 +kubectl delete crd prometheusrules.monitoring.coreos.com > /dev/null 2>&1 +kubectl delete crd servicemonitors.monitoring.coreos.com > /dev/null 2>&1 +kubectl delete crd thanosrulers.monitoring.coreos.com > /dev/null 2>&1 + +# Destroy NGINX components +for project_dir in "${NGINX[@]}" ; do + echo "$project_dir" + if [ -f "${script_dir}/../pulumi/python/${project_dir}/Pulumi.yaml" ]; then + pulumi_args="--cwd ${script_dir}/../pulumi/python/${project_dir} --emoji --stack ${PULUMI_STACK}" + pulumi ${pulumi_args} destroy + else + >&2 echo "Not destroying - Pulumi.yaml not found in directory: ${script_dir}/../pulumi/python/${project_dir}" + fi +done + +# Clean up the kubeconfig project +for project_dir in "${INFRA[@]}" ; do + echo "$project_dir" + if [ -f "${script_dir}/../pulumi/python/infrastructure/${project_dir}/Pulumi.yaml" ]; then + pulumi_args="--cwd ${script_dir}/../pulumi/python/infrastructure/${project_dir} --emoji --stack ${PULUMI_STACK}" + pulumi ${pulumi_args} destroy + else + >&2 echo "Not destroying - Pulumi.yaml not found in directory: ${script_dir}/../pulumi/python/infrastructure/${project_dir}" + fi +done + + + + diff --git a/bin/start.sh b/bin/start.sh new file mode 100755 index 00000000..8e85bfc3 --- /dev/null +++ b/bin/start.sh @@ -0,0 +1,142 @@ +#!/usr/bin/env bash + +set -o errexit # abort on nonzero exit status +set -o nounset # abort on unbound variable +set -o pipefail # don't hide errors within pipes + +# Don't pollute console output with upgrade notifications +export PULUMI_SKIP_UPDATE_CHECK=true +# Run Pulumi non-interactively +export PULUMI_SKIP_CONFIRMATIONS=true + +# Unset virtual environment if defined.... +unset VIRTUAL_ENV + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" + +# Check to see if the venv has been installed, since this is only going to be used to start pulumi/python based +# projects. +# +if ! command -v "${script_dir}/../pulumi/python/venv/bin/python" >/dev/null; then + echo "NOTICE! Unable to find the venv directory. This is required for the pulumi/python deployment process." + echo "Please run ./setup_venv.sh from this directory to install the required virtual environment." + echo " " + exit 1 +else + echo "Adding to [${script_dir}/venv/bin] to PATH" + export PATH="${script_dir}/../pulumi/python/venv/bin:$PATH" +fi + +if ! command -v pulumi >/dev/null; then + if [ -x "${script_dir}/../pulumi/python/venv/bin/pulumi" ]; then + echo "Adding to [${script_dir}/venv/bin] to PATH" + export PATH="${script_dir}/../pulumi/python/venv/bin:$PATH" + if ! command -v pulumi >/dev/null; then + echo >&2 "Pulumi must be installed to continue" + exit 1 + fi + else + echo >&2 "Pulumi must be installed to continue" + exit 1 + fi +fi + +if ! command -v python3 >/dev/null; then + echo >&2 "Python 3 must be installed to continue" + exit 1 +fi + +# Check to see if the user is logged into Pulumi +if ! pulumi whoami --non-interactive >/dev/null 2>&1; then + pulumi login + + if ! pulumi whoami --non-interactive >/dev/null 2>&1; then + echo >&2 "Unable to login to Pulumi - exiting" + exit 2 + fi +fi + +echo " " +echo "NOTICE! This shell script is maintained for compatibility for the kubeconfig only deployment and will be" +echo "deprecated once the kubeconfig deployments are fully integrated with the automation api." +echo " " +echo "If you are deploying AWS, DigitalOcean, or Linode based stacks you will need to use the runner script." +echo " " +echo "Please read the documentation for more details." +echo " " +# Sleep so we are seen... +sleep 5 + +if [ -s "${script_dir}/../config/pulumi/environment" ] && grep --quiet '^PULUMI_STACK=.*' "${script_dir}/../config/pulumi/environment"; then + source "${script_dir}/../config/pulumi/environment" + echo "Environment data found for stack: ${PULUMI_STACK}" + while true; do + read -r -e -p "Environment file exists and is not empty. Answer yes to use, no to delete. " yn + case $yn in + [Yy]*) # We have an environment file and they want to keep it.... + if pulumi config get kubernetes:infra_type -C ${script_dir}/../pulumi/python/config >/dev/null 2>&1; then + INFRA="$(pulumi config get kubernetes:infra_type -C ${script_dir}/../pulumi/python/config)" + if [ $INFRA == 'AWS' ]; then + echo "This script no longer works with AWS deployments; please use ./pulumi/python/runner instead" + exec ${script_dir}/../pulumi/python/runner + exit 0 + elif [ $INFRA == 'kubeconfig' ]; then + exec ${script_dir}/start_kube.sh + exit 0 + elif [ $INFRA == 'DO' ]; then + echo "This script no longer works with DigitalOcean deployments; please use ./pulumi/python/runner instead" + exec ${script_dir}/../pulumi/python/runner + exit 0 + elif [ $INFRA == 'LKE' ]; then + echo "This script no longer works with Linode deployments; please use ./pulumi/python/runner instead" + exec ${script_dir}/../pulumi/python/runner + exit 0 + else + echo "Corrupt or non-existent configuration file, please restart and delete and reconfigure." + exit 1 + fi + else + echo "Corrupt or non-existent configuration file, please restart and delete and reconfigure." + exit 1 + fi + break + ;; + [Nn]*) # They want to remove and reconfigure + rm -f ${script_dir}/../config/pulumi/environment + break + ;; + *) echo "Please answer yes or no." ;; + esac + done +fi + +while true; do + read -e -r -p "Type a for AWS, d for Digital Ocean, k for kubeconfig, l for Linode? " infra + case $infra in + [Aa]*) + echo "This script no longer works with AWS deployments; please use ./pulumi/python/runner instead" + exec ${script_dir}/../pulumi/python/runner + exit 0 + break + ;; + [Kk]*) + echo "Calling kubeconfig startup script" + exec ${script_dir}/start_kube.sh + exit 0 + break + ;; + [Dd]*) + echo "This script no longer works with DigitalOcean deployments; please use ./pulumi/python/runner instead" + exec ${script_dir}/../pulumi/python/runner + exit 0 + break + ;; + [Ll]*) + echo "This script no longer works with Linode deployments; please use ./pulumi/python/runner instead" + exec ${script_dir}/../pulumi/python/runner + exit 0 + break + ;; + *) echo "Please answer a, d, k, or l." ;; + esac +done diff --git a/bin/start_kube.sh b/bin/start_kube.sh new file mode 100755 index 00000000..1a781e35 --- /dev/null +++ b/bin/start_kube.sh @@ -0,0 +1,373 @@ +#!/usr/bin/env bash + +set -o errexit # abort on nonzero exit status +set -o nounset # abort on unbound variable +set -o pipefail # don't hide errors within pipes + +# Don't pollute console output with upgrade notifications +export PULUMI_SKIP_UPDATE_CHECK=true +# Run Pulumi non-interactively +export PULUMI_SKIP_CONFIRMATIONS=true + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" + +if ! command -v pulumi >/dev/null; then + if [ -x "${script_dir}/../pulumi/python/venv/bin/pulumi" ]; then + echo "Adding to [${script_dir}/../pulumi/python/venv/bin] to PATH" + export PATH="${script_dir}/../pulumi/python/venv/bin:$PATH" + + if ! command -v pulumi >/dev/null; then + echo >&2 "Pulumi must be installed to continue" + exit 1 + fi + else + echo >&2 "Pulumi must be installed to continue" + exit 1 + fi +fi + +if ! command -v python3 >/dev/null; then + echo >&2 "Python 3 must be installed to continue" + exit 1 +fi + +if ! command -v node >/dev/null; then + if [ -x "${script_dir}/../pulumi/python/venv/bin/pulumi" ]; then + echo "Adding to [${script_dir}/../pulumi/python/venv/bin] to PATH" + export PATH="${script_dir}/../pulumi/python/venv/bin:$PATH" + + if ! command -v node >/dev/null; then + echo >&2 "NodeJS must be installed to continue" + exit 1 + fi + else + echo >&2 "NodeJS must be installed to continue" + exit 1 + fi +fi + +if ! command -v git >/dev/null; then + echo >&2 "git must be installed to continue" + exit 1 +fi + +if ! command -v make >/dev/null; then + echo >&2 "make is not installed - it must be installed if you intend to build NGINX Kubernetes Ingress Controller from source." +fi + +if ! command -v docker >/dev/null; then + echo >&2 "docker is not installed - it must be installed if you intend to build NGINX Kubernetes Ingress Controller from source." +fi + +# Check to see if the user is logged into Pulumi +if ! pulumi whoami --non-interactive >/dev/null 2>&1; then + pulumi login + + if ! pulumi whoami --non-interactive >/dev/null 2>&1; then + echo >&2 "Unable to login to Pulumi - exiting" + exit 2 + fi +fi + +if [ ! -f "${script_dir}/../config/pulumi/environment" ]; then + touch "${script_dir}/../config/pulumi/environment" +fi + +if ! grep --quiet '^PULUMI_STACK=.*' "${script_dir}/../config/pulumi/environment"; then + read -r -e -p "Enter the name of the Pulumi stack to use in all projects: " PULUMI_STACK + echo "PULUMI_STACK=${PULUMI_STACK}" >>"${script_dir}/../config/pulumi/environment" +fi + +# Do we have the submodule source.... +# +# Note: We had been checking for .git, but this is not guaranteed to be +# there if we build the docker image or use a tarball. So now we look +# for the src subdirectory which should always be there. +# +if [[ -d "${script_dir}/../pulumi/python/kubernetes/applications/sirius/src/src" ]]; then + echo "Submodule source found" +else + # Error out with instructions. + echo "Bank of Sirius submodule not found" + echo " " + echo "Please run:" + echo " git submodule update --init --recursive --remote" + echo "Inside your git directory and re-run this script" + echo "" + echo >&2 "Unable to find submodule - exiting" + exit 3 +fi + +source "${script_dir}/../config/pulumi/environment" +echo "Configuring all Pulumi projects to use the stack: ${PULUMI_STACK}" + +# Create the stack if it does not already exist +# Do not change the tools directory of add-ons. +find "${script_dir}/../pulumi" -mindepth 2 -maxdepth 6 -type f -name Pulumi.yaml -not -path "*/tools/*" -execdir pulumi stack select --create "${PULUMI_STACK}" \; + +# Show colorful fun headers if the right utils are installed and NO_COLOR is not set +# +function header() { + if [ -z ${NO_COLOR+x} ]; then + "${script_dir}"/../pulumi/python/venv/bin/fart --no_copy -f standard "$1" | "${script_dir}"/../pulumi/python/venv/bin/lolcat + else + "${script_dir}"/../pulumi/python/venv/bin/fart --no_copy -f standard "$1" + fi +} + +function retry() { + local -r -i max_attempts="$1" + shift + local -i attempt_num=1 + until "$@"; do + if ((attempt_num == max_attempts)); then + echo "Attempt ${attempt_num} failed and there are no more attempts left!" + return 1 + else + echo "Attempt ${attempt_num} failed! Trying again in $attempt_num seconds..." + sleep $((attempt_num++)) + fi + done +} + +function createpw() { + PWORD=$(dd if=/dev/urandom count=1 2>/dev/null | base64 | head -c16) + echo $PWORD +} + +# +# This deploy only works with the NGINX registries. +# +echo " " +echo "NOTICE! Currently the deployment via kubeconfig only supports pulling images from the registry! A JWT is " +echo "required in order to access the NGINX Plus repository. This should be placed in a file in the extras directory" +echo "in the project root, in a file named jwt.token" +echo " " +echo "See https://docs.nginx.com/nginx-ingress-controller/installation/using-the-jwt-token-docker-secret/ for more " +echo "details and examples." +echo " " + +# Make sure we see it +sleep 5 + +# +# TODO: Integrate this into the mainline along with logic to work with/without #80 +# +# This logic takes the JWT and transforms it into a secret so we can pull the NGINX Plus IC. If the user is not +# deploying plus (and does not have a JWT) we create a placeholder credential that is used to create a secert. That +# secret is not a valid secret, but it is created to make the logic easier to read/code. +# +if [[ -s "${script_dir}/../extras/jwt.token" ]]; then + JWT=$(cat ${script_dir}/../extras/jwt.token) + echo "Loading JWT into nginx-ingress/regcred" + ${script_dir}/../pulumi/python/venv/bin/kubectl create secret docker-registry regcred --docker-server=private-registry.nginx.com --docker-username=${JWT} --docker-password=none -n nginx-ingress --dry-run=client -o yaml >${script_dir}/../pulumi/python/kubernetes/nginx/ingress-controller-repo-only/manifests/regcred.yaml +else + # TODO: need to adjust so we can deploy from an unauthenticated registry (IC OSS) #81 + echo "No JWT found; writing placeholder manifest" + ${script_dir}/../pulumi/python/venv/bin/kubectl create secret docker-registry regcred --docker-server=private-registry.nginx.com --docker-username=placeholder --docker-password=placeholder -n nginx-ingress --dry-run=client -o yaml >${script_dir}/../pulumi/python/kubernetes/nginx/ingress-controller-repo-only/manifests/regcred.yaml +fi + +# Check for stack info.... +# TODO: Move these to use kubeconfig for the Pulumi main config (which redirects up) instead of aws/vpc #80 +# + +# We automatically set this to a kubeconfig type for infra type +# TODO: combined file should query and manage this #80 +pulumi config set kubernetes:infra_type -C ${script_dir}/../pulumi/python/config kubeconfig +# Bit of a gotcha; we need to know what infra type we have when deploying our application (BoS) due to the +# way we determine the load balancer FQDN or IP. We can't read the normal config since Sirius uses it's own +# configuration because of the encryption needed for the passwords. +pulumi config set kubernetes:infra_type -C ${script_dir}/../pulumi/python/kubernetes/applications/sirius kubeconfig + +# Inform the user of what we are doing + +echo " " +echo "NOTICE! When using a kubeconfig file you need to ensure that your environment is configured to" +echo "connect to Kubernetes properly. If you have multiple kubernetes contexts (or custom contexts)" +echo "you may need to remove them and replace them with a simple ~/.kube/config file. This will be " +echo "addressed in a future release." +echo " " + +# Sleep so that this is seen... +sleep 5 + +if pulumi config get kubernetes:kubeconfig -C ${script_dir}/../pulumi/python/config >/dev/null 2>&1; then + echo "Kubeconfig file found" +else + echo "Provide an absolute path to your kubeconfig file" + pulumi config set kubernetes:kubeconfig -C ${script_dir}/../pulumi/python/config +fi + +# Clustername +if pulumi config get kubernetes:cluster_name -C ${script_dir}/../pulumi/python/config >/dev/null 2>&1; then + echo "Clustername found" +else + echo "Provide your clustername" + pulumi config set kubernetes:cluster_name -C ${script_dir}/../pulumi/python/config +fi + +# Connect to the cluster +if command -v kubectl >/dev/null; then + echo "Attempting to connect to kubernetes cluster" + retry 30 kubectl version >/dev/null +fi + +# TODO: Figure out better way to handle hostname / ip address for exposing our IC #82 +# +# This version of the code forces you to add a hostname which is used to generate the cert when the application is +# deployed, and will output the IP address and the hostname that will need to be set in order to use the self-signed +# cert and to access the application. +# +if pulumi config get kic-helm:fqdn -C ${script_dir}/../pulumi/python/config >/dev/null 2>&1; then + echo "Hostname found for deployment" +else + echo "Create a fqdn for your deployment" + pulumi config set kic-helm:fqdn -C ${script_dir}/../pulumi/python/config +fi + +# The bank of sirius configuration file is stored in the ./sirius/config +# directory. This is because we cannot pull secrets from different project +# directories. +# +# This work-around is expected to be obsoleted by the work described in +# https://github.com/pulumi/pulumi/issues/4604, specifically around issue +# https://github.com/pulumi/pulumi/issues/2307 +# +# Check for secrets being set +# +echo "Checking for required secrets" +if pulumi config get prometheus:adminpass -C ${script_dir}/../pulumi/python/kubernetes/secrets >/dev/null 2>&1; then + echo "Configuration value found" +else + echo "Please enter a password for grafana" + pulumi config set prometheus:adminpass --secret -C pulumi/python/kubernetes/secrets +fi + +if pulumi config get sirius:accounts_pwd -C ${script_dir}/../pulumi/python/kubernetes/secrets >/dev/null 2>&1; then + echo "Configuration value found" +else + echo "Please enter a password for the sirius accountsdb" + pulumi config set sirius:accounts_pwd --secret -C pulumi/python/kubernetes/secrets +fi + +if pulumi config get sirius:demo_login_pwd -C ${script_dir}/../pulumi/python/kubernetes/secrets >/dev/null 2>&1; then + echo "Configuration value found" +else + echo "Please enter a password for the sirius ledgerdb" + pulumi config set sirius:demo_login_pwd --secret -C pulumi/python/kubernetes/secrets +fi + +if pulumi config get sirius:demo_login_user -C ${script_dir}/../pulumi/python/kubernetes/secrets >/dev/null 2>&1; then + echo "Configuration value found" +else + echo "Please enter a username for the BoS" + pulumi config set sirius:demo_login_user --secret -C pulumi/python/kubernetes/secrets +fi + +if pulumi config get sirius:ledger_pwd -C ${script_dir}/../pulumi/python/kubernetes/secrets >/dev/null 2>&1; then + echo "Configuration value found" +else + echo "Please enter a password for the BoS user account" + pulumi config set sirius:ledger_pwd --secret -C pulumi/python/kubernetes/secrets +fi + +# +# TODO: Allow startup scripts to prompt and accept additional config values #97 +# The default helm timeout for all of the projects is set at the default of 300 seconds (5 minutes) +# However, since this code path is most commonly going to be used to deploy locally we need to bump +# that value up. A fix down the road will add this a prompt, but for now we are going to double this +# value for all helm deploys. +# + +pulumi config set kic-helm:helm_timeout 600 -C ${script_dir}/../pulumi/python/config +pulumi config set logagent:helm_timeout 600 -C ${script_dir}/../pulumi/python/config +pulumi config set logstore:helm_timeout 600 -C ${script_dir}/../pulumi/python/config +pulumi config set certmgr:helm_timeout 600 -C ${script_dir}/../pulumi/python/config +pulumi config set prometheus:helm_timeout 600 -C ${script_dir}/../pulumi/python/config + +# +# Set the headers to respect the NO_COLOR variable +# +if [ -z ${NO_COLOR+x} ]; then + pulumi_args="--emoji --stack ${PULUMI_STACK}" +else + pulumi_args="--color never --stack ${PULUMI_STACK}" +fi + +# +# Note that this is somewhat different than the other startup scripts, because at the point we run this +# here we know that we have a server so we can get the version. The other builds do not have server info +# at this point in time. +# +header "Version Info" +echo "Version and Account Information" +echo "=====================================================================" +echo "Pulumi version is: $(pulumi version)" +echo "Pulumi user is: $(pulumi whoami)" +echo "Python version is: $(python --version)" +echo "Kubectl version information: " +echo "$(kubectl version -o json)" +echo "Python module information: " +echo "$(pip list)" +echo "=====================================================================" +echo " " + +header "Kubeconfig" +cd "${script_dir}/../pulumi/python/infrastructure/kubeconfig" +pulumi $pulumi_args up + +header "Secrets" +cd "${script_dir}/../pulumi/python/kubernetes/secrets" +pulumi $pulumi_args up + +# TODO: This is using a different project than the AWS deploy; we need to collapse those #80 +header "Deploying IC" +cd "${script_dir}/../pulumi/python/kubernetes/nginx/ingress-controller-repo-only" +pulumi $pulumi_args up + +header "Logstore" +cd "${script_dir}/../pulumi/python/kubernetes/logstore" +pulumi $pulumi_args up + +header "Logagent" +cd "${script_dir}/../pulumi/python/kubernetes/logagent" +pulumi $pulumi_args up + +header "Cert Manager" +cd "${script_dir}/../pulumi/python/kubernetes/certmgr" +pulumi $pulumi_args up + +header "Prometheus" +cd "${script_dir}/../pulumi/python/kubernetes/prometheus" +pulumi $pulumi_args up + +header "Observability" +cd "${script_dir}/../pulumi/python/kubernetes/observability" +pulumi $pulumi_args up + +header "Bank of Sirius" +cd "${script_dir}/../pulumi/python/kubernetes/applications/sirius" +pulumi $pulumi_args up + +header "Finished!!" +THE_FQDN=$(pulumi config get kic-helm:fqdn -C ${script_dir}/../pulumi/python/config || echo "Cannot Retrieve") +THE_IP=$(kubectl get service kic-nginx-ingress --namespace nginx-ingress --output=jsonpath='{.status.loadBalancer.ingress[*].ip}' || echo "Cannot Retrieve") + +echo " " +echo "The startup process has finished successfully" +echo " " +echo " " +echo "Next Steps:" +echo " " +echo "1. Map the IP address ($THE_IP) of your Ingress Controller with your FQDN ($THE_FQDN)." +echo "2. Use the ./bin/test-forward.sh program to establish tunnels you can use to connect to the management tools." +echo "3. Use kubectl, k9s, or the Kubernetes dashboard to explore your deployment." +echo " " +echo "To review your configuration options, including the passwords defined, you can access the pulumi secrets via the" +echo "following commands:" +echo " " +echo "Main Configuration: pulumi config -C ${script_dir}/../pulumi/python/config" +echo "Bank of Sirius (Example Application) Configuration: pulumi config -C ${script_dir}/../pulumi/python/kubernetes/applications/sirius" +echo "K8 Loadbalancer IP: kubectl get services --namespace nginx-ingress" +echo " " +echo "Please see the documentation in the github repository for more information" From 887ef22ef0aae46ddc1aeab4a9eebacc4870d327 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 8 Aug 2022 17:09:23 -0400 Subject: [PATCH 17/21] fix: gitkeep needed for manifests dir under repo nginx --- .../nginx/ingress-controller-repo-only/manifests/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pulumi/python/kubernetes/nginx/ingress-controller-repo-only/manifests/.gitkeep diff --git a/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/manifests/.gitkeep b/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/manifests/.gitkeep new file mode 100644 index 00000000..e69de29b From 1a1dfde7ba6e64a90a041f86d5d4249697030a11 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 8 Aug 2022 17:44:42 -0400 Subject: [PATCH 18/21] chore: update jenkinsfiles for automation api --- extras/jenkins/AWS/Jenkinsfile | 38 ++++++++------ extras/jenkins/DigitalOcean/Jenkinsfile | 40 +++++++-------- extras/jenkins/K3S/Jenkinsfile | 67 +++++++++++-------------- extras/jenkins/Linode/Jenkinsfile | 41 ++++++++------- extras/jenkins/MicroK8s/Jenkinsfile | 27 +++++----- extras/jenkins/Minikube/Jenkinsfile | 52 +++++++++---------- 6 files changed, 132 insertions(+), 133 deletions(-) diff --git a/extras/jenkins/AWS/Jenkinsfile b/extras/jenkins/AWS/Jenkinsfile index 7df39acf..c5732878 100644 --- a/extras/jenkins/AWS/Jenkinsfile +++ b/extras/jenkins/AWS/Jenkinsfile @@ -29,9 +29,10 @@ pipeline { AWS_ACCESS_KEY_ID = credentials('AWS_ACCESS_KEY_ID') AWS_SECRET_ACCESS_KEY = credentials('AWS_SECRET_ACCESS_KEY') AWS_SESSION_TOKEN = credentials('AWS_SESSION_TOKEN') - NGINX_JWT = credentials('NGINX_JWT') NO_COLOR = "TRUE" PULUMI_ACCESS_TOKEN = credentials('PULUMI_ACCESS_TOKEN') + MARA_PASSWORD = credentials('MARA_PASSWORD') + } @@ -86,15 +87,11 @@ pipeline { steps { /* - * Run a find and check for any stacks that currently exist with our generated stack name; this should not - * happen in normal operation, but could potentially happen if things break so better safe than sorry. - * * Other cleanup related functions can be placed here as well. */ sh ''' - # Clean up the Pulumi stack if it exists for our run - which it shouldn\'t, but you never know. - find $WORKSPACE -mindepth 2 -maxdepth 7 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenkaws${BUILD_NUMBER} --force --yes \\; + true ''' } } @@ -145,17 +142,28 @@ pipeline { echo "AWS_PROFILE=${AWS_PROFILE}" >> $WORKSPACE/config/pulumi/environment $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkaws${BUILD_NUMBER} -C pulumi/python/config $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkaws${BUILD_NUMBER} -C pulumi/python/kubernetes/applications/sirius + $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkaws${BUILD_NUMBER} -C pulumi/python/kubernetes/secrets $WORKSPACE/pulumi/python/venv/bin/pulumi config set certmgr:helm_timeout "600" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "marajenks${BUILD_NUMBER}.zathras.io" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:helm_timeout "600" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "AWS" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "aws" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:cluster_name "marajenkaws${BUILD_NUMBER}" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set logagent:helm_timeout "600" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set logstore:helm_timeout "600" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "password" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:helm_timeout "600" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:accounts_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_pwd "password" --secret -C pulumi/python/kubernetes/secrets -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_user "testuser" --secret -C pulumi/python/kubernetes/secrets -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:ledger_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkaws${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set aws:profile "${AWS_PROFILE}" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set aws:region "${AWS_DEFAULT_REGION}" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set eks:k8s_version "1.22" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set eks:instance_type "t2.large" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set eks:min_size "3" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set eks:max_size "12" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set eks:desired_capacity "3" -C pulumi/python/config -s marajenkaws${BUILD_NUMBER} ''' } } @@ -164,13 +172,11 @@ pipeline { steps { /* - * This step echoes the JWT into the correct file for the startup to find it and then calls the script to build - * the credentials file if we have environment variables set. Finally, it moves the JWT into the correct location. + * */ sh ''' - echo "${NGINX_JWT}" > $WORKSPACE/extras/jwt.token - $WORKSPACE/bin/start_aws.sh + $WORKSPACE/pulumi/python/runner -p aws up ''' } } @@ -182,12 +188,16 @@ pipeline { * Clean up the environment; this includes running the destroy script to remove our pulumi resources and * destroy the deployed infrastructure in AWS * + * AWS will not remove a registry that contains images, so we do a force removal here; this should ultimately + * be fixed in the code. + * * After that completes, we remove the pulumi stack from the project with the find command; this is because * we need to delete the stack in each project it's been instantiated in. */ sh ''' - $WORKSPACE/bin/destroy.sh + $WORKSPACE/pulumi/python/venv/bin/aws ecr delete-repository --repository-name ingress-controller-marajenkaws${BUILD_NUMBER} --force + $WORKSPACE/pulumi/python/runner -p aws destroy find . -mindepth 2 -maxdepth 6 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenkaws${BUILD_NUMBER} --force --yes \\; ''' } @@ -205,7 +215,7 @@ pipeline { sh ''' # Destroy our partial build... - $WORKSPACE/bin/destroy.sh || true + $WORKSPACE/pulumi/python/runner -p aws destroy || true find $WORKSPACE -mindepth 2 -maxdepth 7 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenkaws${BUILD_NUMBER} --force --yes \\; ''' } diff --git a/extras/jenkins/DigitalOcean/Jenkinsfile b/extras/jenkins/DigitalOcean/Jenkinsfile index 4fa5a8fe..29d9093f 100644 --- a/extras/jenkins/DigitalOcean/Jenkinsfile +++ b/extras/jenkins/DigitalOcean/Jenkinsfile @@ -21,8 +21,8 @@ pipeline { environment { DIGITALOCEAN_TOKEN = credentials('DIGITALOCEAN_TOKEN') - NGINX_JWT = credentials('NGINX_JWT') PULUMI_ACCESS_TOKEN = credentials('PULUMI_ACCESS_TOKEN') + MARA_PASSWORD = credentials('MARA_PASSWORD') NO_COLOR = "TRUE" DEBIAN_FRONTEND = "noninteractive" } @@ -84,15 +84,11 @@ pipeline { steps { /* - * Run a find and check for any stacks that currently exist with our generated stack name; this should not - * happen in normal operation, but could potentially happen if things break so better safe than sorry. - * * Other cleanup related functions can be placed here as well. */ sh ''' - # Clean up the Pulumi stack if it exists for our run - which it shouldn\'t, but you never know. - find $WORKSPACE -mindepth 2 -maxdepth 7 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenkdo${BUILD_NUMBER} --force --yes \\; + true ''' } @@ -128,18 +124,26 @@ pipeline { echo "PULUMI_STACK=marajenkdo${BUILD_NUMBER}" > $WORKSPACE/config/pulumi/environment echo "DO_TOKEN=${DO_TOKEN}" >> $WORKSPACE/config/pulumi/environment $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkdo${BUILD_NUMBER} -C pulumi/python/config - $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkdo${BUILD_NUMBER} -C pulumi/python/kubernetes/applications/sirius + $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkdo${BUILD_NUMBER} -C pulumi/python/kubernetes/secrets $WORKSPACE/pulumi/python/venv/bin/pulumi config set certmgr:helm_timeout "600" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "marajenks${BUILD_NUMBER}.zathras.io" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:helm_timeout "600" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "DO" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set logagent:helm_timeout "601" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set logagent:helm_timeout "600" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set logstore:helm_timeout "600" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "password" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:helm_timeout "600" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set digitalocean:token "${DO_TOKEN}" --plaintext -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set domk8s:k8s_version "latest" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set docean:instance_size "s-4vcpu-8gb" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set docean:k8s_version "latest" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set docean:node_count "3" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set docean:region "sfo3" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "mara${BUILD_NUMBER}.docean.mantawang.com" -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set docean:token "${DO_TOKEN}" --plaintext -C pulumi/python/config -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:accounts_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_pwd "password" --secret -C pulumi/python/kubernetes/secrets -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_user "testuser" --secret -C pulumi/python/kubernetes/secrets -s marajenkdo${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:ledger_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkdo${BUILD_NUMBER} + ''' } @@ -148,14 +152,8 @@ pipeline { stage('Deploying Pulumi') { steps { - /* - * This step echoes the JWT into the correct file for the startup to find it and then calls the script to build - * the MARA deployment in Digital Ocean. - */ - sh ''' - echo $NGINX_JWT > $WORKSPACE/extras/jwt.token - $WORKSPACE/bin/start_do.sh + $WORKSPACE/pulumi/python/runner -p do up ''' } } @@ -172,7 +170,7 @@ pipeline { */ sh ''' - PATH=$WORKSPACE/pulumi/python/venv/bin:$PATH $WORKSPACE/bin/destroy.sh + $WORKSPACE/pulumi/python/runner -p do destroy find . -mindepth 2 -maxdepth 6 -type f -name Pulumi.yaml -execdir pulumi stack rm marajenkdo${BUILD_NUMBER} --force --yes \\; ''' } @@ -189,7 +187,7 @@ pipeline { sh ''' # Destroy our partial build... - $WORKSPACE/bin/destroy.sh || true + $WORKSPACE/pulumi/python/runner -p do destroy || true find $WORKSPACE -mindepth 2 -maxdepth 7 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenk${BUILD_NUMBER} --force --yes \\; ''' } diff --git a/extras/jenkins/K3S/Jenkinsfile b/extras/jenkins/K3S/Jenkinsfile index e92cdc1c..3bd08045 100644 --- a/extras/jenkins/K3S/Jenkinsfile +++ b/extras/jenkins/K3S/Jenkinsfile @@ -15,18 +15,16 @@ pipeline { } /* - * The JWT for using NGINX Plus is passed in via a variable; if the JWT is not found the process will deploy the - * open source IC. - * - * The POSTRUN_CMD is used to execute an arbitrary command following the cleanup process; this is just a work-around - * for the time being and will be addressed in the future. - */ + * The JWT for using NGINX Plus is passed in via a variable; if the JWT is not found the process will deploy the + * open source IC. + */ environment { NGINX_JWT = credentials('NGINX_JWT') - POSTRUN_CMD = credentials('POSTRUN_CMD') PULUMI_ACCESS_TOKEN = credentials('PULUMI_ACCESS_TOKEN') NO_COLOR = "TRUE" + MARA_PASSWORD = credentials('MARA_PASSWORD') + } stages { @@ -79,24 +77,11 @@ pipeline { steps { /* - * Run a find and check for any stacks that currently exist with our generated stack name; this should not - * happen in normal operation, but could potentially happen if things break so better safe than sorry. - * - * This function also tries to remove both K3S and Microk8s if they are found on the host; this is because we - * will be installing K3S and we want to both make sure we are removing any previous installations as well as - * ensuring this Jenkins Agent does not already have a microk8s installation on it. + * Any pre-run cleanup can be put here... */ sh ''' - # Reset our K3S Environment - /usr/local/bin/k3s-killall.sh || true - /usr/local/bin/k3s-uninstall.sh || true - # Reset our Microk8s Environment; true if it’s not there - microk8s reset --destroy-storage || true - # True if it’s not there… - sudo snap remove microk8s || true - # Clean up the Pulumi stack if it exists for our run - which it shouldn\'t, but you never know. - find $WORKSPACE -mindepth 2 -maxdepth 7 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenk${BUILD_NUMBER} --force --yes \\; + true ''' } } @@ -157,20 +142,24 @@ pipeline { */ sh ''' - echo "PULUMI_STACK=marajenk${BUILD_NUMBER}" > $WORKSPACE/config/pulumi/environment - $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenk${BUILD_NUMBER} -C pulumi/python/config - $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenk${BUILD_NUMBER} -C pulumi/python/kubernetes/applications/sirius - $WORKSPACE/pulumi/python/venv/bin/pulumi config set certmgr:helm_timeout "600" -C pulumi/python/config -s marajenk${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "marajenks${BUILD_NUMBER}.zathras.io" -C pulumi/python/config -s marajenk${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:helm_timeout "600" -C pulumi/python/config -s marajenk${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:cluster_name "microk8s-cluster" -C pulumi/python/config -s marajenk${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "kubeconfig" -C pulumi/python/config -s marajenk${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenk${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set logagent:helm_timeout "600" -C pulumi/python/config -s marajenk${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set logstore:helm_timeout "600" -C pulumi/python/config -s marajenk${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "password" -C pulumi/python/config -s marajenk${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:helm_timeout "600" -C pulumi/python/config -s marajenk${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:helm_timeout "600" -C pulumi/python/config -s marajenk${BUILD_NUMBER} + echo "PULUMI_STACK=marajenkk3s${BUILD_NUMBER}" > $WORKSPACE/config/pulumi/environment + $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkk3s${BUILD_NUMBER} -C pulumi/python/config + $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkk3s${BUILD_NUMBER} -C pulumi/python/kubernetes/secrets + $WORKSPACE/pulumi/python/venv/bin/pulumi config set certmgr:helm_timeout "600" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:helm_timeout "600" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set logagent:helm_timeout "600" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set logstore:helm_timeout "600" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:helm_timeout "600" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "marajenkk3s${BUILD_NUMBER}.zathras.io" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:cluster_name "default" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "kubeconfig" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:accounts_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_pwd "password" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_user "testuser" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:ledger_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} ''' } } @@ -202,10 +191,10 @@ pipeline { steps { sh ''' - PATH=$WORKSPACE/pulumi/python/venv/bin:$PATH $WORKSPACE/bin/destroy.sh + $WORKSPACE/bin/destroy.sh /usr/local/bin/k3s-killall.sh || true /usr/local/bin/k3s-uninstall.sh || true - find . -mindepth 2 -maxdepth 6 -type f -name Pulumi.yaml -execdir pulumi stack rm marajenk${BUILD_NUMBER} --force --yes \\; + find . -mindepth 2 -maxdepth 6 -type f -name Pulumi.yaml -execdir pulumi stack rm marajenkk3s${BUILD_NUMBER} --force --yes \\; ''' } } @@ -227,7 +216,7 @@ pipeline { # Reset our K3S Environment /usr/local/bin/k3s-killall.sh || true /usr/local/bin/k3s-uninstall.sh || true - find $WORKSPACE -mindepth 2 -maxdepth 7 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenk${BUILD_NUMBER} --force --yes \\; + find $WORKSPACE -mindepth 2 -maxdepth 7 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenkk3s${BUILD_NUMBER} --force --yes \\; ''' } } diff --git a/extras/jenkins/Linode/Jenkinsfile b/extras/jenkins/Linode/Jenkinsfile index d2379084..638c4c67 100644 --- a/extras/jenkins/Linode/Jenkinsfile +++ b/extras/jenkins/Linode/Jenkinsfile @@ -14,16 +14,14 @@ pipeline { /* * The Linode token is passed into the process via a credential in Jenkins. If this is not found the * process will fail out. - * - * The JWT for using NGINX Plus is passed in via a variable; if the JWT is not found the process will deploy the - * open source IC. */ environment { LINODE_TOKEN = credentials('LINODE_TOKEN') - NGINX_JWT = credentials('NGINX_JWT') NO_COLOR = "TRUE" PULUMI_ACCESS_TOKEN = credentials('PULUMI_ACCESS_TOKEN') + MARA_PASSWORD = credentials('MARA_PASSWORD') + } stages { @@ -114,23 +112,37 @@ pipeline { * of the manual deployment if required. * * This will likely evolve further as the project does, and we may reach a point where these defaults are assumed - * for a given development type. + * for a given development type. kubernetes:cluster_name */ sh ''' echo "PULUMI_STACK=marajenklke${BUILD_NUMBER}" > $WORKSPACE/config/pulumi/environment echo "LINODE_TOKEN=${LINODE_TOKEN}" >> $WORKSPACE/config/pulumi/environment $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenklke${BUILD_NUMBER} -C pulumi/python/config - $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenklke${BUILD_NUMBER} -C pulumi/python/kubernetes/applications/sirius + $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenklke${BUILD_NUMBER} -C pulumi/python/kubernetes/secrets $WORKSPACE/pulumi/python/venv/bin/pulumi config set certmgr:helm_timeout "600" -C pulumi/python/config -s marajenklke${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "marajenks${BUILD_NUMBER}.zathras.io" -C pulumi/python/config -s marajenklke${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:helm_timeout "600" -C pulumi/python/config -s marajenklke${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "DO" -C pulumi/python/config -s marajenklke${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "lke" -C pulumi/python/config -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:cluster_name "marajenklke${BUILD_NUMBER}" -C pulumi/python/config -s marajenklke${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set logagent:helm_timeout "600" -C pulumi/python/config -s marajenklke${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set logstore:helm_timeout "600" -C pulumi/python/config -s marajenklke${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "password" -C pulumi/python/config -s marajenklke${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:helm_timeout "600" -C pulumi/python/config -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set linode:harbor_db_password "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set linode:harbor_password "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set linode:harbor_sudo_user_password "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:accounts_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_pwd "password" --secret -C pulumi/python/kubernetes/secrets -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_user "testuser" --secret -C pulumi/python/kubernetes/secrets -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:ledger_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set linode:instance_type "g6-standard-8" --plaintext -C pulumi/python/config -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set linode:k8s_ha "true" --plaintext -C pulumi/python/config -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set linode:k8s_version "1.23" --plaintext -C pulumi/python/config -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set linode:node_count "3" --plaintext -C pulumi/python/config -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set linode:region "us-central" --plaintext -C pulumi/python/config -s marajenklke${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set linode:soa_email "qdzlug@gmail.com" --plaintext -C pulumi/python/config -s marajenklke${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set linode:token "${LINODE_TOKEN}" --plaintext -C pulumi/python/config -s marajenklke${BUILD_NUMBER} ''' @@ -140,14 +152,8 @@ pipeline { stage('Deploying Pulumi') { steps { - /* - * This step echoes the JWT into the correct file for the startup to find it and then calls the script to build - * the MARA deployment in Linode. - */ - sh ''' - echo $NGINX_JWT > $WORKSPACE/extras/jwt.token - $WORKSPACE/bin/start_lke.sh + $WORKSPACE/pulumi/python/runner -p linode up ''' } } @@ -164,7 +170,7 @@ pipeline { */ sh ''' - PATH=$WORKSPACE/pulumi/python/venv/bin:$PATH $WORKSPACE/bin/destroy.sh + $WORKSPACE/pulumi/python/runner -p linode destroy find $WORKSPACE -mindepth 2 -maxdepth 6 -type f -name Pulumi.yaml -execdir pulumi stack rm marajenklke${BUILD_NUMBER} --force --yes \\; ''' } @@ -181,7 +187,8 @@ pipeline { sh ''' # Destroy our partial build... - $WORKSPACE/bin/destroy.sh || true + $WORKSPACE/pulumi/python/runner -p linode destroy|| true + # Clean up the Pulumi stack find $WORKSPACE -mindepth 2 -maxdepth 7 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenklke${BUILD_NUMBER} --force --yes \\; ''' } diff --git a/extras/jenkins/MicroK8s/Jenkinsfile b/extras/jenkins/MicroK8s/Jenkinsfile index 1b04a6ca..4bce3ee4 100644 --- a/extras/jenkins/MicroK8s/Jenkinsfile +++ b/extras/jenkins/MicroK8s/Jenkinsfile @@ -15,18 +15,15 @@ pipeline { } /* - * The JWT for using NGINX Plus is passed in via a variable; if the JWT is not found the process will deploy the - * open source IC. - * - * The POSTRUN_CMD is used to execute an arbitrary command following the cleanup process; this is just a work-around - * for the time being and will be addressed in the future. - */ + * The JWT for using NGINX Plus is passed in via a variable; if the JWT is not found the process will deploy the + * open source IC. + */ environment { NGINX_JWT = credentials('NGINX_JWT') - POSTRUN_CMD = credentials('POSTRUN_CMD') NO_COLOR = "TRUE" PULUMI_ACCESS_TOKEN = credentials('PULUMI_ACCESS_TOKEN') + MARA_PASSWORD = credentials('MARA_PASSWORD') } stages { @@ -152,18 +149,22 @@ pipeline { sh ''' echo "PULUMI_STACK=marajenkmk8s${BUILD_NUMBER}" > $WORKSPACE/config/pulumi/environment $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkmk8s${BUILD_NUMBER} -C pulumi/python/config - $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkmk8s${BUILD_NUMBER} -C pulumi/python/kubernetes/applications/sirius + $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkmk8s${BUILD_NUMBER} -C pulumi/python/kubernetes/secrets $WORKSPACE/pulumi/python/venv/bin/pulumi config set certmgr:helm_timeout "600" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "marajenkmk8ss${BUILD_NUMBER}.zathras.io" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:helm_timeout "600" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:cluster_name "microk8s-cluster" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "kubeconfig" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set logagent:helm_timeout "600" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set logstore:helm_timeout "600" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "password" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:helm_timeout "600" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:helm_timeout "600" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "marajenkmk8s${BUILD_NUMBER}.zathras.io" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:cluster_name "microk8s-cluster" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "kubeconfig" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenkmk8s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "Zf4dabEA" --secret -C pulumi/python/kubernetes/secrets -s marajenkmk8s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:accounts_pwd "Zf4dabEA" --secret -C pulumi/python/kubernetes/secrets -s marajenkmk8s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_pwd "password" --secret -C pulumi/python/kubernetes/secrets -s marajenkmk8s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_user "testuser" --secret -C pulumi/python/kubernetes/secrets -s marajenkmk8s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:ledger_pwd "Zf4dabEA" --secret -C pulumi/python/kubernetes/secrets -s marajenkmk8s${BUILD_NUMBER} ''' } } diff --git a/extras/jenkins/Minikube/Jenkinsfile b/extras/jenkins/Minikube/Jenkinsfile index a5a783cf..78a8cc38 100644 --- a/extras/jenkins/Minikube/Jenkinsfile +++ b/extras/jenkins/Minikube/Jenkinsfile @@ -1,9 +1,9 @@ pipeline { agent { /* - * Nodes that are configured for Microk8s are tagged as "mk8s". Unlike the deployment to cloud providers, this logic - * will install Microk8s on the Jenkins Agent. This means that the agent should have sufficient resources available - * to run Microk8s. A minimum of 16GB RAM, 2 vCPU, and 20GB of disk is recommended. Testing is done with 20GB of RAM, + * Nodes that are configured for minkube are tagged as "minikube". Unlike the deployment to cloud providers, this logic + * will install minikube on the Jenkins Agent. This means that the agent should have sufficient resources available + * to run minikube. A minimum of 16GB RAM, 2 vCPU, and 20GB of disk is recommended. Testing is done with 20GB of RAM, * 4 vCPU, and 64GB of disk. * * This has been * tested on Ubuntu 20.04. Be sure to check that your Agent has the necessary components installed @@ -15,18 +15,16 @@ pipeline { } /* - * The JWT for using NGINX Plus is passed in via a variable; if the JWT is not found the process will deploy the - * open source IC. - * - * The POSTRUN_CMD is used to execute an arbitrary command following the cleanup process; this is just a work-around - * for the time being and will be addressed in the future. - */ + * The JWT for using NGINX Plus is passed in via a variable; if the JWT is not found the process will deploy the + * open source IC. + */ environment { NGINX_JWT = credentials('NGINX_JWT') - POSTRUN_CMD = credentials('POSTRUN_CMD') NO_COLOR = "TRUE" PULUMI_ACCESS_TOKEN = credentials('PULUMI_ACCESS_TOKEN') + MARA_PASSWORD = credentials('MARA_PASSWORD') + } stages { @@ -95,7 +93,7 @@ pipeline { stage('Minikube Setup') { /* - * This step installs Microk8s. This assumes you have the snap store installed and configured properly. Note that + * This step installs minikube. This assumes you have the snap store installed and configured properly. Note that * the snap store will always pull the latest version of the software so you may end up with a deployment that * does not work as expected; if this happens please check back with the github repository and verify the known * working configurations. @@ -159,18 +157,23 @@ _EOF_ sh ''' echo "PULUMI_STACK=marajenkmkube${BUILD_NUMBER}" > $WORKSPACE/config/pulumi/environment $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkmkube${BUILD_NUMBER} -C pulumi/python/config - $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkmkube${BUILD_NUMBER} -C pulumi/python/kubernetes/applications/sirius + $WORKSPACE/pulumi/python/venv/bin/pulumi stack select --create marajenkmkube${BUILD_NUMBER} -C pulumi/python/kubernetes/secrets $WORKSPACE/pulumi/python/venv/bin/pulumi config set certmgr:helm_timeout "600" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "marajenkmkubes${BUILD_NUMBER}.zathras.io" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:helm_timeout "600" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:cluster_name "microk8s-cluster" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "kubeconfig" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set logagent:helm_timeout "600" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set logstore:helm_timeout "600" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "password" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:helm_timeout "600" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:helm_timeout "600" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "marajenkmkube${BUILD_NUMBER}.zathras.io" -C pulumi/python/config -s marajenkmkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:cluster_name "microk8s-cluster" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "kubeconfig" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:accounts_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_pwd "password" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_user "testuser" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:ledger_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} + ''' } } @@ -179,7 +182,7 @@ _EOF_ /* * This step echoes the JWT into the correct file for the startup to find it and then calls the script to build - * the MARA deployment in Microk8s + * the MARA deployment in minikube */ steps { @@ -194,7 +197,7 @@ _EOF_ /* * Clean up the environment; this includes running the destroy script to remove our pulumi resources and - * destroy the deployed Microk8s installation. + * destroy the deployed minikube installation. * * After that completes, we remove the pulumi stack from the project with the find command; this is because * we need to delete the stack in each project it's been instantiated in. @@ -203,17 +206,8 @@ _EOF_ steps { sh ''' $WORKSPACE/bin/destroy.sh - # Reset our Microk8s Environment; true if it’s not there - microk8s reset --destroy-storage || true - # True if it’s not there… - snap remove microk8s || true + minikube delete || true find . -mindepth 2 -maxdepth 6 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenkmkube${BUILD_NUMBER} --force --yes \\; - # This is a hack to allow additional commands to be issued following cleanup. This is needed because the VMs - # that currently run as agents for K3S and Microk8s deployments need to be rebooted following some number of - # runs due to zombie processes and other issues. Long term we want to deploy these VM's via IaaC so the only - # exist for the lifetime of the project. We do it this way in order to provide some flexibility for the - # jenkins configuration. - ${POSTRUN_CMD- true} ''' } From f004373b04772fbda674b3b797b7827dc88be0c9 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Wed, 10 Aug 2022 16:23:01 -0600 Subject: [PATCH 19/21] fix: updates to the jenkinsfiles --- extras/jenkins/K3S/Jenkinsfile | 20 +++++++++++--------- extras/jenkins/Minikube/Jenkinsfile | 22 ++++++++++++---------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/extras/jenkins/K3S/Jenkinsfile b/extras/jenkins/K3S/Jenkinsfile index 3bd08045..696bd71a 100644 --- a/extras/jenkins/K3S/Jenkinsfile +++ b/extras/jenkins/K3S/Jenkinsfile @@ -15,16 +15,18 @@ pipeline { } /* - * The JWT for using NGINX Plus is passed in via a variable; if the JWT is not found the process will deploy the - * open source IC. - */ + * The JWT for using NGINX Plus is passed in via a variable; if the JWT is not found the process will deploy the + * open source IC. + * + * The POSTRUN_CMD is used to execute an arbitrary command following the cleanup process; this is just a work-around + * for the time being and will be addressed in the future. + */ environment { NGINX_JWT = credentials('NGINX_JWT') + POSTRUN_CMD = credentials('POSTRUN_CMD') PULUMI_ACCESS_TOKEN = credentials('PULUMI_ACCESS_TOKEN') NO_COLOR = "TRUE" - MARA_PASSWORD = credentials('MARA_PASSWORD') - } stages { @@ -97,7 +99,7 @@ pipeline { steps { sh ''' # Is this super safe? No, but we’re going to roll with it for now. - curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable=traefik" sh - + curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable=traefik" INSTALL_K3S_VERSION="v1.23.9+k3s1" sh - ''' } } @@ -155,11 +157,11 @@ pipeline { $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:cluster_name "default" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "kubeconfig" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenkk3s${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:accounts_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "Zf4dabEA" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:accounts_pwd "Zf4dabEA" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_pwd "password" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_user "testuser" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:ledger_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:ledger_pwd "Zf4dabEA" --secret -C pulumi/python/kubernetes/secrets -s marajenkk3s${BUILD_NUMBER} ''' } } diff --git a/extras/jenkins/Minikube/Jenkinsfile b/extras/jenkins/Minikube/Jenkinsfile index 78a8cc38..d02acbc1 100644 --- a/extras/jenkins/Minikube/Jenkinsfile +++ b/extras/jenkins/Minikube/Jenkinsfile @@ -15,16 +15,18 @@ pipeline { } /* - * The JWT for using NGINX Plus is passed in via a variable; if the JWT is not found the process will deploy the - * open source IC. - */ + * The JWT for using NGINX Plus is passed in via a variable; if the JWT is not found the process will deploy the + * open source IC. + * + * The POSTRUN_CMD is used to execute an arbitrary command following the cleanup process; this is just a work-around + * for the time being and will be addressed in the future. + */ environment { NGINX_JWT = credentials('NGINX_JWT') + POSTRUN_CMD = credentials('POSTRUN_CMD') NO_COLOR = "TRUE" PULUMI_ACCESS_TOKEN = credentials('PULUMI_ACCESS_TOKEN') - MARA_PASSWORD = credentials('MARA_PASSWORD') - } stages { @@ -105,7 +107,7 @@ pipeline { curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube mkdir -p /usr/local/bin/ install minikube /usr/local/bin/ - minikube start --vm-driver=none + minikube start --vm-driver=docker --force ''' } } @@ -164,15 +166,15 @@ _EOF_ $WORKSPACE/pulumi/python/venv/bin/pulumi config set logagent:helm_timeout "600" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set logstore:helm_timeout "600" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:helm_timeout "600" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "marajenkmkube${BUILD_NUMBER}.zathras.io" -C pulumi/python/config -s marajenkmkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set kic-helm:fqdn "marajenkmkube${BUILD_NUMBER}.zathras.io" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:cluster_name "microk8s-cluster" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:infra_type "kubeconfig" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set kubernetes:kubeconfig "$HOME/.kube/config" -C pulumi/python/config -s marajenkmkube${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:accounts_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set prometheus:adminpass "Zf4dabEA" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:accounts_pwd "Zf4dabEA" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_pwd "password" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:demo_login_user "testuser" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} - $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:ledger_pwd "${MARA_PASSWORD}" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} + $WORKSPACE/pulumi/python/venv/bin/pulumi config set sirius:ledger_pwd "Zf4dabEA" --secret -C pulumi/python/kubernetes/secrets -s marajenkmkube${BUILD_NUMBER} ''' } From eca884d059860fe8a484a5862fb690d5fcf8a62e Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Fri, 12 Aug 2022 16:07:15 -0600 Subject: [PATCH 20/21] chore: doc updates for automation-api changes --- docs/getting_started.md | 120 ++++++++------ docs/status-and-issues.md | 26 +-- pulumi/python/README.md | 336 ++++++++++++++++++++------------------ 3 files changed, 262 insertions(+), 220 deletions(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index 9ecc17cd..5da0c20f 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -93,7 +93,7 @@ deploy the NGINX IC or the NGINX Plus IC (with a JWT from your F5 account) #### Kubernetes Although not required, installing the [CLI tool `kubectl`](https://kubernetes.io/docs/tasks/tools/) -will allow you to interact with the Kubernetes cluster that you have stood up using this project. This +will allow you to interact with the Kubernetes cluster that you have stood up using this project. This tool is also installed as part of the venv that is created and can be used from that directory. #### Setup @@ -116,6 +116,15 @@ other environment variables into the current shell. ## Post Install Configuration +### Stack Name + +For AWS, Linode, or Digital Ocean deployments you will need to add the variable `PULUMI_STACK_NAME` to the environment +file for the deployment at [`../config/pulumi/environment`](../config/pulumi/environment). This is the name that will +be used for the provisioned Pulumi stack. + +If you are running a `kubeconfig` deployment, the process will prompt you for the value of `PULUMI_STACK_NAME` and +update the environment file for you. + ### Kubeconfig If you are using an existing kubernetes installation for this project, you will need to provide three pieces of @@ -128,56 +137,67 @@ information to the installer: The easiest way to test this is to run the command: `kubectl --kubeconfig="yourconfig" --cluster="yourcluster" --context="yourcontext"` -Once you have verified you can connect to the cluster you will need to test to make sure your cluster supports the -minimum required capabilities for MARA. You can test this by running the [`./bin/testcap.sh`](../bin/testcap.sh) -script. - -This script does several things: - -1. Creates a namespace -2. Creates a persistent volume claim -3. Deploys a pod to test the persistent volume -4. Writes to the persistent volume -5. Reads from the persistent volume -6. Destroys the pod -7. Destroys the persistent volume -8. Deploys a service and attempts to provision a `LoadBalancer` to obtain an egress IP address -9. Destroys the service -10. Destroys the namespace - -If any of these tests fails the script exits with notes on the failure. These failures need to be remediated before MARA -can be installed. - -There are several utilities under the `./pulumi/python/tools` directory that are intended for use to add the necessary -capabilities to a Kubernetes cluster. Note that these are not extensively tested with MARA, but are included for -convenience. Please see the [README.md](../pulumi/python/tools/README.md) in that directory for additional information. -Note that these tools can be installed via the [kubernetes-extras.sh](../bin/kubernetes-extras.sh) -script. - ### AWS +*Note:* The AWS deployment has been updated from v1.1 and no longer uses the [`../bin/start.sh`](../bin/start.sh) +script for deployment. If you attempt to use the script to deploy to AWS you will receive an error message. Please +use the new [`../pulumi/python/runner`](../pulumi/python/runner) program for these deployments. + If you are using AWS as your infrastructure provider [configuring Pulumi for AWS](https://www.pulumi.com/docs/intro/cloud-providers/aws/setup/) is necessary. If you already have run the [`./bin/setup_venv.sh`](../bin/setup_venv.sh) -script, you will have the `aws` CLI tool installed in the path `./pulumi/python/venv/bin/aws` +script, you will have the `aws` CLI tool installed in the path `../pulumi/python/venv/bin/aws` and you do not need to install it to run the steps in the Pulumi Guide. If you want to avoid using environment variables, AWS profile and region definitions can be contained in -the `config/Pulumi..yaml` -files in each project. Refer to the Pulumi documentation for details on how to do this. When you run the -script [`./bin/start.sh`](../bin/start.sh) and select an AWS installation, you will be prompted to add the AWS region -and profile values that will then be added to the `./config/Pulumi/Pulumi..yaml`. This is the main configuration -file for the project, although there are two other configuration files kept for the application standup and the -kubernetes extras functionality. For more details on those, please see the README.md in those directories. +the `config/Pulumi..yaml` files in each project. Refer to the Pulumi documentation for details on how to do this. +When you run the [`../pulumi/python/runnner`](../pulumi/python/runner) program and select your provider you will be +prompted for all variables necessary to use that provider along with MARA specific variables. This information will +be added to the `../config/Pulumi/Pulumi..yaml` configuration file. This is the main configuration file for the +project, although there is one other configuration file used to maintain secrets in the +[`../pulumi/python/kubernetes/secrets`](./pulumi/python/kubernetes/secrets) kubernetes extras functionality. +For more details on those, please see the README.md in those directories. ### Digital Ocean +*Note:* The Digital Ocean deployment has been updated from v1.1 and no longer uses the +[`../bin/start.sh`](../bin/start.sh) script for deployment. If you attempt to use the script to deploy to AWS you will +receive an error message. Please use the new [`../pulumi/python/runner`](../pulumi/python/runner) program for these +deployments. + You will need to create a [Digital Ocean Personal API Token](https://docs.digitalocean.com/reference/api/create-personal-access-token/) -for authentication to Digital Ocean. When you run the script [`./bin/start.sh`](../bin/start.sh) and select a Digital -Ocean deployment, your token will be added to the `./config/Pulumi/Pulumi..yaml`. This is the main configuration -file for the project, although there are two other configuration files kept for the application standup and the -kubernetes extras functionality. For more details on those, please see the README.md in those directories. +for authentication to Digital Ocean. When you run the [`./pulumi/python/runnner`](./pulumi/python/runner) program and +select your provider you will be prompted for all variables necessary to use that provider along with MARA specific +variables. This information will be added to the `./config/Pulumi/Pulumi..yaml` configuration file. This is the +main configuration file for the project, although there is one other configuration file used to maintain secrets in the +[`./pulumi/python/kubernetes/secrets`](./pulumi/python/kubernetes/secrets) kubernetes extras functionality. +For more details on those, please see the README.md in those directories. + +### Linode + +*Note:* The Linode deployment has been updated from v1.1 and no longer uses the [`../bin/start.sh`](../bin/start.sh) +script for deployment. If you attempt to use the script to deploy to AWS you will receive an error message. Please +use the new [`../pulumi/python/runner`](../pulumi/python/runner) program for these deployments. + +You will need to create a +[Linode API Token](https://www.linode.com/docs/products/tools/linode-api/guides/get-access-token/) for authentication +to Linode. When you run the [`./pulumi/python/runnner`](./pulumi/python/runner) program and +select your provider you will be prompted for all variables necessary to use that provider along with MARA specific +variables. This information will be added to the `./config/Pulumi/Pulumi..yaml` configuration file. This is the +main configuration file for the project, although there is one other configuration file used to maintain secrets in the +[`./pulumi/python/kubernetes/secrets`](./pulumi/python/kubernetes/secrets) kubernetes extras functionality. +For more details on those, please see the README.md in those directories. + +### Kubeconfig Deployments: MicroK8s / Minikube / K3s / Other + +Deployments that use a `kubeconfig` file to access an existing K8 installation will continue to use the +[`../bin/start.sh`](../bin/start.sh) script. Additionally, these deployments are not able to build the Ingress +Controller and instead need to download from the NGINX repositories. The installation of NGINX+ is supported via the +use of a JWT, if desired. + +These deployments will be moved over to use the [`../pulumi/python/runner`](../pulumi/python/runner) program in a +future release, which will bring them to parity for NGINX IC build/deployment with the other infrastructures. ### Pulumi @@ -190,18 +210,17 @@ Pulumi documentation for additional details regarding the command and alternativ ## Running the Project -The easiest way to run the project is to run [`start.sh`](../bin/start.sh) -after you have completed the installation steps. When doing so, be sure to choose the same -[Pulumi stack name](https://www.pulumi.com/docs/intro/concepts/stack/) -for all of your projects. Additionally, this script will prompt you for infrastructure specific configuration values. -This information will be used to populate the `./config/pulumi/Pulumi..yaml` file. +Provided you have completed the installation steps, the easiest way to run the project is to run +[`../pulumi/python/runner`](../pulumi/python/runner) for AWS, Linode, or Digital Ocean and +[`../bin/start.sh`](../bin/start.sh) for `kubeconfig` deployments. This process will prompt you for all required +variables for your deployment type. This information will be used to populate the configuration files. Alternatively, you can enter into each Pulumi project directory and execute each project independently by doing `pulumi up`. Take a look at `start.sh` and dependent scripts to get a feel for the flow. -If you want to destroy the entire environment you can run [`destroy.sh`](../bin/destroy.sh). This script calls the -correct destroy script based on the information stored in the `./config/Pulumi/Pulumi..yaml` configuration file. -Detailed information and warnings are emitted by the script as it runs. +If you want to destroy the entire environment you can run [`../pulumi/python/runner`](../pulumi/python/runner) for AWS, +Linode, or Digital Ocean or [`destroy.sh`](../bin/destroy.sh) for `kubeconfig` deployments. +Detailed information and warnings are emitted by the process as it runs. ### Running the Project in a Docker Container @@ -257,6 +276,13 @@ these tools. ### Cleaning Up If you want to completely remove all the resources you have provisioned, run the -script: [`./bin/destroy.sh`](../bin/destroy.sh). +[`../pulumi/python/runner`](../pulumi/python/runner) for AWS, Linode, or Digital Ocean or +[`destroy.sh`](../bin/destroy.sh) for `kubeconfig` deployments. Detailed information and warnings are emitted by the +process as it runs. Be careful because this will **DELETE ALL** the resources you have provisioned. + +## Other Resources +Starting with release `v1.1`, the MARA project has begun the process of transitioning the deployment logic away from +BASH scripts and instead using the [Pulumi Automation API](https://www.pulumi.com/docs/guides/automation-api/) with +Python. For more information on this, please see this [Design Document](../pulumi/python/automation/DESIGN.md). \ No newline at end of file diff --git a/docs/status-and-issues.md b/docs/status-and-issues.md index 6f915e7b..49ac95ab 100644 --- a/docs/status-and-issues.md +++ b/docs/status-and-issues.md @@ -20,24 +20,24 @@ includes the following: All of these configurations use Pulumi code within Python as the Infrastructure as Code (IaaC) provider. -| K8 Provider | Tested / Deploy Status | Infrastructure Support | IC Options | FQDN/IP | Notes | -|-----------------|--------------------------------------------------------------------------------------------------------|-----------------------------|---------------------------------|-----------------|--------------------------------------------------| -| AWS EKS | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_aws_prod&subject=Deploy) | Full Infrastructure Standup | Build, Pull (uses ECR) | Provided | | -| Azure AKS | Yes | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | | -| Digtal Ocean | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_do_prod&subject=Deploy) | Full Infrastructure Standup | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | | -| Google GKE | Yes | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | | -| Harvester/RKE2 | Yes | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | Needs Storage, K8 LoadBalancer | -| K3S | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_k3s_prod&subject=Deploy) | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | | -| Linode | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_lke_prod&subject=Deploy) | Full Infrastructure Standup | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | | -| MicroK8s | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_mk8s_prod&subject=Deploy) | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | Storage, DNS, and Metallb need to be Enabled (4) | -| Minikube | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_minikube_prod&subject=Deploy) | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | | -| Rancher Desktop | No | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | Needs Storage, K8 LoadBalancer | +| K8 Provider | Tested / Deploy Status | Infrastructure Support | IC Options | FQDN/IP | Notes | +|-----------------|--------------------------------------------------------------------------------------------------------|-----------------------------|-----------------------------------|-----------------|--------------------------------------------------| +| AWS EKS | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_aws_prod&subject=Deploy) | Full Infrastructure Standup | Build, Pull (uses ECR) | Provided | | +| Azure AKS | Yes | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | | +| Digtal Ocean | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_do_prod&subject=Deploy) | Full Infrastructure Standup | Build, Pull (Uses DO Registry) | Provided | Requires DNS delegation to DO | +| Google GKE | Yes | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | | +| Harvester/RKE2 | Yes | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | Needs Storage, K8 LoadBalancer | +| K3S | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_k3s_prod&subject=Deploy) | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | | +| Linode | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_lke_prod&subject=Deploy) | Full Infrastructure Standup | Build, Pull (uses Harbor install) | Provided | | +| MicroK8s | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_mk8s_prod&subject=Deploy) | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | Storage, DNS, and Metallb need to be Enabled (4) | +| Minikube | ![Deploy Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_minikube_prod&subject=Deploy) | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | | +| Rancher Desktop | No | Kubeconfig Only (3) | NGINX / NGINX Plus (w/ JWT) (1) | Manual FQDN (2) | Needs Storage, K8 LoadBalancer | ### Notes: 1. The NGINX IC build/deploy process is currently under active development and support for IC will be standardized across all providers. Follow [#81](https://github.com/nginxinc/kic-reference-architectures/issues/81) and - [#86](https://github.com/nginxinc/kic-reference-architectures/issues/86) for details. Currently, for all non-AWS + [#86](https://github.com/nginxinc/kic-reference-architectures/issues/86) for details. Currently, for all `kubeconfig` environments you have the option to specify either NGINX or NGINX Plus as your IC. The latter does require an active subscription and a JWT to be included at build time. Please see the documentation for more details. 2. The process via which the IP and FQDN are created and used is currently under active development, and will be diff --git a/pulumi/python/README.md b/pulumi/python/README.md index 25dcc548..08a30661 100644 --- a/pulumi/python/README.md +++ b/pulumi/python/README.md @@ -1,13 +1,12 @@ # MARA: Pulumi / Python -This project illustrates the end-to-end stand up of an AWS VPC cluster, Elastic -Kubernetes Service (EKS), NGINX Kubernetes Ingress Controller (KIC), and a sample -application using [Pulumi](https://www.pulumi.com/). It is intended to be used -as a reference when building your own Infrastructure as Code (IaC) deployments. -As such, each discrete stage of deployment is defined as a separate Pulumi project -that can be deployed independently of each stage. Although Pulumi supports many -programming languages, Python was chosen as the language for this project. -The reimplementation of the deployment here should be easily reproducible +This project illustrates the end-to-end stand up of the MARA project using +[Pulumi](https://www.pulumi.com/). It is intended to be used +as a reference when building your own Infrastructure as Code (IaC) deployments. +As such, each discrete stage of deployment is defined as a separate Pulumi project +that can be deployed independently of each stage. Although Pulumi supports many +programming languages, Python was chosen as the language for this project. +The reimplementation of the deployment here should be easily reproducible in other languages. ## Getting Started @@ -19,8 +18,8 @@ For instructions on running the project, refer to the ### Top Level -Several directories, located at the root of the project, are used. These are -at the project root because they are intended to be outside the specific +Several directories, located at the root of the project, are used. These are +at the project root because they are intended to be outside the specific IaC providers (e.g., to be used for a port to Terraform). ``` @@ -32,86 +31,80 @@ IaC providers (e.g., to be used for a port to Terraform). └── extras ``` -- The [`bin`](../../bin) directory contains all the binaries and scripts that - are used to start/stop the project, as well as perform capabilities testing - and deployment of extra functionality. -- The [`config`](../../config) directory holds the `requirements.txt` for the - venv needed for this project. -- The [`config/pulumi`](../../config/pulumi) directory holds the configuration - files for deployments, as well as a reference configuration that illustrates +- The [`bin`](../../bin) directory contains all the binaries and scripts that + are used to start/stop the project and provide additional capabilities. +- The [`config/pulumi`](../../config/pulumi) directory holds the configuration + files for deployments, as well as a reference configuration that illustrates the available configuration options and their defaults. -- The [`docker`](../../docker) directory contains Dockerfiles and a script to - build a Docker-based deployment image that contains all the tooling necessary +- The [`docker`](../../docker) directory contains Dockerfiles and a script to + build a Docker-based deployment image that contains all the tooling necessary to deploy MARA. -- The [`docs`](../../docs) directory contains all documentation relevant to the +- The [`docs`](../../docs) directory contains all documentation relevant to the overall project. -- The [`extras`](../../extras) directory contains additional scripts, notes, +- The [`extras`](../../extras) directory contains additional scripts, notes, and configurations. ### Pulumi/Python Level -This directory contains all Pulumi/Python-based logic, which currently +This directory contains all Pulumi/Python-based logic, which currently consists of the following: ``` +├── automation +│   └── providers ├── config ├── infrastructure -│ ├── aws -│ ├── digitalocean -│ └── kubeconfig +│   ├── aws +│   ├── digitalocean +│   ├── kubeconfig +│   └── linode ├── kubernetes -│ ├── applications -│ ├── certmgr -│ ├── logagent -│ ├── logstore -│ ├── nginx -│ ├── observability -│ ├── prometheus -│ └── venv +│   ├── applications +│   ├── certmgr +│   ├── logagent +│   ├── logstore +│   ├── nginx +│   ├── observability +│   ├── prometheus +│   └── secrets ├── tools -│ ├── common -│ ├── kubevip -│ ├── metallb -│ └── nfsvolumes -├── utility -│ ├── kic-image-build -│ ├── kic-image-push -│ └── kic-pulumi-utils -└── venv - ├── bin - ├── include - ├── lib - ├── lib64 -> lib - ├── share - └── src +│   ├── common +│   ├── metallb +│   └── nfsvolumes +└── utility + ├── kic-image-build + ├── kic-image-push + └── kic-pulumi-utils ``` -- The [`config`](./config) directory contains files used by Pulumi to manage - the configuration for this project. Note that this directory is essentially +- The [`automation`](./automation) directory contains the files used to interface with the pulumi + automation api, including provider-specific files. +- The [`config`](./config) directory contains files used by Pulumi to manage + the configuration for this project. Note that this directory is essentially a redirect to the project-wide [`config`](../../config/pulumi) directory. -- The [`infrastructure`](./infrastructure) directory contains files used to stand - up Kubernetes as well as to provide a common project for all of the infrastructure +- The [`infrastructure`](./infrastructure) directory contains files used to stand + up Kubernetes as well as to provide a common project for all of the infrastructure and kubeconfig-based clusters. -- The [`kubernetes`](./kubernetes) directory contains all of the Kubernetes-based +- The [`kubernetes`](./kubernetes) directory contains all of the Kubernetes-based deployments. There are two key subdirectories in this directory: - The [`nginx`](./kubernetes/nginx) directory contains all NGINX products. - - The [`applications`](./kubernetes/applications) directory contains all applications + - The [`secrets`](./kubernetes/secrets) directory contains all encrypted secrets. + - The [`applications`](./kubernetes/applications) directory contains all applications that have been tested for deployment with MARA. -- The [`tools`](./tools) directory contains projects that are used with the - `kubernetes-extras.sh` script found in the bin directory. -- The [`utility`](./utility) directory contains the code used to build/pull/push KIC, +- The [`tools`](./tools) directory contains extra tooling for specific use cases. +- The [`utility`](./utility) directory contains the code used to build/pull/push KIC, and other projects used to support the environment. -- The [`venv/bin`](./venv/bin) directory contains the virtual environment for Python +- The [`venv/bin`](./venv/bin) directory contains the virtual environment for Python along with some key utilities, such as `pulumi`, `kubectl`, and `node`. ## Configuration -The Pulumi configuration files are in the [`config`](../../config/pulumi) -directory. Pulumi's configuration files use the following naming convention: -`Pulumi..yaml`. To create a new configuration file for your Pulumi -stack, create a new file with a name that includes the stack name. Then, refer -to the sample [configuration file](../../config/pulumi/Pulumi.stackname.yaml.example) -for configuration entries that you want to customize and copy over the entries +The Pulumi configuration files are in the [`config`](../../config/pulumi) +directory. Pulumi's configuration files use the following naming convention: +`Pulumi..yaml`. To create a new configuration file for your Pulumi +stack, create a new file with a name that includes the stack name. Then, refer +to the sample [configuration file](../../config/pulumi/Pulumi.stackname.yaml.example) +for configuration entries that you want to customize and copy over the entries that you want to modify from their defaults. ### AWS @@ -120,23 +113,23 @@ The following directories are specific to AWS. #### VPC -Contained within the [`vpc`](./infrastructure/aws/vpc) directory is the first -Pulumi project which is responsible for setting up the VPC and subnets used by EKS. -The project is built so that it will attempt to create a subnet for each availability -zone within the running region. You may want to customize this behavior, or the IP +Contained within the [`vpc`](./infrastructure/aws/vpc) directory is the first +Pulumi project which is responsible for setting up the VPC and subnets used by EKS. +The project is built so that it will attempt to create a subnet for each availability +zone within the running region. You may want to customize this behavior, or the IP addressing scheme used. #### Elastic Kubernetes Service (EKS) -Located within the [`eks`](./infrastructure/aws/eks) directory is a project used -to stand up a new EKS cluster on AWS. This project reads data from the previously -executed VPC project using its VPC id and subnets. In this project you may want to -customize the `instance_type`, `min_size`, or `max_size` parameters provided +Located within the [`eks`](./infrastructure/aws/eks) directory is a project used +to stand up a new EKS cluster on AWS. This project reads data from the previously +executed VPC project using its VPC id and subnets. In this project you may want to +customize the `instance_type`, `min_size`, or `max_size` parameters provided to the cluster. #### Elastic Container Registry (ECR) -The [`ecr`](./infrastructure/aws/ecr) project is responsible for installing and +The [`ecr`](./infrastructure/aws/ecr) project is responsible for installing and configuring ECR for use with the previously created EKS cluster. ### Digital Ocean @@ -145,71 +138,96 @@ The following directories are specific to Digital Ocean. #### DOMK8S -Contained within the [`domk8s`](./infrastructure/digitalocean/domk8s) directory contains the -logic needed to stand up a Digital Ocean Managed Kubernetes cluster. There are a number of -configuration options available to customize the build, however the defaults can be used +Contained within the [`domk8s`](./infrastructure/digitalocean/domk8s) directory contains the +logic needed to stand up a Digital Ocean Managed Kubernetes cluster. There are a number of +configuration options available to customize the build, however the defaults can be used to create a standard sized cluster in the SFO3 region. +#### container-registry / container-registry-credentials + +These directories contain the projects required to create and use the Digital Ocean container +registry. + +#### dns-record + +This directory contains the project required to provision a DNS record for the Digital Ocean +egress. + +### Linode + +The following directories are specific to Linode. + +#### LKE + +Contained within the [`lke`](./infrastructure/linode/lke) directory contains the +logic needed to stand up a Linode Kubernetes Engine cluster. There are a number of +configuration options available to customize the build. + +#### harbor / harbor-configuration / container-registry-credentials + +These directories contain the projects required to create and use the Harbor container registry +with the Linode deployment. + ### NGINX Ingress Controller Docker Image Build -Within the [`kic-image-build`](./utility/kic-image-build) directory, there is -a Pulumi project that will allow you to build a new KIC from source. Download -of source, compilation, and image creation are fully automated. This project +Within the [`kic-image-build`](./utility/kic-image-build) directory, there is +a Pulumi project that will allow you to build a new KIC from source. Download +of source, compilation, and image creation are fully automated. This project can be customized to build different flavors of KIC. ### NGINX Ingress Controller Docker Image Push -Within the [`kic-image-push`](./utility/kic-image-push) directory, there is a -Pulumi project that will allow you to push the previously created KIC Docker +Within the [`kic-image-push`](./utility/kic-image-push) directory, there is a +Pulumi project that will allow you to push the previously created KIC Docker image to ECR in a fully automated manner. ### NGINX Ingress Controller Helm Chart -In the [`ingress-contoller`](./kubernetes/nginx/ingress-controller) directory, you -will find the Pulumi project responsible for installing NGINX KIC. You may want to -customize this project to allow for deploying different versions of KIC. This chart +In the [`ingress-contoller`](./kubernetes/nginx/ingress-controller) directory, you +will find the Pulumi project responsible for installing NGINX KIC. You may want to +customize this project to allow for deploying different versions of KIC. This chart is only used for AWS deployments. All other deployments use the [`ingress-controller- -repo-only`](./kubernetes/nginx/ingress-controller-repo-only) directory, which at this -time **only allows the use of deployments from the NGINX repo - either NGINX IC or +repo-only`](./kubernetes/nginx/ingress-controller-repo-only) directory, which at this +time **only allows the use of deployments from the NGINX repo - either NGINX IC or NGINX Plus IC (with a JWT)**. -A sample config-map is provided in the Pulumi deployment code. This code will adjust -the logging format to approximate the upstream NGINX KIC project which will allow for +A sample config-map is provided in the Pulumi deployment code. This code will adjust +the logging format to approximate the upstream NGINX KIC project which will allow for easier ingestion into log storage and processing systems. -**Note**: This deployment uses the GA Ingress APIs. This has been tested with helm -chart version 0.11.1 and NGINX KIC 2.0.2. Older versions of the KIC and helm charts -can be used, but care should be taken to ensure that the helm chart version used is -compatible with the KIC version. This information can be found in the [NGINX KIC Release +**Note**: This deployment uses the GA Ingress APIs. This has been tested with helm +chart version 0.11.1 and NGINX KIC 2.0.2. Older versions of the KIC and helm charts +can be used, but care should be taken to ensure that the helm chart version used is +compatible with the KIC version. This information can be found in the [NGINX KIC Release Notes](https://docs.nginx.com/nginx-ingress-controller/releases/) for each release. #### Ingress API Versions and NGINX KIC -Starting with Kubernetes version 1.22, support for the Ingress Beta API -`networking.k8s.io/v1beta` will be dropped, requiring use of the GA Ingress API -`networking.k8s.io/v1`. However, Kubernetes versions 1.19 through 1.21 allows -these two API versions to coexist and maintains compatibility for consumers of -the API – meaning, the API will respond correctly to calls to either the `v1beta` +Starting with Kubernetes version 1.22, support for the Ingress Beta API +`networking.k8s.io/v1beta` will be dropped, requiring use of the GA Ingress API +`networking.k8s.io/v1`. However, Kubernetes versions 1.19 through 1.21 allows +these two API versions to coexist and maintains compatibility for consumers of +the API – meaning, the API will respond correctly to calls to either the `v1beta` and/or `v1` routes. -This project uses the NGINX KIC v2.x releases which includes full support +This project uses the NGINX KIC v2.x releases which includes full support for the GA APIs. ### Log Store -In the [`logstore`](./kubernetes/logstore) directory, you will find the Pulumi +In the [`logstore`](./kubernetes/logstore) directory, you will find the Pulumi project responsible for installing your log store. The current solution deploys [Elasticsearch and Kibana](https://www.elastic.co/elastic-stack) using the [Bitnami Elasticsearch](https://bitnami.com/stack/elasticsearch/helm) -chart. This solution can be swapped for other options as desired. This application -is deployed to the `logstore` namespace. There are several configuration options -available in the configuration file for the project in order to better tailor this +chart. This solution can be swapped for other options as desired. This application +is deployed to the `logstore` namespace. There are several configuration options +available in the configuration file for the project in order to better tailor this deployment to the size of the cluster being used. #### Notes -To access the Kibana dashboard via your web browser, you will need to set up port +To access the Kibana dashboard via your web browser, you will need to set up port forwarding for the kibana pod. This can be accomplished using the `kubectl` command: ``` @@ -234,22 +252,22 @@ Handling connection for 5601 ### Log Agent -In the [`logagent`](./logagent) directory, you will find the Pulumi project -responsible for installing your log agent. The current solution deploys -[`Filebeat`](https://www.elastic.co/beats/), which connects to the logstore -deployed in the previous step. This solution can be swapped for other options +In the [`logagent`](./logagent) directory, you will find the Pulumi project +responsible for installing your log agent. The current solution deploys +[`Filebeat`](https://www.elastic.co/beats/), which connects to the logstore +deployed in the previous step. This solution can be swapped for other options as desired. This application is deployed to the `logagent` namespace. ### Certificate Management -TLS is enabled via [cert-manager](https://cert-manager.io/), which is installed -in the cert-manager namespace. Creation of ClusterIssuer or Issuer resources is +TLS is enabled via [cert-manager](https://cert-manager.io/), which is installed +in the cert-manager namespace. Creation of ClusterIssuer or Issuer resources is delegated to the individual applications and is not done as part of this deployment. ### Prometheus -Prometheus is deployed and configured to enable the collection of metrics for -all components that have a defined service monitor. At installation time, the +Prometheus is deployed and configured to enable the collection of metrics for +all components that have a defined service monitor. At installation time, the deployment will instantiate: - Node Exporters @@ -258,90 +276,88 @@ deployment will instantiate: - The NGINX Ingress Controller - Statsd receiver -The former behavior of using the `prometheus.io:scrape: true` property set in -annotations indicating pods (where metrics should be scraped) has been deprecated, +The former behavior of using the `prometheus.io:scrape: true` property set in +annotations indicating pods (where metrics should be scraped) has been deprecated, and these annotations will be removed in the near future. -Also, the standalone Grafana deployment has been removed from the standard deployment +Also, the standalone Grafana deployment has been removed from the standard deployment scripts, as it is installed as part of this project. -Finally, this namespace will hold service monitors created by other projects. For -example, the Bank of Sirius deployment currently deploys a service monitor for each +Finally, this namespace will hold service monitors created by other projects. For +example, the Bank of Sirius deployment currently deploys a service monitor for each of the postgres monitors that are deployed. **Notes**: -1. The KIC needs to be configured to expose Prometheus metrics. This is currently +1. The KIC needs to be configured to expose Prometheus metrics. This is currently done by default. -2. The default address binding of the `kube-proxy` component is set to `127.0.0.1` - and therefore will cause errors when the canned Prometheus scrape configurations - are run. The fix is to set this address to `0.0.0.0`. An example manifest has been - provided in [prometheus/extras](./kubernetes/prometheus/extras) that can be applied - against your installation with `kubectl apply -f ./filename`. Please only apply this +2. The default address binding of the `kube-proxy` component is set to `127.0.0.1` + and therefore will cause errors when the canned Prometheus scrape configurations + are run. The fix is to set this address to `0.0.0.0`. An example manifest has been + provided in [prometheus/extras](./kubernetes/prometheus/extras) that can be applied + against your installation with `kubectl apply -f ./filename`. Please only apply this change once you have verified that it will work with your version of Kubernetes. -3. The _grafana_ namespace has been maintained in the configuration file to be used by - the Prometheus operator-deployed version of Grafana. This version only accepts a - password – you can still specify a username for the admin account but it will +3. The _grafana_ namespace has been maintained in the configuration file to be used by + the Prometheus operator-deployed version of Grafana. This version only accepts a + password – you can still specify a username for the admin account but it will be silently ignored. This will be changed in the future. ### Observability -We deploy the [OTEL Collector Operator](https://github.com/open-telemetry/opentelemetry-collector) -along with a simple collector. There are several other configurations in the -[observability/otel-objects](./kubernetes/observability/otel-objects) directory. -See the [README.md](./kubernetes/observability/otel-objects/README.md) file -in the [observability/otel-objects](./kubernetes/observability/otel-objects) for more information, +We deploy the [OTEL Collector Operator](https://github.com/open-telemetry/opentelemetry-collector) +along with a simple collector. There are several other configurations in the +[observability/otel-objects](./kubernetes/observability/otel-objects) directory. +See the [README.md](./kubernetes/observability/otel-objects/README.md) file +in the [observability/otel-objects](./kubernetes/observability/otel-objects) for more information, including an explanation of the default configuration. ### Demo Application A forked version of the Google [_Bank of Anthos_](https://github.com/GoogleCloudPlatform/bank-of-anthos) -application is contained in the [`sirius`](./kubernetes/applications/sirius) directory. -The github repository for this for is at +application is contained in the [`sirius`](./kubernetes/applications/sirius) directory. +The github repository for this for is at [_Bank of Sirius_](https://github.com/nginxinc/bank-of-sirius). -Normally, the `frontend` microservice is exposed via a load balancer -for traffic management. This deployment has been modified to use the NGINX -or NGINX Plus KIC to manage traffic to the `frontend` microservice. The NGINX -or NGINX Plus KIC is integrated into the cluster logging system, and the user +Normally, the `frontend` microservice is exposed via a load balancer +for traffic management. This deployment has been modified to use the NGINX +or NGINX Plus KIC to manage traffic to the `frontend` microservice. The NGINX +or NGINX Plus KIC is integrated into the cluster logging system, and the user can configure the KIC as desired. -An additional change to the application is the conversion of several of the -standard Kubernetes deployment manifests into Pulumi code. This has been done +An additional change to the application is the conversion of several of the +standard Kubernetes deployment manifests into Pulumi code. This has been done for the configuration maps, the ingress controller, and the JWT RSA signing key -pair. This allows the user to take advantage Pulumi's feature set, by demonstrating -the process of creating and deploying an RSA key pair at deployment time and using +pair. This allows the user to take advantage Pulumi's feature set, by demonstrating +the process of creating and deploying an RSA key pair at deployment time and using the project configuration file to set config variables, including secrets. As part of the Bank of Sirius deployment, we deploy a cluster-wide -[self-signed](https://cert-manager.io/docs/configuration/selfsigned/) issuer -using the cert-manager deployed above. This is then used by the ingress object -created to enable TLS access to the application. Note that this issuer can be -changed out by the user, for example to use the -[ACME](https://cert-manager.io/docs/configuration/acme/) issuer. -The use of the ACME issuer has been tested and works without issues, provided -the FQDN meets the length requirements. As of this writing, the AWS ELB hostname -is too long to work with the ACME server. Additional work in this area will be -undertaken to provide dynamic DNS record creation as part of this process so +[self-signed](https://cert-manager.io/docs/configuration/selfsigned/) issuer +using the cert-manager deployed above. This is then used by the ingress object +created to enable TLS access to the application. Note that this issuer can be +changed out by the user, for example to use the +[ACME](https://cert-manager.io/docs/configuration/acme/) issuer. +The use of the ACME issuer has been tested and works without issues, provided +the FQDN meets the length requirements. As of this writing, the AWS ELB hostname +is too long to work with the ACME server. Additional work in this area will be +undertaken to provide dynamic DNS record creation as part of this process so legitimate certificates can be issued. -To provide visibility into the Postgres databases that are running as part -of the application, the Prometheus Postgres data exporter will be deployed +To provide visibility into the Postgres databases that are running as part +of the application, the Prometheus Postgres data exporter will be deployed into the same namespace as the application and will be configured to be scraped by the Prometheus server installed earlier. -**Note**: Due to the way that Pulumi currently handles secrets, -the [sirius](./kubernetes/applications/sirius) directory contains its own -configuration directory [sirius/config](./kubernetes/applications/sirius/config). -This directory contains an example configuration file that can be copied over -and used. The user will be prompted to add passwords to the configuration file -at the first run of the [start.sh](../../bin/start_all.sh) script. This is a -workaround that will be retired as Pulumi provides better tools -for hierarchical configuration files. +**Note**: Due to the way that Pulumi currently handles secrets, +the [secrets](./kubernetes/secrets) directory contains its own +configuration directory [secrets/config](./kubernetes/secrets/config). +This directory contains an example configuration file that can be copied over +and used. The user will be prompted to add passwords to the configuration file +at the first run of the startup process. ## Simple Load Testing To help enable simple load testing, a script has been provided that uses the -`kubectl` command to port-forward monitoring and management connections +`kubectl` command to port-forward monitoring and management connections to the local workstation. This command is [`test-foward.sh`](../../bin/test-forward.sh). From bce74ab5d34d44993e6ef2c730372ad2e5dcfb41 Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 15 Aug 2022 08:35:57 -0600 Subject: [PATCH 21/21] fix: update to docker instance for minikube jenkins --- extras/jenkins/Minikube/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/jenkins/Minikube/Jenkinsfile b/extras/jenkins/Minikube/Jenkinsfile index d02acbc1..0d6c3d1d 100644 --- a/extras/jenkins/Minikube/Jenkinsfile +++ b/extras/jenkins/Minikube/Jenkinsfile @@ -107,7 +107,7 @@ pipeline { curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube mkdir -p /usr/local/bin/ install minikube /usr/local/bin/ - minikube start --vm-driver=docker --force + minikube start --vm-driver=docker --force --cpus 4 --memory 30000 ''' } }