Skip to content

Commit 026bc4c

Browse files
committed
update ghost pacakge
1 parent 136f777 commit 026bc4c

22 files changed

+158
-142
lines changed

package-examples/ghost/README.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
1+
### Ghost Application
2+
3+
"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."
4+
https://ghost.org/
5+
6+
### Quick start
7+
8+
#### Get KPT Pacakge
19
```bash
2-
# Fetch ghost helm charts
3-
helm fetch --untar bitnami/ghost
4-
# By default networking, metrics are disabled.
5-
helm template example ghost > rendered.yaml
6-
rm -rf ghost
7-
# Restructure the KRM resources by app. This should give two directories: ./mariadb /ghost
8-
kubectl-slice -f rendered.yaml --template '{{ index "app.kubernetes.io/name" .metadata.labels }}/{{.kind | lower}}-{{.metadata.name|dottodash}}.yaml' -o ghost
9-
rm rendered.yaml
10+
export NAMESPACE=<YOUR NAMESPACE>
11+
# make sure the namespace is correct and exists. Otherwise, create the namespace
12+
kubectl create namespace ${NAMESPACE}
13+
14+
# You get this Ghost package by running
15+
kpt pkg get https://github.com/GoogleContainerTools/kpt.git/package-examples/ghost@main ${NAMESPACE} --for-deployment
16+
```
17+
18+
#### Update the KRM resources to your own data
19+
20+
Updating the KRM resources are easy with variant constructor
21+
```bash
22+
kpt fn render ${NAMESPACE}
23+
```
24+
25+
#### Deploy the KRM resources to your cluster
26+
27+
```bash
28+
# Initialize inventory info. You only need to run this if do not have resourcesgroup.yaml
29+
kpt live init ${NAMESPACE}
30+
31+
kpt live apply ${NAMESPACE}
1032
```
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: v0.8.0
6+
creationTimestamp: null
7+
name: prometheusrules.monitoring.coreos.com
8+
spec:
9+
group: monitoring.coreos.com
10+
names:
11+
categories:
12+
- prometheus-operator
13+
kind: PrometheusRule
14+
listKind: PrometheusRuleList
15+
plural: prometheusrules
16+
shortNames:
17+
- promrule
18+
singular: prometheusrule
19+
scope: Namespaced
20+
versions:
21+
- name: v1
22+
schema:
23+
openAPIV3Schema:
24+
description: PrometheusRule defines recording and alerting rules for a Prometheus
25+
instance
26+
properties:
27+
apiVersion:
28+
description: 'APIVersion defines the versioned schema of this representation
29+
of an object. Servers should convert recognized schemas to the latest
30+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
31+
type: string
32+
kind:
33+
description: 'Kind is a string value representing the REST resource this
34+
object represents. Servers may infer this from the endpoint the client
35+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: Specification of desired alerting rule definitions for Prometheus.
41+
properties:
42+
groups:
43+
description: Content of Prometheus rule file
44+
items:
45+
description: 'RuleGroup is a list of sequentially evaluated recording
46+
and alerting rules. Note: PartialResponseStrategy is only used
47+
by ThanosRuler and will be ignored by Prometheus instances. Valid
48+
values for this field are ''warn'' or ''abort''. More info: https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response'
49+
properties:
50+
interval:
51+
type: string
52+
name:
53+
type: string
54+
partial_response_strategy:
55+
type: string
56+
rules:
57+
items:
58+
description: 'Rule describes an alerting or recording rule
59+
See Prometheus documentation: [alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/)
60+
or [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules)
61+
rule'
62+
properties:
63+
alert:
64+
type: string
65+
annotations:
66+
additionalProperties:
67+
type: string
68+
type: object
69+
expr:
70+
anyOf:
71+
- type: integer
72+
- type: string
73+
x-kubernetes-int-or-string: true
74+
for:
75+
type: string
76+
labels:
77+
additionalProperties:
78+
type: string
79+
type: object
80+
record:
81+
type: string
82+
required:
83+
- expr
84+
type: object
85+
type: array
86+
required:
87+
- name
88+
- rules
89+
type: object
90+
type: array
91+
type: object
92+
required:
93+
- spec
94+
type: object
95+
served: true
96+
storage: true
97+
status:
98+
acceptedNames:
99+
kind: ""
100+
plural: ""
101+
conditions: []
102+
storedVersions: []

