-
Notifications
You must be signed in to change notification settings - Fork 240
Add a basic ghost package #3381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| apiVersion: kpt.dev/v1 | ||
| kind: Kptfile | ||
| metadata: | ||
| name: ghost | ||
| annotations: | ||
| config.kubernetes.io/local-config: "true" | ||
| info: | ||
| description: sample description | ||
| pipeline: | ||
| mutators: | ||
| - image: gcr.io/kpt-fn/set-namespace:v0.3.4 | ||
| configPath: package-context.yaml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| ### Ghost Application | ||
|
|
||
| "Ghost is a powerful app for new-media creators to publish, share, and grow a business around their content. It comes with modern tools to build a website, publish content, send newsletters & offer paid subscriptions to members." | ||
| https://ghost.org/ | ||
|
|
||
| ### Quick start | ||
|
|
||
| #### Get KPT Pacakge | ||
| ```bash | ||
| export NAMESPACE=<YOUR NAMESPACE> | ||
| # make sure the namespace is correct and exists. Otherwise, create the namespace | ||
| kubectl create namespace ${NAMESPACE} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why can't we add namespace to the package itself ? If you used helm chart to get the manifests, you can use That will make the workflow truly declarative.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The ability to create a namespace would imply that the app team had cluster admin privilege. It also would bring in the need for the flexibility of the namespace provisioning scenario we've been working on: resource quota, limit range, network policy, etc.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should have an example namespace blueprint for this, which could be used instead of kubectl create namespace.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Aah.. completely missed that. Good pt. |
||
|
|
||
| # You get this Ghost package by running | ||
| kpt pkg get https://github.com/GoogleContainerTools/kpt.git/package-examples/ghost@main ${NAMESPACE} --for-deployment | ||
| ``` | ||
|
|
||
| #### Update the KRM resources to your own data | ||
|
|
||
| Updating the KRM resources are easy with variant constructor | ||
| ```bash | ||
| kpt fn render ${NAMESPACE} | ||
| ``` | ||
|
|
||
| #### Deploy the KRM resources to your cluster | ||
|
|
||
| ```bash | ||
| # Initialize inventory info. You only need to run this if do not have resourcesgroup.yaml | ||
| kpt live init ${NAMESPACE} | ||
|
|
||
| kpt live apply ${NAMESPACE} | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 | ||
| kind: CustomResourceDefinition | ||
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.8.0 | ||
| creationTimestamp: null | ||
| name: prometheusrules.monitoring.coreos.com | ||
| spec: | ||
| group: monitoring.coreos.com | ||
| names: | ||
| categories: | ||
| - prometheus-operator | ||
| kind: PrometheusRule | ||
| listKind: PrometheusRuleList | ||
| plural: prometheusrules | ||
| shortNames: | ||
| - promrule | ||
| singular: prometheusrule | ||
| scope: Namespaced | ||
| versions: | ||
| - name: v1 | ||
| schema: | ||
| openAPIV3Schema: | ||
| description: PrometheusRule defines recording and alerting rules for a Prometheus | ||
| instance | ||
| properties: | ||
| apiVersion: | ||
| description: 'APIVersion defines the versioned schema of this representation | ||
| of an object. Servers should convert recognized schemas to the latest | ||
| internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
| type: string | ||
| kind: | ||
| description: 'Kind is a string value representing the REST resource this | ||
| object represents. Servers may infer this from the endpoint the client | ||
| submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
| type: string | ||
| metadata: | ||
| type: object | ||
| spec: | ||
| description: Specification of desired alerting rule definitions for Prometheus. | ||
| properties: | ||
| groups: | ||
| description: Content of Prometheus rule file | ||
| items: | ||
| description: 'RuleGroup is a list of sequentially evaluated recording | ||
| and alerting rules. Note: PartialResponseStrategy is only used | ||
| by ThanosRuler and will be ignored by Prometheus instances. Valid | ||
| values for this field are ''warn'' or ''abort''. More info: https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response' | ||
| properties: | ||
| interval: | ||
| type: string | ||
| name: | ||
| type: string | ||
| partial_response_strategy: | ||
| type: string | ||
| rules: | ||
| items: | ||
| description: 'Rule describes an alerting or recording rule | ||
| See Prometheus documentation: [alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) | ||
| or [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules) | ||
| rule' | ||
| properties: | ||
| alert: | ||
| type: string | ||
| annotations: | ||
| additionalProperties: | ||
| type: string | ||
| type: object | ||
| expr: | ||
| anyOf: | ||
| - type: integer | ||
| - type: string | ||
| x-kubernetes-int-or-string: true | ||
| for: | ||
| type: string | ||
| labels: | ||
| additionalProperties: | ||
| type: string | ||
| type: object | ||
| record: | ||
| type: string | ||
| required: | ||
| - expr | ||
| type: object | ||
| type: array | ||
| required: | ||
| - name | ||
| - rules | ||
| type: object | ||
| type: array | ||
| type: object | ||
| required: | ||
| - spec | ||
| type: object | ||
| served: true | ||
| storage: true | ||
| status: | ||
| acceptedNames: | ||
| kind: "" | ||
| plural: "" | ||
| conditions: [] | ||
| storedVersions: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| apiVersion: kpt.dev/v1 | ||
| kind: Kptfile | ||
| metadata: | ||
| name: ghost-app | ||
| annotations: | ||
| config.kubernetes.io/local-config: "true" | ||
| info: | ||
| description: The Ghost App package contains the KRM resources for a Ghost Application. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: ghost-app | ||
| namespace: example | ||
| spec: | ||
| replicas: 1 | ||
| strategy: | ||
| type: RollingUpdate | ||
| template: | ||
| spec: | ||
| affinity: | ||
| podAffinity: | ||
| podAntiAffinity: | ||
| preferredDuringSchedulingIgnoredDuringExecution: | ||
| - podAffinityTerm: | ||
| namespaces: | ||
| - "example" | ||
| topologyKey: kubernetes.io/hostname | ||
| weight: 1 | ||
| nodeAffinity: | ||
| securityContext: | ||
| fsGroup: 1001 | ||
| containers: | ||
| - name: ghost-app | ||
| image: docker.io/bitnami/ghost:4.45.0-debian-10-r0 | ||
| imagePullPolicy: "IfNotPresent" | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsUser: 1001 | ||
| env: | ||
| - name: BITNAMI_DEBUG | ||
| value: "false" | ||
| - name: ALLOW_EMPTY_PASSWORD | ||
| value: "yes" | ||
| - name: GHOST_DATABASE_HOST | ||
| value: "example-mariadb" | ||
| - name: GHOST_DATABASE_PORT_NUMBER | ||
| value: "3306" | ||
| - name: GHOST_DATABASE_NAME | ||
| value: "bitnami_ghost" | ||
| - name: GHOST_DATABASE_USER | ||
| value: "bn_ghost" | ||
| - name: GHOST_HOST | ||
| value: "aa/" | ||
| - name: GHOST_PORT_NUMBER | ||
| value: "2368" | ||
| - name: GHOST_USERNAME | ||
| value: "user" | ||
| - name: GHOST_EMAIL | ||
| value: "[email protected]" | ||
| - name: GHOST_BLOG_TITLE | ||
| value: "User's Blog" | ||
| - name: GHOST_ENABLE_HTTPS | ||
| value: "no" | ||
| - name: GHOST_EXTERNAL_HTTP_PORT_NUMBER | ||
| value: "80" | ||
| - name: GHOST_EXTERNAL_HTTPS_PORT_NUMBER | ||
| value: "443" | ||
| - name: GHOST_SKIP_BOOTSTRAP | ||
| value: "no" | ||
| ports: | ||
| - name: http | ||
| containerPort: 2368 | ||
| protocol: TCP | ||
| livenessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: "http" | ||
| scheme: HTTP | ||
| initialDelaySeconds: 120 | ||
| periodSeconds: 10 | ||
| timeoutSeconds: 5 | ||
| failureThreshold: 6 | ||
| successThreshold: 1 | ||
| readinessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: "http" | ||
| scheme: HTTP | ||
| initialDelaySeconds: 30 | ||
| periodSeconds: 5 | ||
| timeoutSeconds: 3 | ||
| failureThreshold: 6 | ||
| successThreshold: 1 | ||
| resources: | ||
| limits: {} | ||
| requests: {} | ||
| volumeMounts: | ||
| - name: ghost-data | ||
| mountPath: /bitnami/ghost | ||
| volumes: | ||
| - name: ghost-data | ||
| persistentVolumeClaim: | ||
| claimName: ghost-app |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: ghost-app | ||
| namespace: example | ||
| spec: | ||
| rules: | ||
| - host: ghost.local | ||
| http: | ||
| paths: | ||
| - path: / | ||
| pathType: ImplementationSpecific | ||
| backend: | ||
| service: | ||
| name: ghost-app | ||
| port: | ||
| name: http |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: ghost-app | ||
| spec: | ||
| ingress: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: kptfile.kpt.dev | ||
| annotations: | ||
| config.kubernetes.io/local-config: "true" | ||
| data: | ||
| name: example |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Source: ghost/templates/pvc.yaml | ||
| kind: PersistentVolumeClaim | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: ghost-app | ||
| namespace: example | ||
| spec: | ||
| accessModes: | ||
| - "ReadWriteOnce" | ||
| resources: | ||
| requests: | ||
| storage: "8Gi" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: ghost-app | ||
| namespace: example | ||
| spec: | ||
| type: LoadBalancer | ||
| externalTrafficPolicy: Cluster | ||
| sessionAffinity: None | ||
| ports: | ||
| - name: http | ||
| port: 80 | ||
| protocol: TCP | ||
| targetPort: http |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| apiVersion: kpt.dev/v1 | ||
| kind: Kptfile | ||
| metadata: | ||
| name: mariadb | ||
| annotations: | ||
| config.kubernetes.io/local-config: "true" | ||
| info: | ||
| description: The MariaDB which provides the storage for Ghost. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Source: ghost/charts/mariadb/templates/primary/configmap.yaml | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: mariadb | ||
| namespace: example | ||
| data: | ||
| my.ini: |- | ||
| [mysqld] | ||
| skip-name-resolve | ||
| explicit_defaults_for_timestamp | ||
| basedir=/opt/bitnami/mariadb | ||
| plugin_dir=/opt/bitnami/mariadb/plugin | ||
| port=3306 | ||
| socket=/opt/bitnami/mariadb/tmp/mysql.sock | ||
| tmpdir=/opt/bitnami/mariadb/tmp | ||
| max_allowed_packet=16M | ||
| bind-address=* | ||
| pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid | ||
| log-error=/opt/bitnami/mariadb/logs/mysqld.log | ||
| character-set-server=UTF8 | ||
| collation-server=utf8_general_ci | ||
| slow_query_log=0 | ||
| slow_query_log_file=/opt/bitnami/mariadb/logs/mysqld.log | ||
| long_query_time=10.0 | ||
|
|
||
| [client] | ||
| port=3306 | ||
| socket=/opt/bitnami/mariadb/tmp/mysql.sock | ||
| default-character-set=UTF8 | ||
| plugin_dir=/opt/bitnami/mariadb/plugin | ||
|
|
||
| [manager] | ||
| port=3306 | ||
| socket=/opt/bitnami/mariadb/tmp/mysql.sock | ||
| pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Source: ghost/charts/mariadb/templates/primary/networkpolicy-ingress.yaml | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: mariadb | ||
| spec: | ||
| ingress: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: kptfile.kpt.dev | ||
| annotations: | ||
| config.kubernetes.io/local-config: "true" | ||
| data: | ||
| name: example | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so variant constructor pattern isn't support well (or tested :)) for nested packages, so will be interesting to see how this plays out.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A user in slack has encountered similar issues using Config Connector subpackages (e.g., CloudSQL). |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Source: ghost/charts/mariadb/templates/prometheusrules.yaml | ||
| apiVersion: monitoring.coreos.com/v1 | ||
| kind: PrometheusRule | ||
| metadata: | ||
| name: mariadb | ||
| namespace: example | ||
| spec: | ||
| groups: | ||
| - name: mariadb | ||
| rules: [] |
Uh oh!
There was an error while loading. Please reload this page.