-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from cloud-native-toolkit/updates-core-dns
adds dns support using fully qualified domain and letsencrypt
- Loading branch information
Showing
10 changed files
with
141 additions
and
7 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
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
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
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
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
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
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
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,27 @@ | ||
apiVersion: masauto.ibm.com/v1alpha1 | ||
kind: Core | ||
metadata: | ||
name: masauto-core-cis | ||
namespace: masauto-operator-system | ||
annotations: | ||
ansible.operator-sdk/reconcile-period: "0s" | ||
spec: | ||
mas_channel: "8.9.x" | ||
ibm_entitlement_secret: "ibm-entitlement-key" #secret where your ibm-entitlement-key is stored in operator namespace | ||
mas_instance_id: "inst1" | ||
mas_workspace_id: "masdev" | ||
mas_workspace_name: "MAS Development" | ||
mas_annotations: "mas.ibm.com/operationalMode=production" | ||
mongodb_storage_class: "ocs-storagecluster-ceph-rbd" | ||
uds_contact: | ||
email: "youremail@us.ibm.com" | ||
first_name: "yourfirstname" | ||
last_name: "yourlastname" | ||
uds_storage_class: "ocs-storagecluster-ceph-rbd" | ||
|
||
dns_provider: "cis" | ||
cis_crn: "<your crn>" | ||
cis_email: "<your email>" | ||
cis_apikey_secret: "cis-apikey-secret" #see advanced doc link for setup | ||
mas_domain: "mysubdomain.mydomain.com" | ||
mas_cluster_issuer: "inst1-cis-le-prod" |
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,28 @@ | ||
apiVersion: masauto.ibm.com/v1alpha1 | ||
kind: Core | ||
metadata: | ||
name: masauto-core-cloudflare | ||
namespace: masauto-operator-system | ||
annotations: | ||
ansible.operator-sdk/reconcile-period: "0s" | ||
spec: | ||
mas_channel: "8.9.x" | ||
ibm_entitlement_secret: "ibm-entitlement-key" #secret where your ibm-entitlement-key is stored in operator namespace | ||
mas_instance_id: "inst1" | ||
mas_workspace_id: "masdev" | ||
mas_workspace_name: "MAS Development" | ||
mas_annotations: "mas.ibm.com/operationalMode=production" | ||
mongodb_storage_class: "ocs-storagecluster-ceph-rbd" | ||
uds_contact: | ||
email: "youremail@us.ibm.com" | ||
first_name: "yourfirstname" | ||
last_name: "yourlastname" | ||
uds_storage_class: "ocs-storagecluster-ceph-rbd" | ||
|
||
dns_provider: "cloudflare" | ||
mas_domain: "mysubdomain.mydomain.com" | ||
cloudflare_email: "youremail@ibm.com" | ||
cloudflare_apitoken_secret: "cloudflare-apitoken-secret" #see advanced doc link for setup | ||
cloudflare_zone: "mydomain.com" | ||
cloudflare_subdomain: "mysubdomain" | ||
mas_cluster_issuer: "inst1-cloudflare-le-prod" |
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,54 @@ | ||
# These tasks grab the apikey for the dns provider | ||
- name: "If Cloudflare set: Check for required Cloudflare properties" | ||
when: dns_provider == "cloudflare" | ||
assert: | ||
that: | ||
- cloudflare_zone is defined and cloudflare_zone != "" | ||
- cloudflare_apitoken_secret is defined and cloudflare_apitoken_secret != "" | ||
- cloudflare_email is defined and cloudflare_email != "" | ||
- mas_domain is defined and mas_domain != "" | ||
fail_msg: "One or more required cloudflare variables are not defined" | ||
|
||
- name: "Get cloudflare apikey secret" | ||
when: dns_provider == "cloudflare" | ||
ignore_errors: true | ||
kubernetes.core.k8s_info: | ||
api_version: v1 | ||
kind: Secret | ||
name: "{{ cloudflare_apitoken_secret }}" | ||
namespace: "masauto-operator-system" | ||
register: cf_entitlement_credentials | ||
|
||
- name: "Set cf apikey based on secret" | ||
when: (cf_entitlement_credentials.api_found) and | ||
(cloudflare_apitoken_secret is defined and cloudflare_apitoken_secret != "") | ||
ignore_errors: true | ||
set_fact: | ||
cloudflare_apitoken: "{{ cf_entitlement_credentials.resources[0].data.apitoken | b64decode }}" | ||
|
||
- name: "If CIS set: Check for required CIS properties" | ||
when: dns_provider == "cis" | ||
assert: | ||
that: | ||
- cis_crn is defined and cis_crn != "" | ||
- cis_email is defined and cis_email != "" | ||
- cis_apikey_secret is defined and cis_apikey_secret != "" | ||
- mas_domain is defined and mas_domain != "" | ||
fail_msg: "One or more required cis properties are missing" | ||
|
||
- name: "Get cis apikey secret" | ||
when: dns_provider == "cloudflare" | ||
ignore_errors: true | ||
kubernetes.core.k8s_info: | ||
api_version: v1 | ||
kind: Secret | ||
name: "{{ cis_apikey_secret }}" | ||
namespace: "masauto-operator-system" | ||
register: cis_entitlement_credentials | ||
|
||
- name: "Set cis apikey based on secret" | ||
when: (cis_entitlement_credentials.api_found) and | ||
(cis_apikey_secret is defined and cis_apikey_secret != "") | ||
ignore_errors: true | ||
set_fact: | ||
cis_apikey: "{{ cis_entitlement_credentials.resources[0].data.apikey | b64decode }}" |