-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ef9a78
commit 99e170b
Showing
23 changed files
with
409 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: tssc-dev-development | ||
namespace: rhtap | ||
finalizers: ["resources-finalizer.argocd.argoproj.io"] | ||
spec: | ||
project: default | ||
source: | ||
path: ./components/tssc-dev/overlays/development | ||
repoURL: https://github.com/redhat-appstudio/tssc-dev-gitops.git | ||
targetRevision: main | ||
destination: | ||
namespace: rhtap-app-development | ||
server: https://kubernetes.default.svc | ||
syncPolicy: | ||
managedNamespaceMetadata: | ||
labels: | ||
argocd.argoproj.io/managed-by: rhtap | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true | ||
- PruneLast=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: tssc-dev-prod | ||
namespace: rhtap | ||
finalizers: ["resources-finalizer.argocd.argoproj.io"] | ||
spec: | ||
project: default | ||
source: | ||
path: ./components/tssc-dev/overlays/prod | ||
repoURL: https://github.com/redhat-appstudio/tssc-dev-gitops.git | ||
targetRevision: main | ||
destination: | ||
namespace: rhtap-app-prod | ||
server: https://kubernetes.default.svc | ||
syncPolicy: | ||
managedNamespaceMetadata: | ||
labels: | ||
argocd.argoproj.io/managed-by: rhtap | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true | ||
- PruneLast=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: tssc-dev-stage | ||
namespace: rhtap | ||
finalizers: ["resources-finalizer.argocd.argoproj.io"] | ||
spec: | ||
project: default | ||
source: | ||
path: ./components/tssc-dev/overlays/stage | ||
repoURL: https://github.com/redhat-appstudio/tssc-dev-gitops.git | ||
targetRevision: main | ||
destination: | ||
namespace: rhtap-app-stage | ||
server: https://kubernetes.default.svc | ||
syncPolicy: | ||
managedNamespaceMetadata: | ||
labels: | ||
argocd.argoproj.io/managed-by: rhtap | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true | ||
- PruneLast=true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
commonLabels: | ||
rhtap/gitops: tssc-dev | ||
janus-idp.io/tekton: tssc-dev | ||
backstage.io/kubernetes-id: tssc-dev | ||
backstage.io/kubernetes-namespace: rhtap-app | ||
app.kubernetes.io/part-of: tssc-dev | ||
resources: | ||
- application-dev.yaml | ||
- application-stage.yaml | ||
- application-prod.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: tssc-dev | ||
namespace: rhtap | ||
finalizers: ["resources-finalizer.argocd.argoproj.io"] | ||
spec: | ||
project: default | ||
source: | ||
path: ./app-of-apps | ||
repoURL: https://github.com/redhat-appstudio/tssc-dev-gitops.git | ||
targetRevision: main | ||
destination: | ||
namespace: rhtap-app | ||
server: https://kubernetes.default.svc | ||
syncPolicy: | ||
managedNamespaceMetadata: | ||
labels: | ||
argocd.argoproj.io/managed-by: rhtap | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true | ||
- PruneLast=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# http | ||
|
||
## HTTP Application | ||
This template provides a standard HTTP component consisting of a deployment, service and route. | ||
|
||
The following day 2 edit/update operations supported: | ||
set/get image - updates the image for this component | ||
set/get replicas | ||
|
||
## Example | ||
``` | ||
tad add-component c1 http | ||
tad set c1 replicas 3 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
tad.gitops.set/image: ".spec.template.spec.containers[0].image" | ||
tad.gitops.get/image: ".spec.template.spec.containers[0].image" | ||
tad.gitops.set/replicas: ".spec.replicas" | ||
tad.gitops.get/replicas: ".spec.replicas" | ||
labels: | ||
app.kubernetes.io/instance: tssc-dev | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: tssc-dev | ||
app.kubernetes.io/part-of: tssc-dev-gitops | ||
name: tssc-dev | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: tssc-dev | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: tssc-dev | ||
spec: | ||
containers: | ||
- image: quay.io/redhat-appstudio/dance-bootstrap-app:latest | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
httpGet: | ||
path: / | ||
port: 8081 | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
name: container-image | ||
ports: | ||
- containerPort: 8081 | ||
readinessProbe: | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
tcpSocket: | ||
port: 8081 | ||
resources: | ||
limits: | ||
cpu: "1" | ||
memory: 512Mi | ||
requests: | ||
cpu: 10m | ||
memory: 50Mi | ||
env: | ||
- name: GIT_REPO | ||
value: https://github.com/northdepot/tssc-dev-gitops | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: initialize-namespace-tssc-dev-gitops | ||
spec: | ||
template: | ||
metadata: | ||
name: initialize-namespace-tssc-dev-gitops | ||
spec: | ||
serviceAccountName: pipeline | ||
containers: | ||
- name: initialize-namespace | ||
image: quay.io/redhat-appstudio/appstudio-utils:5bd7d6cb0b17f9f2eab043a8ad16ba3d90551bc2@sha256:8c7fcf86af40c71aeb58e4279625c8308af5144e2f6b8e28b0ec7e795260e5f7 | ||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
NS=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace) | ||
echo "Initialize RHTAP Namespace: $NS" | ||
cat <<CONFIGURE_PIPELINE | oc create -f - | ||
apiVersion: tekton.dev/v1 | ||
kind: PipelineRun | ||
metadata: | ||
generateName: rhtap-dev-namespace-setup- | ||
namespace: $NS | ||
spec: | ||
pipelineSpec: | ||
tasks: | ||
- name: configure-namespace | ||
taskRef: | ||
kind: Task | ||
params: | ||
- name: kind | ||
value: task | ||
- name: name | ||
value: rhtap-dev-namespace-setup | ||
- name: namespace | ||
value: rhtap | ||
resolver: cluster | ||
CONFIGURE_PIPELINE | ||
restartPolicy: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
commonLabels: | ||
argocd/app-name: tssc-dev | ||
janus-idp.io/tekton: tssc-dev | ||
backstage.io/kubernetes-id: tssc-dev | ||
backstage.io/kubernetes-namespace: rhtap-app | ||
app.kubernetes.io/part-of: tssc-dev | ||
resources: | ||
- deployment.yaml | ||
- route.yaml | ||
- service.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: tssc-dev | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: tssc-dev | ||
name: tssc-dev | ||
spec: | ||
port: | ||
targetPort: 8081 | ||
tls: | ||
insecureEdgeTerminationPolicy: Redirect | ||
termination: edge | ||
to: | ||
kind: Service | ||
name: tssc-dev | ||
weight: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: tssc-dev | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: tssc-dev | ||
name: tssc-dev | ||
spec: | ||
ports: | ||
- port: 8081 | ||
targetPort: 8081 | ||
selector: | ||
app.kubernetes.io/instance: tssc-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
COMPONENTS_ROOT=$1 | ||
GETTER='.metadata.annotations.["tad.gitops.get/image"]' | ||
|
||
FILES="$COMPONENTS_ROOT/base/deployment.yaml $COMPONENTS_ROOT/overlays/development/deployment-patch.yaml" | ||
for file in $FILES | ||
do | ||
KEY=$(yq "$GETTER" $file) | ||
if [ "$KEY" == "null" ] | ||
then | ||
echo "$GETTER missing in $file" | ||
else | ||
VALUE=$(yq e "$KEY" $file) | ||
echo "$VALUE image in $file" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
COMPONENTS_ROOT=$1 | ||
GETTER='.metadata.annotations.["tad.gitops.get/replicas"]' | ||
|
||
FILES="$COMPONENTS_ROOT/base/deployment.yaml $COMPONENTS_ROOT/overlays/development/deployment-patch.yaml" | ||
for file in $FILES | ||
do | ||
KEY=$(yq "$GETTER" $file) | ||
if [ "$KEY" == "null" ] | ||
then | ||
echo "$GETTER missing in $file" | ||
else | ||
VALUE=$(yq e "$KEY" $file) | ||
echo "$VALUE replicas in $file" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
COMPONENTS_ROOT=$1 | ||
VALUE=${2:-error} | ||
SETTER='.metadata.annotations.["tad.gitops.set/image"]' | ||
|
||
FILES="$COMPONENTS_ROOT/base/deployment.yaml $COMPONENTS_ROOT/overlays/development/deployment-patch.yaml" | ||
for file in $FILES | ||
do | ||
KEY=$(yq "$SETTER" $file) | ||
if [ "$KEY" == "null" ] | ||
then | ||
echo "$SETTER missing in $file" | ||
else | ||
echo "Using $KEY to set image in $file" | ||
yq -i e "$KEY=\"$VALUE\"" $file | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
COMPONENTS_ROOT=$1 | ||
VALUE=${2:-error} | ||
SETTER='.metadata.annotations.["tad.gitops.set/replicas"]' | ||
|
||
FILES="$COMPONENTS_ROOT/base/deployment.yaml $COMPONENTS_ROOT/overlays/development/deployment-patch.yaml" | ||
for file in $FILES | ||
do | ||
KEY=$(yq "$SETTER" $file) | ||
if [ "$KEY" == "null" ] | ||
then | ||
echo "$SETTER missing in $file" | ||
else | ||
echo "Using $KEY to set replicas in $file" | ||
yq -i e "$KEY=$VALUE" $file | ||
fi | ||
done |
16 changes: 16 additions & 0 deletions
16
components/tssc-dev/overlays/development/deployment-patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
tad.gitops.set/image: ".spec.template.spec.containers[0].image" | ||
tad.gitops.get/image: ".spec.template.spec.containers[0].image" | ||
tad.gitops.set/replicas: ".spec.replicas" | ||
tad.gitops.get/replicas: ".spec.replicas" | ||
name: tssc-dev | ||
spec: | ||
replicas: 1 | ||
template: | ||
spec: | ||
containers: | ||
- image: quay.io/jduimovich0/bootstrap:jenkins-034ac8f16d765058c7384b8b30624786753aed80 | ||
name: container-image |
6 changes: 6 additions & 0 deletions
6
components/tssc-dev/overlays/development/gitops-repository.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: "pipelinesascode.tekton.dev/v1alpha1" | ||
kind: Repository | ||
metadata: | ||
name: tssc-dev-gitops-repository | ||
spec: | ||
url: https://github.com/northdepot/tssc-dev-gitops |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
patchesStrategicMerge: | ||
- deployment-patch.yaml | ||
resources: | ||
- ../../base |
6 changes: 6 additions & 0 deletions
6
components/tssc-dev/overlays/development/source-repository.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: "pipelinesascode.tekton.dev/v1alpha1" | ||
kind: Repository | ||
metadata: | ||
name: tssc-dev-repository | ||
spec: | ||
url: https://github.com/northdepot/tssc-dev |
Oops, something went wrong.