package-examples/ghost/ghost/Kptfile renamed to package-examples/ghost/ghost-app/Kptfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apiVersion: kpt.dev/v1
22
kind: Kptfile
33
metadata:
4-
name: ghost
4+
name: ghost-app
55
annotations:
66
config.kubernetes.io/local-config: "true"
77
info:
8-
description: sample description
8+
description: The Ghost App package contains the KRM resources for a Ghost Application.
99
pipeline:
1010
mutators:
1111
- image: gcr.io/kpt-fn/set-labels:v0.1.5

package-examples/ghost/ghost/deployment-example-ghost.yaml renamed to package-examples/ghost/ghost-app/deployment-ghost.yaml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: example-ghost
4+
name: ghost-app
55
namespace: example
66
spec:
77
replicas: 1
88
strategy:
99
type: RollingUpdate
1010
template:
11-
metadata:
12-
annotations:
13-
checksum/secrets: 711677f8a87ff3df1d09863858613b5dbecb3f6b8ea51a8c37b40762aff66a20
1411
spec:
1512
affinity:
1613
podAffinity:
@@ -25,7 +22,7 @@ spec:
2522
securityContext:
2623
fsGroup: 1001
2724
containers:
28-
- name: example-ghost
25+
- name: ghost-app
2926
image: docker.io/bitnami/ghost:4.45.0-debian-10-r0
3027
imagePullPolicy: "IfNotPresent"
3128
securityContext:
@@ -44,22 +41,12 @@ spec:
4441
value: "bitnami_ghost"
4542
- name: GHOST_DATABASE_USER
4643
value: "bn_ghost"
47-
- name: GHOST_DATABASE_PASSWORD
48-
valueFrom:
49-
secretKeyRef:
50-
name: example-mariadb
51-
key: mariadb-password
5244
- name: GHOST_HOST
5345
value: "aa/"
5446
- name: GHOST_PORT_NUMBER
5547
value: "2368"
5648
- name: GHOST_USERNAME
5749
value: "user"
58-
- name: GHOST_PASSWORD
59-
valueFrom:
60-
secretKeyRef:
61-
name: example-ghost
62-
key: ghost-password
6350
- name: GHOST_EMAIL
6451
value: "user@example.com"
6552
- name: GHOST_BLOG_TITLE
@@ -105,4 +92,4 @@ spec:
10592
volumes:
10693
- name: ghost-data
10794
persistentVolumeClaim:
108-
claimName: example-ghost
95+
claimName: ghost-app

package-examples/ghost/ghost/ingress-example-ghost.yaml renamed to package-examples/ghost/ghost-app/ingress-ghost.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: networking.k8s.io/v1
22
kind: Ingress
33
metadata:
4-
name: example-ghost
4+
name: ghost-app
55
namespace: example
66
spec:
77
rules:
@@ -12,6 +12,6 @@ spec:
1212
pathType: ImplementationSpecific
1313
backend:
1414
service:
15-
name: example-ghost
15+
name: ghost-app
1616
port:
1717
name: http
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: networking.k8s.io/v1
22
kind: NetworkPolicy
33
metadata:
4-
name: example-ghost-ingress
4+
name: ghost-app
55
spec:
66
ingress:

package-examples/ghost/ghost/persistentvolumeclaim-example-ghost.yaml renamed to package-examples/ghost/ghost-app/persistentvolumeclaim-ghost.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
kind: PersistentVolumeClaim
33
apiVersion: v1
44
metadata:
5-
name: example-ghost
5+
name: ghost-app
66
namespace: example
77
spec:
88
accessModes:

package-examples/ghost/ghost/service-example-ghost.yaml renamed to package-examples/ghost/ghost-app/service-ghost.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: example-ghost
4+
name: ghost-app
55
namespace: example
66
spec:
77
type: LoadBalancer

package-examples/ghost/ghost/setlabels.yaml renamed to package-examples/ghost/ghost-app/setlabels.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ metadata:
55
annotations:
66
config.kubernetes.io/local-config: "true"
77
labels:
8-
app.kubernetes.io/name: ghost
9-
app.kubernetes.io/instance: example
10-
app.kubernetes.io/component: ghost
8+
app.kubernetes.io/name: ghost-app
9+
app.kubernetes.io/component: ghost-app

0 commit comments

Comments
 (0)