Skip to content

Commit

Permalink
Merge pull request #27 from keptn-sandbox/dynatrace-support
Browse files Browse the repository at this point in the history
Added Gitea, Monaco and upstream git repos
  • Loading branch information
grabnerandi authored Jan 13, 2021
2 parents 7171a69 + eaf2aa4 commit c41cce7
Show file tree
Hide file tree
Showing 16 changed files with 4,212 additions and 29 deletions.
30 changes: 26 additions & 4 deletions README-KeptnForDynatrace.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,20 @@ $ export [email protected]

You see that the sample uses the `--with-demo dynatrace`, `--letsencrypt` and `--provider aws` option:
```console
$ curl -Lsf https://raw.githubusercontent.com/keptn-sandbox/keptn-on-k3s/dynatrace-support/install-keptn-on-k3s.sh | bash -s - --provider aws --with-dynatrace --with-demo dynatrace --letsencrypt
$ curl -Lsf https://raw.githubusercontent.com/keptn-sandbox/keptn-on-k3s/dynatrace-support/install-keptn-on-k3s.sh | bash -s - --provider aws --with-dynatrace --with-demo dynatrace --letsencrypt --with-gitea
```

All URLs provided will be of form http(s)://keptn.12.23.34.45.xip.io. xip.io is a free DNS resolution service which will resolve any DNS request to that IP Address as part of the DNS name.

**Option 2:** Use your own custom domain that points to your host
You see that the sample additionally uses the `--fqdn mykeptn.mydomain.com` option:
```console
$ curl -Lsf https://raw.githubusercontent.com/keptn-sandbox/keptn-on-k3s/dynatrace-support/install-keptn-on-k3s.sh | bash -s - --provider aws --with-dynatrace --with-demo dynatrace --letsencrypt --fqdn mykeptn.mydomain.com
$ curl -Lsf https://raw.githubusercontent.com/keptn-sandbox/keptn-on-k3s/dynatrace-support/install-keptn-on-k3s.sh | bash -s - --provider aws --with-dynatrace --with-demo dynatrace --letsencrypt --fqdn mykeptn.mydomain.com --with-gitea
```

All URLs provided will be of form http(s)://keptn.YOURDOMAIN. So - when setting up your own custom domain name make sure that you have a wildcard route so that all subdomains from your FQDN will also map to your machine where you install Keptn on k3s.


Installation will take about 4-5 minutes assuming there are no issues with getting a certifcate, you have enough resources, ...
In case you run into an issue - simply try it again. If you still have an issue - ping us on the [Keptn Slack](https://slack.keptn.sh)

Expand All @@ -69,11 +74,15 @@ In case you run into an issue - simply try it again. If you still have an issue
#######################################>
# Keptn Deployment Summary
#######################################>
API URL : https://12.23.34.45.xip.io/api
Bridge URL: https://12.23.34.45.xip.io/bridge
API URL : https://keptn.12.23.34.45.xip.io/api
Bridge URL: https://keptn.12.23.34.45.xip.io/bridge
Bridge Username: keptn
Bridge Password: BRIDGEPASSWORD
API Token : KEPTN_API_TOKEN
Git Server: http://git.12.23.34.45.xip.io
Git User: keptn
Git Password: keptn#R0cks


#######################################>
# Dynatrace Demo Summary: 3 Use Cases to explore
Expand Down Expand Up @@ -120,6 +129,19 @@ After that also remove the demo files that were downloaded in your local working
Now go and enjoy Keptn!
```

## Accessing Keptn projects and configuration files

If you have used the `--with-gitea` option the installation script not only installed Gitea (a Git Service) but also created Git repositories and set them as upstream git repos for each created keptn project via `keptn update project --git-xxxx`
Now - if you have not used that option but if you have your own Git account on either GitHub, Bitbucket, GitLab, Azure ... then you can simply update each keptn project and point it to your own upstream gits. More information on that can be found here: [Git-based upstream](https://keptn.sh/docs/0.7.x/manage/git_upstream/)

Here is the overview of the created Keptn Projects:
![](./images/keptn_project_overview.png)

If you have the Git-upstream you can simply click on that link and it brings you to your git-upstream repo. Thats a great way to learn how Keptn organizes its configuration files in Git. You will see the main branch with the shipyard.yaml as well as the stage specific branches with stage and service specific files:

![](./images/gitea_upstream_git.png)


## Use Case 1: Quality Gate

**Watch this Use Case on YouTube:** [SLO-based Quality Gates with Keptn & Dynatrace in 5 Minutes](https://www.youtube.com/watch?v=650Gn--XEQE&list=PLqt2rd0eew1YFx9m8dBFSiGYSBcDuWG38&index=4&t=2s)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ The script allows a couple of parameters
| `--ip` | YOURIP | Allows you to pass your own IP of your host |
| `--fqdn` | YOURFQDN | Allows you to pass your own hostname, allows you to create production LetsEncrypt Certificates, You need to create your own DNS entry |
| `--with-demo` | dynatrace | Will install demo projects for Dynatrace |
| `--with-gitea` | | Will install Gitea and upstream Git repos for every Keptn project |

### TLS Certificates
keptn-on-k3s comes with [cert-manager](https://cert-manager.io/). By default, a self-signed certificate is generated. By adding `--letsencrypt` as a parameter, and a CERT_EMAIL is exported, you will create a LetsEncrypt-Staging certificate. By additionally exporting `LE_STAGE=production`, a LetsEncypt Production certificate will be issued (will not work with xip.io and nip.io).
Expand Down
153 changes: 153 additions & 0 deletions files/gitea/helm-gitea.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Default values for gitea.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

clusterDomain: cluster.local

image:
repository: gitea/gitea
version: 1.12.5
pullPolicy: Always

imagePullSecrets: []

service:
http:
type: ClusterIP
port: 3000
ssh:
type: ClusterIP
port: 22
#loadBalancerIP:
#nodePort:
#externalTrafficPolicy:
#externalIPs:
annotations:

ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- git.domain.placeholder
tls: []
# - secretName: chart-example-tls
# hosts:
# - git.example.com

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}

statefulset:
env: []
# - name: VARIABLE
# value: my-value
terminationGracePeriodSeconds: 60

persistence:
enabled: true
# existingClaim:
size: 10Gi
accessModes:
- ReadWriteOnce

gitea:
admin:
username: GIT_USER.placeholder
password: GIT_PASSWORD.placeholder
email: "[email protected]"

ldap:
enabled: false
name: ""
securityProtocol: ""
host: ""
port: ""
userSearchBase: ""
userFilter: ""
adminFilter: ""
emailAttribute: ""
bindDn: ""
bindPassword: ""
usernameAttribute: ""

config: {}
# APP_NAME: "Gitea: Git with a cup of tea"
# RUN_MODE: dev
#
# server:
# SSH_PORT: 22
#
# security:
# PASSWORD_COMPLEXITY: spec

podAnnotations: {}

database:
builtIn:
postgresql:
enabled: true
mysql:
enabled: false
mariadb:
enabled: false

cache:
builtIn:
enabled: true

memcached:
service:
port: 11211

postgresql:
global:
postgresql:
postgresqlDatabase: gitea
postgresqlUsername: gitea
postgresqlPassword: gitea
servicePort: 5432
persistence:
size: 10Gi

mysql:
root:
password: gitea
db:
user: gitea
password: gitea
name: gitea
service:
port: 3306
persistence:
size: 10Gi

mariadb:
auth:
database: gitea
username: gitea
password: gitea
rootPassword: gitea
primary:
service:
port: 3306
persistence:
size: 10Gi
Loading

0 comments on commit c41cce7

Please sign in to comment.